From 668833b4de35fdc7c7bdd2a901a3d70f52be5ba8 Mon Sep 17 00:00:00 2001 From: Lias Kleisa Date: Fri, 20 Oct 2023 10:57:13 +0200 Subject: [PATCH] Use same error message in checkinbase dialog as in other dialogs --- .../check-in-base-informations.component.html | 4 ++-- .../check-in-base-informations.component.ts | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/frontend/src/app/shared/dialog/checkin/check-in-base-informations/check-in-base-informations.component.html b/frontend/src/app/shared/dialog/checkin/check-in-base-informations/check-in-base-informations.component.html index ce235d8166..4742018be1 100644 --- a/frontend/src/app/shared/dialog/checkin/check-in-base-informations/check-in-base-informations.component.html +++ b/frontend/src/app/shared/dialog/checkin/check-in-base-informations/check-in-base-informations.component.html @@ -5,7 +5,7 @@
- {{ getErrorMessage(errorKey).trim() }} + {{ errorMessages[errorKey.toUpperCase().trim()] }}
@@ -16,7 +16,7 @@
- {{ getErrorMessage(errorKey).trim() }} + {{ errorMessages[errorKey.toUpperCase().trim()] }}
diff --git a/frontend/src/app/shared/dialog/checkin/check-in-base-informations/check-in-base-informations.component.ts b/frontend/src/app/shared/dialog/checkin/check-in-base-informations/check-in-base-informations.component.ts index 99af9befbd..86fc1e4797 100644 --- a/frontend/src/app/shared/dialog/checkin/check-in-base-informations/check-in-base-informations.component.ts +++ b/frontend/src/app/shared/dialog/checkin/check-in-base-informations/check-in-base-informations.component.ts @@ -10,6 +10,7 @@ import errorMessages from '../../../../../assets/errors/error-messages.json'; export class CheckInBaseInformationsComponent { @Input() dialogForm!: FormGroup; + protected readonly errorMessages: any = errorMessages; isTouchedOrDirty(name: string) { return this.dialogForm.get(name)?.dirty || this.dialogForm.get(name)?.touched; @@ -19,10 +20,4 @@ export class CheckInBaseInformationsComponent { const errors = this.dialogForm.get(name)?.errors; return errors == null ? [] : Object.keys(errors); } - - getErrorMessage(key: string) { - return errorMessages[key.toUpperCase() as keyof typeof errorMessages]; - } - - protected readonly errorMessages = errorMessages; }