Type |
-
+ |
Proposal
Total Floor Area |
-
+ |
Proposal
Action |
-
+ |
@@ -683,7 +701,8 @@ Proposal
(openFile)="openFile($event)"
[showErrors]="showErrors"
[isRequired]="true"
- [showVirusError]="showProposalMapVirus"
+ [showHasVirusError]="showProposalMapHasVirusError"
+ [showVirusScanFailedError]="showProposalMapVirusScanFailedError"
>
@@ -709,7 +728,8 @@ Proposal
[showErrors]="showErrors"
[isRequired]="true"
[allowMultiple]="true"
- [showVirusError]="showCrossSectionVirus"
+ [showHasVirusError]="showCrossSectionHasVirusError"
+ [showVirusScanFailedError]="showCrossSectionVirusScanFailedError"
>
@@ -737,7 +757,8 @@ Proposal
[showErrors]="showErrors"
[isRequired]="true"
[allowMultiple]="true"
- [showVirusError]="showReclamationPlanVirus"
+ [showHasVirusError]="showReclamationPlanHasVirusError"
+ [showVirusScanFailedError]="showReclamationPlanVirusScanFailedError"
>
@@ -756,7 +777,8 @@ Proposal
(deleteFile)="onDeleteFile($event)"
(openFile)="openFile($event)"
[showErrors]="showErrors"
- [showVirusError]="showBuildingPlanVirus"
+ [showHasVirusError]="showBuildingPlanHasVirusError"
+ [showVirusScanFailedError]="showBuildingPlanVirusScanFailedError"
[isRequired]="true"
[allowMultiple]="true"
>
@@ -862,7 +884,8 @@ Proposal
[isRequired]="true"
[disabled]="!requiresNoticeOfWork"
[allowMultiple]="true"
- [showVirusError]="showNoticeOfWorkVirus"
+ [showHasVirusError]="showNoticeOfWorkHasVirusError"
+ [showVirusScanFailedError]="showNoticeOfWorkVirusScanFailedError"
>
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 e887069f3d..a30c6f11c3 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
@@ -25,6 +25,7 @@ import {
} from '../../../../notice-of-intents/edit-submission/additional-information/additional-information.component';
import { ProposedStructure } from '../../../../../services/notice-of-intent-submission/notice-of-intent-submission.dto';
import { AddStructureDialogComponent } from '../../../../notice-of-intents/edit-submission/additional-information/add-structure-dialog/add-structure-dialog.component';
+import { HttpErrorResponse } from '@angular/common/http';
@Component({
selector: 'app-pfrs-proposal',
@@ -54,11 +55,16 @@ export class PfrsProposalComponent extends FilesStepComponent implements OnInit,
noticeOfWork: ApplicationDocumentDto[] = [];
areComponentsDirty = false;
- showProposalMapVirus = false;
- showCrossSectionVirus = false;
- showReclamationPlanVirus = false;
- showBuildingPlanVirus = false;
- showNoticeOfWorkVirus = false;
+ showProposalMapHasVirusError = false;
+ showProposalMapVirusScanFailedError = false;
+ showCrossSectionHasVirusError = false;
+ showCrossSectionVirusScanFailedError = false;
+ showReclamationPlanHasVirusError = false;
+ showReclamationPlanVirusScanFailedError = false;
+ showBuildingPlanHasVirusError = false;
+ showBuildingPlanVirusScanFailedError = false;
+ showNoticeOfWorkHasVirusError = false;
+ showNoticeOfWorkVirusScanFailedError = false;
isNewStructure = new FormControl(null, [Validators.required]);
isFollowUp = new FormControl(null, [Validators.required]);
@@ -227,28 +233,68 @@ export class PfrsProposalComponent extends FilesStepComponent implements OnInit,
}
async attachProposalMap(file: FileHandle) {
- const res = await this.attachFile(file, DOCUMENT_TYPE.PROPOSAL_MAP);
- this.showProposalMapVirus = !res;
+ try {
+ await this.attachFile(file, DOCUMENT_TYPE.PROPOSAL_MAP);
+ this.showProposalMapHasVirusError = false;
+ this.showProposalMapVirusScanFailedError = false;
+ } catch (err) {
+ if (err instanceof HttpErrorResponse) {
+ this.showProposalMapHasVirusError = err.status === 400 && err.error.name === 'VirusDetected';
+ this.showProposalMapVirusScanFailedError = err.status === 500 && err.error.name === 'VirusScanFailed';
+ }
+ }
}
async attachCrossSection(file: FileHandle) {
- const res = await this.attachFile(file, DOCUMENT_TYPE.CROSS_SECTIONS);
- this.showCrossSectionVirus = !res;
+ try {
+ await this.attachFile(file, DOCUMENT_TYPE.CROSS_SECTIONS);
+ this.showCrossSectionHasVirusError = false;
+ this.showCrossSectionVirusScanFailedError = false;
+ } catch (err) {
+ if (err instanceof HttpErrorResponse) {
+ this.showCrossSectionHasVirusError = err.status === 400 && err.error.name === 'VirusDetected';
+ this.showCrossSectionVirusScanFailedError = err.status === 500 && err.error.name === 'VirusScanFailed';
+ }
+ }
}
async attachReclamationPlan(file: FileHandle) {
- const res = await this.attachFile(file, DOCUMENT_TYPE.RECLAMATION_PLAN);
- this.showReclamationPlanVirus = !res;
+ try {
+ await this.attachFile(file, DOCUMENT_TYPE.RECLAMATION_PLAN);
+ this.showReclamationPlanHasVirusError = false;
+ this.showReclamationPlanVirusScanFailedError = false;
+ } catch (err) {
+ if (err instanceof HttpErrorResponse) {
+ this.showReclamationPlanHasVirusError = err.status === 400 && err.error.name === 'VirusDetected';
+ this.showReclamationPlanVirusScanFailedError = err.status === 500 && err.error.name === 'VirusScanFailed';
+ }
+ }
}
async attachBuildingPlan(file: FileHandle) {
- const res = await this.attachFile(file, DOCUMENT_TYPE.BUILDING_PLAN);
- this.showBuildingPlanVirus = !res;
+ try {
+ await this.attachFile(file, DOCUMENT_TYPE.BUILDING_PLAN);
+ this.showBuildingPlanHasVirusError = false;
+ this.showBuildingPlanVirusScanFailedError = false;
+ } catch (err) {
+ if (err instanceof HttpErrorResponse) {
+ this.showBuildingPlanHasVirusError = err.status === 400 && err.error.name === 'VirusDetected';
+ this.showBuildingPlanVirusScanFailedError = err.status === 500 && err.error.name === 'VirusScanFailed';
+ }
+ }
}
async attachNoticeOfWork(file: FileHandle) {
- const res = await this.attachFile(file, DOCUMENT_TYPE.NOTICE_OF_WORK);
- this.showNoticeOfWorkVirus = !res;
+ try {
+ await this.attachFile(file, DOCUMENT_TYPE.NOTICE_OF_WORK);
+ this.showNoticeOfWorkHasVirusError = false;
+ this.showNoticeOfWorkVirusScanFailedError = false;
+ } catch (err) {
+ if (err instanceof HttpErrorResponse) {
+ this.showNoticeOfWorkHasVirusError = err.status === 400 && err.error.name === 'VirusDetected';
+ this.showNoticeOfWorkVirusScanFailedError = err.status === 500 && err.error.name === 'VirusScanFailed';
+ }
+ }
}
protected async save() {
diff --git a/portal-frontend/src/app/features/applications/edit-submission/proposal/pofo-proposal/pofo-proposal.component.html b/portal-frontend/src/app/features/applications/edit-submission/proposal/pofo-proposal/pofo-proposal.component.html
index 80c3e64ae8..694be894c0 100644
--- a/portal-frontend/src/app/features/applications/edit-submission/proposal/pofo-proposal/pofo-proposal.component.html
+++ b/portal-frontend/src/app/features/applications/edit-submission/proposal/pofo-proposal/pofo-proposal.component.html
@@ -222,12 +222,22 @@ Proposal
# |
- {{ i + 1 }} |
+
+ {{ i + 1 }}
+ |
Type |
-
+ |
Proposal
Total Floor Area |
-
+ |
Proposal
Action |
-
+ |
@@ -593,7 +611,8 @@ Proposal
(openFile)="openFile($event)"
[showErrors]="showErrors"
[isRequired]="true"
- [showVirusError]="showProposalMapVirus"
+ [showHasVirusError]="showProposalMapHasVirusError"
+ [showVirusScanFailedError]="showProposalMapVirusScanFailedError"
>
@@ -619,7 +638,8 @@ Proposal
[showErrors]="showErrors"
[isRequired]="true"
[allowMultiple]="true"
- [showVirusError]="showCrossSectionVirus"
+ [showHasVirusError]="showCrossSectionHasVirusError"
+ [showVirusScanFailedError]="showCrossSectionVirusScanFailedError"
>
@@ -647,7 +667,8 @@ Proposal
[showErrors]="showErrors"
[isRequired]="true"
[allowMultiple]="true"
- [showVirusError]="showReclamationPlanVirus"
+ [showHasVirusError]="showReclamationPlanHasVirusError"
+ [showVirusScanFailedError]="showReclamationPlanVirusScanFailedError"
>
@@ -666,7 +687,8 @@ Proposal
(deleteFile)="onDeleteFile($event)"
(openFile)="openFile($event)"
[showErrors]="showErrors"
- [showVirusError]="showBuildingPlanVirus"
+ [showHasVirusError]="showBuildingPlanHasVirusError"
+ [showVirusScanFailedError]="showBuildingPlanVirusScanFailedError"
[isRequired]="true"
[allowMultiple]="true"
>
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 a9635c9777..28f920fcac 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
@@ -26,6 +26,7 @@ import { MOBILE_BREAKPOINT } from '../../../../../shared/utils/breakpoints';
import { AddStructureDialogComponent } from '../../../../../features/notice-of-intents/edit-submission/additional-information/add-structure-dialog/add-structure-dialog.component';
import { ProposedStructure } from '../../../../../services/notice-of-intent-submission/notice-of-intent-submission.dto';
import { v4 } from 'uuid';
+import { HttpErrorResponse } from '@angular/common/http';
@Component({
selector: 'app-pofo-proposal',
@@ -53,10 +54,14 @@ export class PofoProposalComponent extends FilesStepComponent implements OnInit,
reclamationPlan: ApplicationDocumentDto[] = [];
buildingPlans: ApplicationDocumentDto[] = [];
- showProposalMapVirus = false;
- showCrossSectionVirus = false;
- showReclamationPlanVirus = false;
- showBuildingPlanVirus = false;
+ showProposalMapHasVirusError = false;
+ showProposalMapVirusScanFailedError = false;
+ showCrossSectionHasVirusError = false;
+ showCrossSectionVirusScanFailedError = false;
+ showReclamationPlanHasVirusError = false;
+ showReclamationPlanVirusScanFailedError = false;
+ showBuildingPlanHasVirusError = false;
+ showBuildingPlanVirusScanFailedError = false;
isNewStructure = new FormControl(null, [Validators.required]);
isFollowUp = new FormControl(null, [Validators.required]);
@@ -188,23 +193,55 @@ export class PofoProposalComponent extends FilesStepComponent implements OnInit,
}
async attachProposalMap(file: FileHandle) {
- const res = await this.attachFile(file, DOCUMENT_TYPE.PROPOSAL_MAP);
- this.showProposalMapVirus = !res;
+ try {
+ await this.attachFile(file, DOCUMENT_TYPE.PROPOSAL_MAP);
+ this.showProposalMapHasVirusError = false;
+ this.showProposalMapVirusScanFailedError = false;
+ } catch (err) {
+ if (err instanceof HttpErrorResponse) {
+ this.showProposalMapHasVirusError = err.status === 400 && err.error.name === 'VirusDetected';
+ this.showProposalMapVirusScanFailedError = err.status === 500 && err.error.name === 'VirusScanFailed';
+ }
+ }
}
async attachCrossSection(file: FileHandle) {
- const res = await this.attachFile(file, DOCUMENT_TYPE.CROSS_SECTIONS);
- this.showCrossSectionVirus = !res;
+ try {
+ await this.attachFile(file, DOCUMENT_TYPE.CROSS_SECTIONS);
+ this.showCrossSectionHasVirusError = false;
+ this.showCrossSectionVirusScanFailedError = false;
+ } catch (err) {
+ if (err instanceof HttpErrorResponse) {
+ this.showCrossSectionHasVirusError = err.status === 400 && err.error.name === 'VirusDetected';
+ this.showCrossSectionVirusScanFailedError = err.status === 500 && err.error.name === 'VirusScanFailed';
+ }
+ }
}
async attachReclamationPlan(file: FileHandle) {
- const res = await this.attachFile(file, DOCUMENT_TYPE.RECLAMATION_PLAN);
- this.showReclamationPlanVirus = !res;
+ try {
+ await this.attachFile(file, DOCUMENT_TYPE.RECLAMATION_PLAN);
+ this.showReclamationPlanHasVirusError = false;
+ this.showReclamationPlanVirusScanFailedError = false;
+ } catch (err) {
+ if (err instanceof HttpErrorResponse) {
+ this.showReclamationPlanHasVirusError = err.status === 400 && err.error.name === 'VirusDetected';
+ this.showReclamationPlanVirusScanFailedError = err.status === 500 && err.error.name === 'VirusScanFailed';
+ }
+ }
}
async attachBuildingPlan(file: FileHandle) {
- const res = await this.attachFile(file, DOCUMENT_TYPE.BUILDING_PLAN);
- this.showBuildingPlanVirus = !res;
+ try {
+ await this.attachFile(file, DOCUMENT_TYPE.BUILDING_PLAN);
+ this.showBuildingPlanHasVirusError = false;
+ this.showBuildingPlanVirusScanFailedError = false;
+ } catch (err) {
+ if (err instanceof HttpErrorResponse) {
+ this.showBuildingPlanHasVirusError = err.status === 400 && err.error.name === 'VirusDetected';
+ this.showBuildingPlanVirusScanFailedError = err.status === 500 && err.error.name === 'VirusScanFailed';
+ }
+ }
}
protected async save() {
diff --git a/portal-frontend/src/app/features/applications/edit-submission/proposal/roso-proposal/roso-proposal.component.html b/portal-frontend/src/app/features/applications/edit-submission/proposal/roso-proposal/roso-proposal.component.html
index 91f79ea8ae..097f44ab52 100644
--- a/portal-frontend/src/app/features/applications/edit-submission/proposal/roso-proposal/roso-proposal.component.html
+++ b/portal-frontend/src/app/features/applications/edit-submission/proposal/roso-proposal/roso-proposal.component.html
@@ -224,12 +224,22 @@ Proposal
# |
- {{ i + 1 }} |
+
+ {{ i + 1 }}
+ |
Type |
-
+ |
Proposal
Total Floor Area |
-
+ |
Proposal
Action |
-
+ |
@@ -561,7 +579,8 @@ Proposal
(openFile)="openFile($event)"
[showErrors]="showErrors"
[isRequired]="true"
- [showVirusError]="showProposalMapVirus"
+ [showHasVirusError]="showProposalMapHasVirusError"
+ [showVirusScanFailedError]="showProposalMapVirusScanFailedError"
>
@@ -587,7 +606,8 @@ Proposal
[showErrors]="showErrors"
[isRequired]="true"
[allowMultiple]="true"
- [showVirusError]="showCrossSectionVirus"
+ [showHasVirusError]="showCrossSectionHasVirusError"
+ [showVirusScanFailedError]="showCrossSectionVirusScanFailedError"
>
@@ -615,7 +635,8 @@ Proposal
[showErrors]="showErrors"
[isRequired]="true"
[allowMultiple]="true"
- [showVirusError]="showReclamationPlanVirus"
+ [showHasVirusError]="showReclamationPlanHasVirusError"
+ [showVirusScanFailedError]="showReclamationPlanVirusScanFailedError"
>
@@ -634,7 +655,8 @@ Proposal
(deleteFile)="onDeleteFile($event)"
(openFile)="openFile($event)"
[showErrors]="showErrors"
- [showVirusError]="showBuildingPlanVirus"
+ [showHasVirusError]="showBuildingPlanHasVirusError"
+ [showVirusScanFailedError]="showBuildingPlanVirusScanFailedError"
[isRequired]="true"
[allowMultiple]="true"
>
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 3bea4eb978..2f1ee76a8d 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
@@ -26,6 +26,7 @@ import { MOBILE_BREAKPOINT } from '../../../../../shared/utils/breakpoints';
import { AddStructureDialogComponent } from '../../../../../features/notice-of-intents/edit-submission/additional-information/add-structure-dialog/add-structure-dialog.component';
import { ProposedStructure } from '../../../../../services/notice-of-intent-submission/notice-of-intent-submission.dto';
import { v4 } from 'uuid';
+import { HttpErrorResponse } from '@angular/common/http';
@Component({
selector: 'app-roso-proposal',
@@ -53,10 +54,14 @@ export class RosoProposalComponent extends FilesStepComponent implements OnInit,
reclamationPlan: ApplicationDocumentDto[] = [];
buildingPlans: ApplicationDocumentDto[] = [];
- showProposalMapVirus = false;
- showCrossSectionVirus = false;
- showReclamationPlanVirus = false;
- showBuildingPlanVirus = false;
+ showProposalMapHasVirusError = false;
+ showProposalMapVirusScanFailedError = false;
+ showCrossSectionHasVirusError = false;
+ showCrossSectionVirusScanFailedError = false;
+ showReclamationPlanHasVirusError = false;
+ showReclamationPlanVirusScanFailedError = false;
+ showBuildingPlanHasVirusError = false;
+ showBuildingPlanVirusScanFailedError = false;
isNewStructure = new FormControl(null, [Validators.required]);
isFollowUp = new FormControl(null, [Validators.required]);
@@ -185,23 +190,55 @@ export class RosoProposalComponent extends FilesStepComponent implements OnInit,
}
async attachProposalMap(file: FileHandle) {
- const res = await this.attachFile(file, DOCUMENT_TYPE.PROPOSAL_MAP);
- this.showProposalMapVirus = !res;
+ try {
+ await this.attachFile(file, DOCUMENT_TYPE.PROPOSAL_MAP);
+ this.showProposalMapHasVirusError = false;
+ this.showProposalMapVirusScanFailedError = false;
+ } catch (err) {
+ if (err instanceof HttpErrorResponse) {
+ this.showProposalMapHasVirusError = err.status === 400 && err.error.name === 'VirusDetected';
+ this.showProposalMapVirusScanFailedError = err.status === 500 && err.error.name === 'VirusScanFailed';
+ }
+ }
}
async attachCrossSection(file: FileHandle) {
- const res = await this.attachFile(file, DOCUMENT_TYPE.CROSS_SECTIONS);
- this.showCrossSectionVirus = !res;
+ try {
+ await this.attachFile(file, DOCUMENT_TYPE.CROSS_SECTIONS);
+ this.showCrossSectionHasVirusError = false;
+ this.showCrossSectionVirusScanFailedError = false;
+ } catch (err) {
+ if (err instanceof HttpErrorResponse) {
+ this.showCrossSectionHasVirusError = err.status === 400 && err.error.name === 'VirusDetected';
+ this.showCrossSectionVirusScanFailedError = err.status === 500 && err.error.name === 'VirusScanFailed';
+ }
+ }
}
async attachReclamationPlan(file: FileHandle) {
- const res = await this.attachFile(file, DOCUMENT_TYPE.RECLAMATION_PLAN);
- this.showReclamationPlanVirus = !res;
+ try {
+ await this.attachFile(file, DOCUMENT_TYPE.RECLAMATION_PLAN);
+ this.showReclamationPlanHasVirusError = false;
+ this.showReclamationPlanVirusScanFailedError = false;
+ } catch (err) {
+ if (err instanceof HttpErrorResponse) {
+ this.showReclamationPlanHasVirusError = err.status === 400 && err.error.name === 'VirusDetected';
+ this.showReclamationPlanVirusScanFailedError = err.status === 500 && err.error.name === 'VirusScanFailed';
+ }
+ }
}
async attachBuildingPlan(file: FileHandle) {
- const res = await this.attachFile(file, DOCUMENT_TYPE.BUILDING_PLAN);
- this.showBuildingPlanVirus = !res;
+ try {
+ await this.attachFile(file, DOCUMENT_TYPE.BUILDING_PLAN);
+ this.showBuildingPlanHasVirusError = false;
+ this.showBuildingPlanVirusScanFailedError = false;
+ } catch (err) {
+ if (err instanceof HttpErrorResponse) {
+ this.showBuildingPlanHasVirusError = err.status === 400 && err.error.name === 'VirusDetected';
+ this.showBuildingPlanVirusScanFailedError = err.status === 500 && err.error.name === 'VirusScanFailed';
+ }
+ }
}
protected async save() {
diff --git a/portal-frontend/src/app/features/applications/edit-submission/proposal/subd-proposal/subd-proposal.component.html b/portal-frontend/src/app/features/applications/edit-submission/proposal/subd-proposal/subd-proposal.component.html
index 9029fd3495..db08232046 100644
--- a/portal-frontend/src/app/features/applications/edit-submission/proposal/subd-proposal/subd-proposal.component.html
+++ b/portal-frontend/src/app/features/applications/edit-submission/proposal/subd-proposal/subd-proposal.component.html
@@ -215,7 +215,8 @@ Proposal
(openFile)="openFile($event)"
[showErrors]="showErrors"
[isRequired]="true"
- [showVirusError]="showProposalMapVirus"
+ [showHasVirusError]="showProposalMapHasVirusError"
+ [showVirusScanFailedError]="showProposalMapVirusScanFailedError"
>
@@ -240,7 +241,7 @@ Proposal
Yes
@@ -248,7 +249,7 @@ Proposal
No
@@ -271,7 +272,8 @@ Proposal
[isRequired]="isHomeSiteSeverance.getRawValue() !== 'true'"
[allowMultiple]="true"
[disabled]="isHomeSiteSeverance.getRawValue() !== 'true'"
- [showVirusError]="showHomesiteSeveranceVirus"
+ [showHasVirusError]="showHomesiteSeveranceHasVirusError"
+ [showVirusScanFailedError]="showHomesiteSeveranceVirusScanFailedError"
>
diff --git a/portal-frontend/src/app/features/applications/edit-submission/proposal/subd-proposal/subd-proposal.component.ts b/portal-frontend/src/app/features/applications/edit-submission/proposal/subd-proposal/subd-proposal.component.ts
index 8149f2a71a..2b9c66617f 100644
--- a/portal-frontend/src/app/features/applications/edit-submission/proposal/subd-proposal/subd-proposal.component.ts
+++ b/portal-frontend/src/app/features/applications/edit-submission/proposal/subd-proposal/subd-proposal.component.ts
@@ -17,6 +17,7 @@ import { DOCUMENT_TYPE } from '../../../../../shared/dto/document.dto';
import { FileHandle } from '../../../../../shared/file-drag-drop/drag-drop.directive';
import { EditApplicationSteps } from '../../edit-submission.component';
import { FilesStepComponent } from '../../files-step.partial';
+import { HttpErrorResponse } from '@angular/common/http';
type FormProposedLot = { type: 'Lot' | 'Road Dedication' | null; size: string | null };
@@ -31,8 +32,10 @@ export class SubdProposalComponent extends FilesStepComponent implements OnInit,
homesiteSeverance: ApplicationDocumentDto[] = [];
proposalMap: ApplicationDocumentDto[] = [];
- showHomesiteSeveranceVirus = false;
- showProposalMapVirus = false;
+ showHomesiteSeveranceHasVirusError = false;
+ showProposalMapVirusScanFailedError = false;
+ showProposalMapHasVirusError = false;
+ showHomesiteSeveranceVirusScanFailedError = false;
lotsProposed = new FormControl(null, [Validators.required]);
purpose = new FormControl(null, [Validators.required]);
@@ -62,7 +65,7 @@ export class SubdProposalComponent extends FilesStepComponent implements OnInit,
private parcelService: ApplicationParcelService,
applicationDocumentService: ApplicationDocumentService,
dialog: MatDialog,
- toastService: ToastService
+ toastService: ToastService,
) {
super(applicationDocumentService, dialog, toastService);
}
@@ -120,13 +123,29 @@ export class SubdProposalComponent extends FilesStepComponent implements OnInit,
}
async attachProposalMap(file: FileHandle) {
- const res = await this.attachFile(file, DOCUMENT_TYPE.PROPOSAL_MAP);
- this.showProposalMapVirus = !res;
+ try {
+ await this.attachFile(file, DOCUMENT_TYPE.PROPOSAL_MAP);
+ this.showProposalMapHasVirusError = false;
+ this.showProposalMapVirusScanFailedError = false;
+ } catch (err) {
+ if (err instanceof HttpErrorResponse) {
+ this.showProposalMapHasVirusError = err.status === 400 && err.error.name === 'VirusDetected';
+ this.showProposalMapVirusScanFailedError = err.status === 500 && err.error.name === 'VirusScanFailed';
+ }
+ }
}
async attachHomesiteSeverance(file: FileHandle) {
- const res = await this.attachFile(file, DOCUMENT_TYPE.HOMESITE_SEVERANCE);
- this.showHomesiteSeveranceVirus = !res;
+ try {
+ await this.attachFile(file, DOCUMENT_TYPE.HOMESITE_SEVERANCE);
+ this.showHomesiteSeveranceHasVirusError = false;
+ this.showHomesiteSeveranceVirusScanFailedError = false;
+ } catch (err) {
+ if (err instanceof HttpErrorResponse) {
+ this.showHomesiteSeveranceHasVirusError = err.status === 400 && err.error.name === 'VirusDetected';
+ this.showHomesiteSeveranceVirusScanFailedError = err.status === 500 && err.error.name === 'VirusScanFailed';
+ }
+ }
}
protected async save() {
diff --git a/portal-frontend/src/app/features/applications/edit-submission/proposal/tur-proposal/tur-proposal.component.html b/portal-frontend/src/app/features/applications/edit-submission/proposal/tur-proposal/tur-proposal.component.html
index 730f9cf721..f72b17cfab 100644
--- a/portal-frontend/src/app/features/applications/edit-submission/proposal/tur-proposal/tur-proposal.component.html
+++ b/portal-frontend/src/app/features/applications/edit-submission/proposal/tur-proposal/tur-proposal.component.html
@@ -149,7 +149,7 @@ Proposal
[formControl]="allOwnersNotified"
[ngClass]="{
'parcel-checkbox': true,
- 'error-outline': allOwnersNotified.invalid && (allOwnersNotified.dirty || allOwnersNotified.touched)
+ 'error-outline': allOwnersNotified.invalid && (allOwnersNotified.dirty || allOwnersNotified.touched),
}"
>I confirm that all affected property owners with land in the ALR have been notified.
@@ -178,7 +178,8 @@ Proposal
(openFile)="openFile($event)"
[showErrors]="showErrors"
[isRequired]="true"
- [showVirusError]="showServingNoticeVirus"
+ [showHasVirusError]="showServingNoticeHasVirusError"
+ [showVirusScanFailedError]="showServingNoticeVirusScanFailedError"
data-testid="proof-of-serving-notice-filechooser"
>
@@ -193,7 +194,8 @@ Proposal
(openFile)="openFile($event)"
[showErrors]="showErrors"
[isRequired]="true"
- [showVirusError]="showProposalMapVirus"
+ [showHasVirusError]="showProposalMapHasVirusError"
+ [showVirusScanFailedError]="showProposalMapVirusScanFailedError"
data-testid="proposal-map-filechooser"
>
diff --git a/portal-frontend/src/app/features/applications/edit-submission/proposal/tur-proposal/tur-proposal.component.ts b/portal-frontend/src/app/features/applications/edit-submission/proposal/tur-proposal/tur-proposal.component.ts
index adab6177fe..b640d60b21 100644
--- a/portal-frontend/src/app/features/applications/edit-submission/proposal/tur-proposal/tur-proposal.component.ts
+++ b/portal-frontend/src/app/features/applications/edit-submission/proposal/tur-proposal/tur-proposal.component.ts
@@ -12,6 +12,7 @@ import { DOCUMENT_TYPE } from '../../../../../shared/dto/document.dto';
import { FileHandle } from '../../../../../shared/file-drag-drop/drag-drop.directive';
import { EditApplicationSteps } from '../../edit-submission.component';
import { FilesStepComponent } from '../../files-step.partial';
+import { HttpErrorResponse } from '@angular/common/http';
@Component({
selector: 'app-tur-proposal',
@@ -26,8 +27,10 @@ export class TurProposalComponent extends FilesStepComponent implements OnInit,
servingNotice: ApplicationDocumentDto[] = [];
proposalMap: ApplicationDocumentDto[] = [];
- showServingNoticeVirus = false;
- showProposalMapVirus = false;
+ showServingNoticeHasVirusError = false;
+ showServingNoticeVirusScanFailedError = false;
+ showProposalMapHasVirusError = false;
+ showProposalMapVirusScanFailedError = false;
purpose = new FormControl(null, [Validators.required]);
outsideLands = new FormControl(null, [Validators.required]);
@@ -51,7 +54,7 @@ export class TurProposalComponent extends FilesStepComponent implements OnInit,
private applicationService: ApplicationSubmissionService,
applicationDocumentService: ApplicationDocumentService,
dialog: MatDialog,
- toastService: ToastService
+ toastService: ToastService,
) {
super(applicationDocumentService, dialog, toastService);
}
@@ -84,13 +87,29 @@ export class TurProposalComponent extends FilesStepComponent implements OnInit,
}
async attachProposalMap(file: FileHandle) {
- const res = await this.attachFile(file, DOCUMENT_TYPE.PROPOSAL_MAP);
- this.showProposalMapVirus = !res;
+ try {
+ await this.attachFile(file, DOCUMENT_TYPE.PROPOSAL_MAP);
+ this.showProposalMapHasVirusError = false;
+ this.showProposalMapVirusScanFailedError = false;
+ } catch (err) {
+ if (err instanceof HttpErrorResponse) {
+ this.showProposalMapHasVirusError = err.status === 400 && err.error.name === 'VirusDetected';
+ this.showProposalMapVirusScanFailedError = err.status === 500 && err.error.name === 'VirusScanFailed';
+ }
+ }
}
async attachServinceNotice(file: FileHandle) {
- const res = await this.attachFile(file, DOCUMENT_TYPE.SERVING_NOTICE);
- this.showServingNoticeVirus = !res;
+ try {
+ await this.attachFile(file, DOCUMENT_TYPE.SERVING_NOTICE);
+ this.showServingNoticeHasVirusError = false;
+ this.showServingNoticeVirusScanFailedError = false;
+ } catch (err) {
+ if (err instanceof HttpErrorResponse) {
+ this.showServingNoticeHasVirusError = err.status === 400 && err.error.name === 'VirusDetected';
+ this.showServingNoticeVirusScanFailedError = err.status === 500 && err.error.name === 'VirusScanFailed';
+ }
+ }
}
async onSave() {
diff --git a/portal-frontend/src/app/features/applications/review-submission/review-attachments/review-attachments.component.html b/portal-frontend/src/app/features/applications/review-submission/review-attachments/review-attachments.component.html
index 945a20c66d..b2656719a3 100644
--- a/portal-frontend/src/app/features/applications/review-submission/review-attachments/review-attachments.component.html
+++ b/portal-frontend/src/app/features/applications/review-submission/review-attachments/review-attachments.component.html
@@ -18,7 +18,8 @@ Attachments
(openFile)="openFile($event)"
[isRequired]="true"
[showErrors]="showErrors"
- [showVirusError]="showResolutionVirusError"
+ [showHasVirusError]="showResolutionHasVirusError"
+ [showVirusScanFailedError]="showResolutionVirusScanFailedError"
>
@@ -31,7 +32,8 @@ Attachments
(openFile)="openFile($event)"
[isRequired]="isAuthorized"
[showErrors]="showErrors"
- [showVirusError]="showStaffReportVirusError"
+ [showHasVirusError]="showStaffReportHasVirusError"
+ [showVirusScanFailedError]="showStaffReportVirusScanFailedError"
>
@@ -43,7 +45,8 @@ Attachments
(deleteFile)="deleteFile($event)"
(openFile)="openFile($event)"
[allowMultiple]="true"
- [showVirusError]="showOtherVirusError"
+ [showHasVirusError]="showOtherHasVirusError"
+ [showVirusScanFailedError]="showOtherVirusScanFailedError"
>
diff --git a/portal-frontend/src/app/features/applications/review-submission/review-attachments/review-attachments.component.ts b/portal-frontend/src/app/features/applications/review-submission/review-attachments/review-attachments.component.ts
index f0156a2999..0fae15d00d 100644
--- a/portal-frontend/src/app/features/applications/review-submission/review-attachments/review-attachments.component.ts
+++ b/portal-frontend/src/app/features/applications/review-submission/review-attachments/review-attachments.component.ts
@@ -8,6 +8,7 @@ import { DOCUMENT_SOURCE, DOCUMENT_TYPE } from '../../../../shared/dto/document.
import { FileHandle } from '../../../../shared/file-drag-drop/drag-drop.directive';
import { ReviewApplicationFngSteps, ReviewApplicationSteps } from '../review-submission.component';
import { openFileInline } from '../../../../shared/utils/file';
+import { HttpErrorResponse } from '@angular/common/http';
@Component({
selector: 'app-review-attachments',
@@ -32,14 +33,18 @@ export class ReviewAttachmentsComponent implements OnInit, OnDestroy {
isAuthorized = false;
showMandatoryUploads = false;
hasCompletedPreviousSteps = false;
- showResolutionVirusError = false;
- showStaffReportVirusError = false;
- showOtherVirusError = false;
+
+ showResolutionHasVirusError = false;
+ showResolutionVirusScanFailedError = false;
+ showStaffReportHasVirusError = false;
+ showStaffReportVirusScanFailedError = false;
+ showOtherHasVirusError = false;
+ showOtherVirusScanFailedError = false;
constructor(
private applicationReviewService: ApplicationSubmissionReviewService,
private applicationDocumentService: ApplicationDocumentService,
- private toastService: ToastService
+ private toastService: ToastService,
) {}
ngOnInit(): void {
@@ -69,11 +74,11 @@ export class ReviewAttachmentsComponent implements OnInit, OnDestroy {
this.$applicationDocuments.pipe(takeUntil(this.$destroy)).subscribe((documents) => {
this.resolutionDocument = documents.filter(
- (document) => document.type?.code === DOCUMENT_TYPE.RESOLUTION_DOCUMENT
+ (document) => document.type?.code === DOCUMENT_TYPE.RESOLUTION_DOCUMENT,
);
this.staffReport = documents.filter((document) => document.type?.code === DOCUMENT_TYPE.STAFF_REPORT);
this.otherAttachments = documents.filter(
- (document) => document.type?.code === DOCUMENT_TYPE.OTHER && document.source === DOCUMENT_SOURCE.LFNG
+ (document) => document.type?.code === DOCUMENT_TYPE.OTHER && document.source === DOCUMENT_SOURCE.LFNG,
);
});
}
@@ -86,18 +91,42 @@ export class ReviewAttachmentsComponent implements OnInit, OnDestroy {
}
async attachStaffReport(fileHandle: FileHandle) {
- const res = await this.attachFile(fileHandle, DOCUMENT_TYPE.STAFF_REPORT);
- this.showStaffReportVirusError = !res;
+ try {
+ await this.attachFile(fileHandle, DOCUMENT_TYPE.STAFF_REPORT);
+ this.showStaffReportHasVirusError = false;
+ this.showStaffReportVirusScanFailedError = false;
+ } catch (err) {
+ if (err instanceof HttpErrorResponse) {
+ this.showStaffReportHasVirusError = err.status === 400 && err.error.name === 'VirusDetected';
+ this.showStaffReportVirusScanFailedError = err.status === 500 && err.error.name === 'VirusScanFailed';
+ }
+ }
}
async attachResolutionDocument(fileHandle: FileHandle) {
- const res = await this.attachFile(fileHandle, DOCUMENT_TYPE.RESOLUTION_DOCUMENT);
- this.showResolutionVirusError = !res;
+ try {
+ await this.attachFile(fileHandle, DOCUMENT_TYPE.RESOLUTION_DOCUMENT);
+ this.showResolutionHasVirusError = false;
+ this.showResolutionVirusScanFailedError = false;
+ } catch (err) {
+ if (err instanceof HttpErrorResponse) {
+ this.showResolutionHasVirusError = err.status === 400 && err.error.name === 'VirusDetected';
+ this.showResolutionVirusScanFailedError = err.status === 500 && err.error.name === 'VirusScanFailed';
+ }
+ }
}
async attachOtherDocument(fileHandle: FileHandle) {
- const res = await this.attachFile(fileHandle, DOCUMENT_TYPE.OTHER);
- this.showOtherVirusError = !res;
+ try {
+ await this.attachFile(fileHandle, DOCUMENT_TYPE.OTHER);
+ this.showOtherHasVirusError = false;
+ this.showOtherVirusScanFailedError = false;
+ } catch (err) {
+ if (err instanceof HttpErrorResponse) {
+ this.showOtherHasVirusError = err.status === 400 && err.error.name === 'VirusDetected';
+ this.showOtherVirusScanFailedError = err.status === 500 && err.error.name === 'VirusScanFailed';
+ }
+ }
}
private async attachFile(fileHandle: FileHandle, documentType: DOCUMENT_TYPE) {
@@ -107,15 +136,16 @@ export class ReviewAttachmentsComponent implements OnInit, OnDestroy {
this.fileId,
fileHandle.file,
documentType,
- DOCUMENT_SOURCE.LFNG
+ DOCUMENT_SOURCE.LFNG,
);
- } catch (e) {
+ this.toastService.showSuccessToast('Document uploaded');
+ } catch (err) {
this.toastService.showErrorToast('Document upload failed');
- return false;
+
+ throw err;
}
await this.loadApplicationDocuments(this.fileId);
}
- return true;
}
async deleteFile($event: ApplicationDocumentDto) {
diff --git a/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/additional-information.component.html b/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/additional-information.component.html
index a79f4e2a60..8861eeceff 100644
--- a/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/additional-information.component.html
+++ b/portal-frontend/src/app/features/notice-of-intents/edit-submission/additional-information/additional-information.component.html
@@ -40,7 +40,7 @@ Additional Proposal Information
[ngClass]="{
'error-outline':
isRemovingSoilForNewStructure.invalid &&
- (isRemovingSoilForNewStructure.dirty || isRemovingSoilForNewStructure.touched)
+ (isRemovingSoilForNewStructure.dirty || isRemovingSoilForNewStructure.touched),
}"
value="true"
>Yes
@@ -50,7 +50,7 @@ Additional Proposal Information
[ngClass]="{
'error-outline':
isRemovingSoilForNewStructure.invalid &&
- (isRemovingSoilForNewStructure.dirty || isRemovingSoilForNewStructure.touched)
+ (isRemovingSoilForNewStructure.dirty || isRemovingSoilForNewStructure.touched),
}"
value="false"
>No
@@ -68,7 +68,7 @@ Additional Proposal Information
Provide the total floor area (m2) for each of the proposed structure(s)
| | | | | | | | |