Skip to content

Commit

Permalink
Merge pull request #1974 from bcgov/bugfix/ALCS-2374
Browse files Browse the repository at this point in the history
Patch structures questions after updating visibility
  • Loading branch information
trslater authored Nov 13, 2024
2 parents 8df61a1 + d6417cf commit 7296157
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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({});
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand All @@ -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();
Expand Down

0 comments on commit 7296157

Please sign in to comment.