From 23cd6bdd53c4501704313c06eb18019bcc13cf76 Mon Sep 17 00:00:00 2001 From: Felipe Barreta Date: Fri, 18 Oct 2024 17:31:35 -0700 Subject: [PATCH] ALCS-2229 Added validation --- .../add-structure-dialog.component.html | 2 +- .../add-structure-dialog.component.scss | 1 - .../add-structure-dialog.component.ts | 4 +++ .../structure-mobile-card.component.html | 17 +++++++-- .../structure-mobile-card.component.scss | 36 +++++++++++++++++-- .../structure-mobile-card.component.ts | 14 ++++++-- .../src/app/shared/shared.module.ts | 2 +- 7 files changed, 66 insertions(+), 10 deletions(-) rename portal-frontend/src/app/shared/{ => mobile}/structure-mobile-card/structure-mobile-card.component.html (53%) rename portal-frontend/src/app/shared/{ => mobile}/structure-mobile-card/structure-mobile-card.component.scss (58%) rename portal-frontend/src/app/shared/{ => mobile}/structure-mobile-card/structure-mobile-card.component.ts (67%) diff --git a/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/add-structure-dialog/add-structure-dialog.component.html b/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/add-structure-dialog/add-structure-dialog.component.html index c8837d815..45f172772 100644 --- a/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/add-structure-dialog/add-structure-dialog.component.html +++ b/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/add-structure-dialog/add-structure-dialog.component.html @@ -63,7 +63,7 @@

- diff --git a/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/add-structure-dialog/add-structure-dialog.component.scss b/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/add-structure-dialog/add-structure-dialog.component.scss index fdccb646b..f3a932574 100644 --- a/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/add-structure-dialog/add-structure-dialog.component.scss +++ b/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/add-structure-dialog/add-structure-dialog.component.scss @@ -7,7 +7,6 @@ mat-dialog-title { h2 { font-size: rem(19.5); - margin-left: rem(10) !important; } .actions { diff --git a/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/add-structure-dialog/add-structure-dialog.component.ts b/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/add-structure-dialog/add-structure-dialog.component.ts index 454189f3f..42df4e2fe 100644 --- a/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/add-structure-dialog/add-structure-dialog.component.ts +++ b/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/add-structure-dialog/add-structure-dialog.component.ts @@ -52,6 +52,10 @@ export class AddStructureDialogComponent { } async onSubmit() { + if (!this.form.valid) { + this.dialogRef.close(null); + return; + } this.isLoading = true; const dto: ProposedStructure = { area: Number(this.area.value!), diff --git a/portal-frontend/src/app/shared/structure-mobile-card/structure-mobile-card.component.html b/portal-frontend/src/app/shared/mobile/structure-mobile-card/structure-mobile-card.component.html similarity index 53% rename from portal-frontend/src/app/shared/structure-mobile-card/structure-mobile-card.component.html rename to portal-frontend/src/app/shared/mobile/structure-mobile-card/structure-mobile-card.component.html index 75724ce8b..59a2760a2 100644 --- a/portal-frontend/src/app/shared/structure-mobile-card/structure-mobile-card.component.html +++ b/portal-frontend/src/app/shared/mobile/structure-mobile-card/structure-mobile-card.component.html @@ -1,12 +1,23 @@ - +
- #{{ index+1 }} Total Floor Area: {{ structure.area }} (m2)
-
+ #{{ index+1 }} Total Floor Area: + +
No Data
+
+ + {{ structure.area }} (m2) +
Type: {{ mapStructureTypeValueToLabel(structure.type) }}
+
+ warning +
This field is required
+
+ +