Skip to content

Commit

Permalink
feat: Change feedback prompt for trainings
Browse files Browse the repository at this point in the history
  • Loading branch information
zusorio authored and MoritzWeber0 committed Dec 9, 2024
1 parent f251d4c commit 344c726
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@
(submit)="submit()"
>
<h1 class="text-lg font-semibold">
@if (data.sessions.length === 0) {
How has your experience been?
} @else if (data.sessions.length === 1) {
How was your session?
} @else {
How were your sessions?
}
{{ promptText }}
</h1>
<div class="space-y-2">
<div class="flex justify-center space-x-4">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,20 @@ export class FeedbackDialogComponent {
return Object.values(FeedbackRating);
}

get promptText() {
if (
this.data.sessions.some((session) => session.project?.type === 'training')
) {
return 'How was your training experience?';
} else if (this.data.sessions.length === 0) {
return 'How was your experience?';
} else if (this.data.sessions.length === 1) {
return 'How was your session?';
} else {
return 'How were your sessions?';
}
}

submitButton = {
disabled: false,
text: 'Submit',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import {
mockFeedbackConfig,
mockFeedbackWrapperServiceProvider,
} from '../../../../storybook/feedback';
import { mockPersistentSession } from '../../../../storybook/session';
import {
mockPersistentSession,
mockTrainingSession,
} from '../../../../storybook/session';
import { FeedbackDialogComponent } from './feedback-dialog.component';

const meta: Meta<FeedbackDialogComponent> = {
Expand Down Expand Up @@ -156,3 +159,20 @@ export const TwoSessions: Story = {
}),
],
};

export const TrainingSession: Story = {
args: {},
decorators: [
moduleMetadata({
providers: [
{
provide: MAT_DIALOG_DATA,
useValue: {
sessions: [mockPersistentSession, mockTrainingSession],
trigger: 'storybook',
},
},
],
}),
],
};

0 comments on commit 344c726

Please sign in to comment.