From d6417cfee5f871349750df763e4045b33f9ac1eb Mon Sep 17 00:00:00 2001 From: Tristan Slater <1631008+trslater@users.noreply.github.com> Date: Tue, 12 Nov 2024 17:52:20 -0800 Subject: [PATCH] Patch structures questions after updating visibility --- .../pfrs-proposal/pfrs-proposal.component.ts | 14 +++++++++----- .../pofo-proposal/pofo-proposal.component.ts | 14 +++++++++----- .../roso-proposal/roso-proposal.component.ts | 14 +++++++++----- 3 files changed, 27 insertions(+), 15 deletions(-) diff --git a/portal-frontend/src/app/features/applications/edit-submission/proposal/pfrs-proposal/pfrs-proposal.component.ts b/portal-frontend/src/app/features/applications/edit-submission/proposal/pfrs-proposal/pfrs-proposal.component.ts index ae1bede906..55de05b595 100644 --- a/portal-frontend/src/app/features/applications/edit-submission/proposal/pfrs-proposal/pfrs-proposal.component.ts +++ b/portal-frontend/src/app/features/applications/edit-submission/proposal/pfrs-proposal/pfrs-proposal.component.ts @@ -184,11 +184,6 @@ export class PfrsProposalComponent extends FilesStepComponent implements OnInit, fillProjectDuration: applicationSubmission.fillProjectDuration, isExtractionOrMining: formatBooleanToString(applicationSubmission.soilIsExtractionOrMining), hasSubmittedNotice: formatBooleanToString(applicationSubmission.soilHasSubmittedNotice), - soilStructureFarmUseReason: applicationSubmission.soilStructureFarmUseReason, - soilStructureResidentialUseReason: applicationSubmission.soilStructureResidentialUseReason, - soilAgriParcelActivity: applicationSubmission.soilAgriParcelActivity, - soilStructureResidentialAccessoryUseReason: applicationSubmission.soilStructureResidentialAccessoryUseReason, - soilStructureOtherUseReason: applicationSubmission.soilStructureOtherUseReason, }); this.structuresForm = new FormGroup({}); @@ -202,6 +197,15 @@ export class PfrsProposalComponent extends FilesStepComponent implements OnInit, this.structuresSource = new MatTableDataSource(this.proposedStructures); this.updateStructureTypeFields(); + + this.form.patchValue({ + soilStructureFarmUseReason: applicationSubmission.soilStructureFarmUseReason, + soilStructureResidentialUseReason: applicationSubmission.soilStructureResidentialUseReason, + soilAgriParcelActivity: applicationSubmission.soilAgriParcelActivity, + soilStructureResidentialAccessoryUseReason: applicationSubmission.soilStructureResidentialAccessoryUseReason, + soilStructureOtherUseReason: applicationSubmission.soilStructureOtherUseReason, + }); + if (this.showErrors) { this.form.markAllAsTouched(); this.structuresForm.markAllAsTouched(); diff --git a/portal-frontend/src/app/features/applications/edit-submission/proposal/pofo-proposal/pofo-proposal.component.ts b/portal-frontend/src/app/features/applications/edit-submission/proposal/pofo-proposal/pofo-proposal.component.ts index 6af88d81f8..04132c34cc 100644 --- a/portal-frontend/src/app/features/applications/edit-submission/proposal/pofo-proposal/pofo-proposal.component.ts +++ b/portal-frontend/src/app/features/applications/edit-submission/proposal/pofo-proposal/pofo-proposal.component.ts @@ -146,11 +146,6 @@ export class PofoProposalComponent extends FilesStepComponent implements OnInit, alternativeMeasures: applicationSubmission.soilAlternativeMeasures, reduceNegativeImpacts: applicationSubmission.soilReduceNegativeImpacts, projectDuration: applicationSubmission.soilProjectDuration, - soilStructureFarmUseReason: applicationSubmission.soilStructureFarmUseReason, - soilStructureResidentialUseReason: applicationSubmission.soilStructureResidentialUseReason, - soilAgriParcelActivity: applicationSubmission.soilAgriParcelActivity, - soilStructureResidentialAccessoryUseReason: applicationSubmission.soilStructureResidentialAccessoryUseReason, - soilStructureOtherUseReason: applicationSubmission.soilStructureOtherUseReason, }); this.proposedStructures = []; @@ -164,6 +159,15 @@ export class PofoProposalComponent extends FilesStepComponent implements OnInit, this.structuresSource = new MatTableDataSource(this.proposedStructures); this.updateStructureTypeFields(); + + this.form.patchValue({ + soilStructureFarmUseReason: applicationSubmission.soilStructureFarmUseReason, + soilStructureResidentialUseReason: applicationSubmission.soilStructureResidentialUseReason, + soilAgriParcelActivity: applicationSubmission.soilAgriParcelActivity, + soilStructureResidentialAccessoryUseReason: applicationSubmission.soilStructureResidentialAccessoryUseReason, + soilStructureOtherUseReason: applicationSubmission.soilStructureOtherUseReason, + }); + if (this.showErrors) { this.form.markAllAsTouched(); this.structuresForm.markAllAsTouched(); diff --git a/portal-frontend/src/app/features/applications/edit-submission/proposal/roso-proposal/roso-proposal.component.ts b/portal-frontend/src/app/features/applications/edit-submission/proposal/roso-proposal/roso-proposal.component.ts index d2423a4a49..d5d7e5036b 100644 --- a/portal-frontend/src/app/features/applications/edit-submission/proposal/roso-proposal/roso-proposal.component.ts +++ b/portal-frontend/src/app/features/applications/edit-submission/proposal/roso-proposal/roso-proposal.component.ts @@ -143,11 +143,6 @@ export class RosoProposalComponent extends FilesStepComponent implements OnInit, soilTypeRemoved: applicationSubmission.soilTypeRemoved, reduceNegativeImpacts: applicationSubmission.soilReduceNegativeImpacts, projectDuration: applicationSubmission.soilProjectDuration, - soilStructureFarmUseReason: applicationSubmission.soilStructureFarmUseReason, - soilStructureResidentialUseReason: applicationSubmission.soilStructureResidentialUseReason, - soilAgriParcelActivity: applicationSubmission.soilAgriParcelActivity, - soilStructureResidentialAccessoryUseReason: applicationSubmission.soilStructureResidentialAccessoryUseReason, - soilStructureOtherUseReason: applicationSubmission.soilStructureOtherUseReason, }); this.proposedStructures = []; @@ -161,6 +156,15 @@ export class RosoProposalComponent extends FilesStepComponent implements OnInit, this.structuresSource = new MatTableDataSource(this.proposedStructures); this.updateStructureTypeFields(); + + this.form.patchValue({ + soilStructureFarmUseReason: applicationSubmission.soilStructureFarmUseReason, + soilStructureResidentialUseReason: applicationSubmission.soilStructureResidentialUseReason, + soilAgriParcelActivity: applicationSubmission.soilAgriParcelActivity, + soilStructureResidentialAccessoryUseReason: applicationSubmission.soilStructureResidentialAccessoryUseReason, + soilStructureOtherUseReason: applicationSubmission.soilStructureOtherUseReason, + }); + if (this.showErrors) { this.form.markAllAsTouched(); this.structuresForm.markAllAsTouched();