Skip to content

Commit

Permalink
Merge pull request #1949 from DSD-DBS/longer-feedback
Browse files Browse the repository at this point in the history
fix: Allow longer feedback and warn users if their feedback is too long
  • Loading branch information
MoritzWeber0 authored Nov 4, 2024
2 parents 633bcff + ab801d7 commit 76136c0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/capellacollab/feedback/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Feedback(core_pydantic.BaseModel):
description="The rating of the feedback"
)
feedback_text: str | None = pydantic.Field(
description="The feedback text", max_length=255
description="The feedback text", max_length=500
)
share_contact: bool = pydantic.Field(
description="Whether the user wants to share their contact information"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ <h1 class="text-lg font-semibold">
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
>Try to be specific. What happened? What were you doing?</mat-hint
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ export class FeedbackDialogComponent {
undefined,
Validators.required,
),
feedbackText: new FormControl<string>(''),
feedbackText: new FormControl<string>('', {
validators: [Validators.maxLength(500)],
}),
shareContact: new FormControl<boolean>(true),
});

Expand Down

0 comments on commit 76136c0

Please sign in to comment.