diff --git a/alcs-frontend/src/app/features/application/applicant-info/application-details/naru-details/naru-details.component.html b/alcs-frontend/src/app/features/application/applicant-info/application-details/naru-details/naru-details.component.html
index 3fea01ec8..f410cdd57 100644
--- a/alcs-frontend/src/app/features/application/applicant-info/application-details/naru-details/naru-details.component.html
+++ b/alcs-frontend/src/app/features/application/applicant-info/application-details/naru-details/naru-details.component.html
@@ -131,7 +131,12 @@
{{ i + 1 }}
- {{ existingResidence.floorArea }}
m2
+
+
+
+
+ {{ existingResidence.floorArea }} m2
+
{{ existingResidence.description }}
@@ -153,7 +158,14 @@
{{ proposedResidence.floorArea }} m2
- {{ proposedResidence.description }}
+
+
+
+
+
+ {{ proposedResidence.description }}
+
+
diff --git a/portal-frontend/src/app/features/applications/application-details/naru-details/naru-details.component.html b/portal-frontend/src/app/features/applications/application-details/naru-details/naru-details.component.html
index 0ec5fa11c..4042172cd 100644
--- a/portal-frontend/src/app/features/applications/application-details/naru-details/naru-details.component.html
+++ b/portal-frontend/src/app/features/applications/application-details/naru-details/naru-details.component.html
@@ -155,7 +155,12 @@
{{ i + 1 }}
- {{ existingResidence.floorArea }}
m2
+
+
+
+
+ {{ existingResidence.floorArea }} m2
+
{{ existingResidence.description }}
@@ -172,6 +177,7 @@
[residence]="existingResidence"
[isLast]="last"
[isReviewStep]="true"
+ [showErrors]="showErrors"
>
@@ -193,7 +199,14 @@
{{ proposedResidence.floorArea }} m2
- {{ proposedResidence.description }}
+
+
+
+
+
+ {{ proposedResidence.description }}
+
+
@@ -208,6 +221,7 @@
[residence]="proposedResidence"
[isLast]="last"
[isReviewStep]="true"
+ [showErrors]="showErrors"
>
diff --git a/portal-frontend/src/app/features/applications/edit-submission/proposal/naru-proposal/naru-proposal.component.html b/portal-frontend/src/app/features/applications/edit-submission/proposal/naru-proposal/naru-proposal.component.html
index fa94eb789..b9c4b008f 100644
--- a/portal-frontend/src/app/features/applications/edit-submission/proposal/naru-proposal/naru-proposal.component.html
+++ b/portal-frontend/src/app/features/applications/edit-submission/proposal/naru-proposal/naru-proposal.component.html
@@ -461,7 +461,16 @@ Proposal
Total Floor Area |
- {{ element.floorArea }} m2
+
+ No Data
+
+ warning
+ This field is required
+
+
+
+ {{ element.floorArea }} m2
+
|
@@ -509,6 +518,7 @@ Proposal
[residence]="existingResidence"
[isLast]="last"
[isReviewStep]="false"
+ [showErrors]="showErrors"
(editClicked)="onAddEditResidence(true, existingResidence, true)"
(removeClicked)="onDeleteResidence(true, existingResidence)"
>
@@ -540,10 +550,19 @@ Proposal
Description |
- {{ element.isExpanded ? element.description : getTruncatedDescription(element.description) }}
-
- {{ element.isExpanded ? 'Read Less' : 'Read More' }}
-
+
+ No Data
+
+ warning
+ This field is required
+
+
+
+ {{ element.isExpanded ? element.description : getTruncatedDescription(element.description) }}
+
+ {{ element.isExpanded ? 'Read Less' : 'Read More' }}
+
+
|
@@ -581,6 +600,7 @@ Proposal
[residence]="proposedResidence"
[isLast]="last"
[isReviewStep]="false"
+ [showErrors]="showErrors"
(editClicked)="onAddEditResidence(false, proposedResidence, true)"
(removeClicked)="onDeleteResidence(false, proposedResidence)"
>
@@ -590,12 +610,15 @@ Proposal
type="button"
mat-stroked-button
color="primary"
- [ngClass]="{ 'error-field-outlined ng-invalid': showErrors && proposedResidencesRequired }"
+ [ngClass]="{
+ 'error-field-outlined ng-invalid':
+ showErrors && proposedResidencesRequired && proposedResidences.length === 0,
+ }"
(click)="onAddEditResidence(false, undefined, false)"
>
+ Add Proposed Residence
-
+
warning
This field is required
diff --git a/portal-frontend/src/app/features/applications/edit-submission/proposal/naru-proposal/naru-proposal.component.scss b/portal-frontend/src/app/features/applications/edit-submission/proposal/naru-proposal/naru-proposal.component.scss
index e87fd2f97..898b89a39 100644
--- a/portal-frontend/src/app/features/applications/edit-submission/proposal/naru-proposal/naru-proposal.component.scss
+++ b/portal-frontend/src/app/features/applications/edit-submission/proposal/naru-proposal/naru-proposal.component.scss
@@ -112,3 +112,10 @@ td {
margin-bottom: 0 !important;
}
}
+
+.no-data-text-error {
+ color: colors.$grey-dark;
+ font-weight: 400;
+ padding-bottom: 0 !important;
+ display: inline;
+}
diff --git a/portal-frontend/src/app/features/applications/edit-submission/proposal/naru-proposal/residence-dialog/residence-dialog.component.ts b/portal-frontend/src/app/features/applications/edit-submission/proposal/naru-proposal/residence-dialog/residence-dialog.component.ts
index 808a01f74..95008c9ef 100644
--- a/portal-frontend/src/app/features/applications/edit-submission/proposal/naru-proposal/residence-dialog/residence-dialog.component.ts
+++ b/portal-frontend/src/app/features/applications/edit-submission/proposal/naru-proposal/residence-dialog/residence-dialog.component.ts
@@ -34,9 +34,14 @@ export class ResidenceDialogComponent implements OnInit {
ngOnInit(): void {
if (this.data.residenceData) {
- this.floorArea.setValue(this.data.residenceData.floorArea!.toString());
+ this.floorArea.setValue(
+ this.data.residenceData.floorArea === 0 ? '' : this.data.residenceData.floorArea!.toString(),
+ );
this.description.setValue(this.data.residenceData.description!);
this.residence = { ...this.data.residenceData };
+ if (this.data.residenceData.floorArea === 0 || this.data.residenceData.description === '') {
+ this.form.markAllAsTouched();
+ }
}
}
diff --git a/portal-frontend/src/app/features/public/application/submission/naru-details/naru-details.component.html b/portal-frontend/src/app/features/public/application/submission/naru-details/naru-details.component.html
index fc54d54ae..22b6a65c7 100644
--- a/portal-frontend/src/app/features/public/application/submission/naru-details/naru-details.component.html
+++ b/portal-frontend/src/app/features/public/application/submission/naru-details/naru-details.component.html
@@ -141,7 +141,12 @@
{{ i + 1 }}
- {{ existingResidence.floorArea }}
m2
+
+
+
+
+ {{ existingResidence.floorArea }} m2
+
{{ existingResidence.description }}
@@ -160,7 +165,14 @@
{{ proposedResidence.floorArea }} m2
- {{ proposedResidence.description }}
+
+
+
+
+
+ {{ proposedResidence.description }}
+
+
diff --git a/portal-frontend/src/app/shared/mobile/naru-residence-mobile-card/naru-residence-mobile-card.component.html b/portal-frontend/src/app/shared/mobile/naru-residence-mobile-card/naru-residence-mobile-card.component.html
index 13da40de4..d9a1a893e 100644
--- a/portal-frontend/src/app/shared/mobile/naru-residence-mobile-card/naru-residence-mobile-card.component.html
+++ b/portal-frontend/src/app/shared/mobile/naru-residence-mobile-card/naru-residence-mobile-card.component.html
@@ -1,8 +1,14 @@
-
+
- #{{ residence.id }} Total Floor Area: {{ residence.floorArea }}
- m2
+ #{{ residence.id }} Total Floor Area:
+
+ No Data
+
+
+ {{ residence.floorArea }}
+ m2
+
+
+ No Data
+
+
+
warning
+
This field is required
+
+
{{ residence.isExpanded ? residence.description : getTruncatedDescription(residence.description) }}
{{ residence.isExpanded ? 'Read Less' : 'Read More' }}
diff --git a/portal-frontend/src/app/shared/mobile/naru-residence-mobile-card/naru-residence-mobile-card.component.scss b/portal-frontend/src/app/shared/mobile/naru-residence-mobile-card/naru-residence-mobile-card.component.scss
index 1f04e7b8e..7e5299e77 100644
--- a/portal-frontend/src/app/shared/mobile/naru-residence-mobile-card/naru-residence-mobile-card.component.scss
+++ b/portal-frontend/src/app/shared/mobile/naru-residence-mobile-card/naru-residence-mobile-card.component.scss
@@ -1,10 +1,11 @@
+@use '../../../../styles/functions.scss' as *;
@use '../../../../styles/colors';
mat-card {
width: 100%;
box-shadow: none;
border: none;
- border-bottom: 1px solid #565656;
+ border-bottom: rem(1) solid #565656;
border-radius: 0;
word-wrap: break-word;
white-space: normal;
@@ -21,8 +22,8 @@ mat-card-header {
mat-card-content {
display: flex;
flex-direction: column;
- gap: 15px;
- padding: 0 0 10px 0 !important;
+ gap: rem(15);
+ padding: 0 0 rem(10) 0 !important;
}
.span-action {
@@ -31,20 +32,52 @@ mat-card-content {
.last-card {
border-bottom: none !important;
- margin-bottom: 20px;
+ margin-bottom: rem(20);
}
.review-step {
- border-bottom: 1px solid #565656;
+ border-bottom: rem(1) solid #565656;
background-color: transparent;
mat-card-header {
- padding: 5px 0 10px 0 !important;
+ padding: rem(5) 0 rem(10) 0 !important;
}
}
a {
align-self: flex-end;
- padding-right: 30px;
- padding-bottom: 10px;
+ padding-right: rem(30);
+ padding-bottom: rem(10);
+}
+
+.text-error {
+ color: colors.$grey-dark;
+ font-weight: 400;
+ display: inline;
+ padding-bottom: 0 !important;
+}
+
+.field-error {
+ color: colors.$error-color;
+ font-size: rem(15);
+ font-weight: 700;
+ display: flex;
+ align-items: center;
+
+ .mat-icon {
+ min-width: rem(24);
+ }
+}
+
+.error-card {
+ border-radius: rem(4) !important;
+ border: rem(2) solid colors.$error-color !important;
+ padding: 0 0 rem(5) rem(10);
+ margin-top: rem(5);
+ margin-left: rem(-5);
+}
+
+.no-data {
+ margin-bottom: rem(-5) !important;
+ margin-top: rem(-10) !important;
}
diff --git a/portal-frontend/src/app/shared/mobile/naru-residence-mobile-card/naru-residence-mobile-card.component.ts b/portal-frontend/src/app/shared/mobile/naru-residence-mobile-card/naru-residence-mobile-card.component.ts
index ee1d6e735..1fff754af 100644
--- a/portal-frontend/src/app/shared/mobile/naru-residence-mobile-card/naru-residence-mobile-card.component.ts
+++ b/portal-frontend/src/app/shared/mobile/naru-residence-mobile-card/naru-residence-mobile-card.component.ts
@@ -12,13 +12,22 @@ import { EXISTING_RESIDENCE_DESCRIPTION_CHAR_LIMIT_MOBILE } from '../../constant
templateUrl: './naru-residence-mobile-card.component.html',
styleUrl: './naru-residence-mobile-card.component.scss',
})
-export class NaruResidenceMobileCardComponent {
+export class NaruResidenceMobileCardComponent implements OnInit {
@Input() residence!: FormExisingResidence | FormProposedResidence;
@Input() isLast: boolean = false;
@Input() isReviewStep: boolean = false;
+ @Input() showErrors: boolean = false;
@Output() editClicked = new EventEmitter();
@Output() removeClicked = new EventEmitter();
+ isError: boolean = false;
+
+ ngOnInit(): void {
+ if (this.residence.floorArea === 0 || this.residence.description === '') {
+ this.isError = true;
+ }
+ }
+
onEdit() {
this.editClicked.emit(this.residence);
}
diff --git a/services/apps/alcs/src/providers/typeorm/migrations/1728581017573-convert_naru_floor_area_and_existing_structuers.ts b/services/apps/alcs/src/providers/typeorm/migrations/1728581017573-convert_naru_floor_area_and_existing_structuers.ts
new file mode 100644
index 000000000..a0c830ea4
--- /dev/null
+++ b/services/apps/alcs/src/providers/typeorm/migrations/1728581017573-convert_naru_floor_area_and_existing_structuers.ts
@@ -0,0 +1,43 @@
+import { MigrationInterface, QueryRunner } from 'typeorm';
+
+export class ConvertNaruFloorAreaAndExistingStructuers1728581017573
+ implements MigrationInterface
+{
+ public async up(queryRunner: QueryRunner): Promise {
+ await queryRunner.query(`
+ UPDATE alcs.application_submission as2
+ SET naru_existing_residences = jsonb_build_array(
+ jsonb_build_object(
+ 'floorArea', 0,
+ 'description', as2.naru_existing_structures
+ )
+ )
+ WHERE as2.naru_existing_structures IS NOT NULL;
+ `);
+
+ await queryRunner.query(`
+ UPDATE alcs.application_submission as2
+ SET naru_proposed_residences = jsonb_build_array(
+ jsonb_build_object(
+ 'floorArea', (as2.naru_floor_area::float) ,
+ 'description', ''
+ )
+ )
+ WHERE as2.naru_floor_area IS NOT NULL;
+ `);
+ }
+
+ public async down(queryRunner: QueryRunner): Promise {
+ await queryRunner.query(`
+ UPDATE alcs.application_submission as2
+ SET naru_existing_residences = '[]'::jsonb
+ WHERE as2.naru_existing_structures IS NOT NULL;
+ `);
+
+ await queryRunner.query(`
+ UPDATE alcs.application_submission as2
+ SET naru_proposed_residences = '[]'::jsonb
+ WHERE as2.naru_floor_area IS NOT NULL;
+ `);
+ }
+}