Skip to content

Commit

Permalink
Merge pull request #926 from bcgov/feature/ALCS-1093
Browse files Browse the repository at this point in the history
Bug Fixes Pt1
  • Loading branch information
dhaselhan authored Aug 31, 2023
2 parents 4217fda + aae8551 commit dcd7b7c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ export class ParcelPrepComponent implements OnChanges {

async loadParcels(fileNumber: string) {
const parcels = await this.parcelService.fetchParcels(fileNumber);
this.parcels = parcels.map((parcel) => ({
...parcel,
owners: `${parcel.owners[0].displayName} ${parcel.owners.length > 1 ? ' et al.' : ''}`,
fullOwners: parcel.owners.map((owner) => owner.displayName).join(', '),
hasManyOwners: parcel.owners.length > 1,
}));
this.parcels = parcels
.filter((parcel) => parcel.parcelType === 'application')
.map((parcel) => ({
...parcel,
owners: `${parcel.owners[0].displayName} ${parcel.owners.length > 1 ? ' et al.' : ''}`,
fullOwners: parcel.owners.map((owner) => owner.displayName).join(', '),
hasManyOwners: parcel.owners.length > 1,
}));
}

async saveParcel(uuid: string, alrArea: string | null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class PofoProposalComponent extends FilesStepComponent implements OnInit,
}

protected async save() {
if (this.fileId && this.form.dirty) {
if (this.fileId && (this.form.dirty || this.areComponentsDirty)) {
const isFollowUp = this.isFollowUp.getRawValue();
const soilFollowUpIDs = this.followUpIDs.getRawValue();
const purpose = this.purpose.getRawValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class RosoProposalComponent extends FilesStepComponent implements OnInit,
}

protected async save() {
if (this.fileId && this.form.dirty) {
if (this.fileId && (this.form.dirty || this.areComponentsDirty)) {
const isNOIFollowUp = this.isFollowUp.getRawValue();
const soilFollowUpIDs = this.followUpIds.getRawValue();
const purpose = this.purpose.getRawValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,13 @@ export class ApplicationSubmissionController {
);

if (
!submission.status ||
![
SUBMISSION_STATUS.INCOMPLETE.toString(),
SUBMISSION_STATUS.WRONG_GOV.toString(),
SUBMISSION_STATUS.IN_PROGRESS.toString(),
].includes(submission.status.statusTypeCode)
!submission.isDraft &&
(!submission.status ||
![
SUBMISSION_STATUS.INCOMPLETE.toString(),
SUBMISSION_STATUS.WRONG_GOV.toString(),
SUBMISSION_STATUS.IN_PROGRESS.toString(),
].includes(submission.status.statusTypeCode))
) {
throw new ServiceValidationException('Not allowed to update submission');
}
Expand Down

0 comments on commit dcd7b7c

Please sign in to comment.