Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: DSD-DBS/capella-collab-manager
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c14eef113d75c79fad7013ea49f7bc53bb0e39f0
Choose a base ref
...
head repository: DSD-DBS/capella-collab-manager
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6f394635893f03e82f17d0d9a1892660b5d31c53
Choose a head ref
  • 3 commits
  • 9 files changed
  • 2 contributors

Commits on Nov 14, 2024

  1. chore: Always use the latest alembic version

    MoritzWeber0 committed Nov 14, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    MoritzWeber0 Moritz Weber
    Copy the full SHA
    46c61c9 View commit details
  2. Merge pull request #2003 from DSD-DBS/remove-alembic-version

    chore: Always use the latest alembic version
    MoritzWeber0 authored Nov 14, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    5c1976f View commit details
  3. feat: Allow customizing feedback hint and update dialog

    - Allow customizing the hint text.
    - Always show the text input to prevent layout shift
    - Enable dynamic sizing for hint to prevent layout issues
    zusorio committed Nov 14, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    zusorio Tobias Messner
    Copy the full SHA
    6f39463 View commit details
4 changes: 4 additions & 0 deletions backend/capellacollab/settings/configuration/models.py
Original file line number Diff line number Diff line change
@@ -157,6 +157,10 @@ class FeedbackConfiguration(core_pydantic.BaseModelStrict):
description="Email addresses to send feedback to.",
examples=[[], ["test@example.com"]],
)
hint_text: str = pydantic.Field(
default="Try to be specific. What happened? What were you doing?",
description="Text to display as a hint in the feedback form.",
)


class BetaConfiguration(core_pydantic.BaseModelStrict):
2 changes: 1 addition & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ classifiers = [
]
dependencies = [
"PyYAML",
"alembic==1.13.3",
"alembic",
"appdirs",
"cachetools",
"email-validator",
2 changes: 2 additions & 0 deletions backend/tests/test_feedback.py
Original file line number Diff line number Diff line change
@@ -203,6 +203,7 @@ def test_feedback_is_updated(
"on_session_card": True,
"interval": {"enabled": True, "hours_between_prompt": 24},
"recipients": ["test@example.com"],
"hint_text": "test",
}
},
)
@@ -218,6 +219,7 @@ def test_feedback_is_updated(
"on_session_card": True,
"interval": {"enabled": True, "hours_between_prompt": 24},
"recipients": ["test@example.com"],
"hint_text": "test",
}


1 change: 1 addition & 0 deletions docs/docs/admin/configure-for-your-org.md
Original file line number Diff line number Diff line change
@@ -95,6 +95,7 @@ feedback:
recipients: # (1)!
- test1@example.com
- test2@example.com
hint_text: Try to be specific. What happened? What were you doing?
```

Prompts that are associated with a session automatically include anonymized

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ <h1 class="text-lg font-semibold">
How were your sessions?
}
</h1>
<div class="space-y-4">
<div class="space-y-2">
<div class="flex justify-center space-x-4">
@for (rating of ratings; track rating) {
<button
@@ -50,28 +50,27 @@ <h1 class="text-lg font-semibold">
}
</div>

@if (feedbackForm.get("rating")?.value) {
<mat-form-field class="!mb-2.5 w-full">
@if (feedbackForm.get("rating")?.value === "good") {
<mat-label>What was good?</mat-label>
} @else {
<mat-label>What can we do better?</mat-label>
}
<textarea
matInput
formControlName="feedbackText"
data-testid="feedback-text"
></textarea>
@if (feedbackForm.controls.feedbackText.hasError("maxlength")) {
<mat-error>
Your feedback can't be longer than 500 characters.
</mat-error>
}
<mat-hint class="h-[42px]"
>Try to be specific. What happened? What were you doing?</mat-hint
>
</mat-form-field>
}
<mat-form-field class="w-full" subscriptSizing="dynamic">
@if (feedbackForm.get("rating")?.value === "good") {
<mat-label>What was good?</mat-label>
} @else {
<mat-label>What can we do better?</mat-label>
}

<textarea
matInput
formControlName="feedbackText"
data-testid="feedback-text"
></textarea>
@if (feedbackForm.controls.feedbackText.hasError("maxlength")) {
<mat-error>
Your feedback can't be longer than 500 characters.
</mat-error>
}
<mat-hint
>{{ (feedbackWrapperService.feedbackConfig$ | async)?.hint_text }}
</mat-hint>
</mat-form-field>

<mat-checkbox formControlName="shareContact">
<span data-testid="share-user-information">
Original file line number Diff line number Diff line change
@@ -6,6 +6,10 @@ import { MAT_DIALOG_DATA } from '@angular/material/dialog';
import { Meta, moduleMetadata, StoryObj } from '@storybook/angular';
import { userEvent, within } from '@storybook/test';
import { dialogWrapper } from 'src/storybook/decorators';
import {
mockFeedbackConfig,
mockFeedbackWrapperServiceProvider,
} from '../../../../storybook/feedback';
import { mockPersistentSession } from '../../../../storybook/session';
import { FeedbackDialogComponent } from './feedback-dialog.component';

@@ -32,6 +36,43 @@ export const NoSessions: Story = {
],
};

export const ShortHint: Story = {
args: {},
decorators: [
moduleMetadata({
providers: [
{
provide: MAT_DIALOG_DATA,
useValue: { sessions: [], trigger: 'storybook' },
},
mockFeedbackWrapperServiceProvider({
...mockFeedbackConfig,
hint_text: 'Hint',
}),
],
}),
],
};

export const LongHint: Story = {
args: {},
decorators: [
moduleMetadata({
providers: [
{
provide: MAT_DIALOG_DATA,
useValue: { sessions: [], trigger: 'storybook' },
},
mockFeedbackWrapperServiceProvider({
...mockFeedbackConfig,
hint_text:
'This is a very long hint text that should be displayed in the feedback dialog.',
}),
],
}),
],
};

export const RatingSelected: Story = {
args: {},
decorators: [
@@ -68,7 +109,7 @@ export const OneSession: Story = {
],
};

export const OneSessionWithUserInformation: Story = {
export const OneSessionWithoutUserInformation: Story = {
args: {},
decorators: [
moduleMetadata({
1 change: 1 addition & 0 deletions frontend/src/storybook/feedback.ts
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@ export const mockFeedbackConfig: FeedbackConfigurationOutput = {
hours_between_prompt: 1,
},
recipients: [],
hint_text: 'Hint text',
};

class MockFeedbackWrapperService implements Partial<FeedbackWrapperService> {