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 committed Nov 28, 2024
1 parent 6489656 commit b2d47e2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 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 @@ -102,6 +102,24 @@ export class FeedbackDialogComponent {
return Object.values(FeedbackRating);
}

get promptText() {
if (
this.data.sessions.some(
(session) =>
session.version.tool.config.supported_project_types.length === 1 &&
session.version.tool.config.supported_project_types[0] === 'training',
)
) {
return 'How was your training session?';
} 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

0 comments on commit b2d47e2

Please sign in to comment.