From 050ce29b19c5fbec2bebeaada3c681b6db694691 Mon Sep 17 00:00:00 2001 From: Daniel Haselhan Date: Tue, 26 Mar 2024 11:15:48 -0700 Subject: [PATCH 1/2] Attach pending files to update document requests * Previously would not send the new file and only change the name --- .../document-upload-dialog.component.ts | 3 ++- .../document-upload-dialog.component.ts | 5 +++-- .../document-upload-dialog.component.ts | 7 ++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/alcs-frontend/src/app/features/application/documents/document-upload-dialog/document-upload-dialog.component.ts b/alcs-frontend/src/app/features/application/documents/document-upload-dialog/document-upload-dialog.component.ts index 655cb8ebd4..9bab97854e 100644 --- a/alcs-frontend/src/app/features/application/documents/document-upload-dialog/document-upload-dialog.component.ts +++ b/alcs-frontend/src/app/features/application/documents/document-upload-dialog/document-upload-dialog.component.ts @@ -116,6 +116,7 @@ export class DocumentUploadDialogComponent implements OnInit, OnDestroy { visibilityFlags.push('P'); } + const file = this.pendingFile; const dto: UpdateDocumentDto = { fileName: this.name.value!, source: this.source.value as DOCUMENT_SOURCE, @@ -123,9 +124,9 @@ export class DocumentUploadDialogComponent implements OnInit, OnDestroy { visibilityFlags, parcelUuid: this.parcelId.value ?? undefined, ownerUuid: this.ownerId.value ?? undefined, + file, }; - const file = this.pendingFile; this.isSaving = true; if (this.data.existingDocument) { await this.applicationDocumentService.update(this.data.existingDocument.uuid, dto); diff --git a/alcs-frontend/src/app/features/notice-of-intent/documents/document-upload-dialog/document-upload-dialog.component.ts b/alcs-frontend/src/app/features/notice-of-intent/documents/document-upload-dialog/document-upload-dialog.component.ts index 47f28fa407..4aac473798 100644 --- a/alcs-frontend/src/app/features/notice-of-intent/documents/document-upload-dialog/document-upload-dialog.component.ts +++ b/alcs-frontend/src/app/features/notice-of-intent/documents/document-upload-dialog/document-upload-dialog.component.ts @@ -70,7 +70,7 @@ export class DocumentUploadDialogComponent implements OnInit, OnDestroy { private noiDocumentService: NoiDocumentService, private noiSubmissionService: NoticeOfIntentSubmissionService, private noiParcelService: NoticeOfIntentParcelService, - private toastService: ToastService + private toastService: ToastService, ) {} ngOnInit(): void { @@ -117,6 +117,7 @@ export class DocumentUploadDialogComponent implements OnInit, OnDestroy { visibilityFlags.push('P'); } + const file = this.pendingFile; const dto: UpdateNoticeOfIntentDocumentDto = { fileName: this.name.value!, source: this.source.value as DOCUMENT_SOURCE, @@ -124,9 +125,9 @@ export class DocumentUploadDialogComponent implements OnInit, OnDestroy { visibilityFlags, parcelUuid: this.parcelId.value ?? undefined, ownerUuid: this.ownerId.value ?? undefined, + file, }; - const file = this.pendingFile; this.isSaving = true; if (this.data.existingDocument) { await this.noiDocumentService.update(this.data.existingDocument.uuid, dto); diff --git a/alcs-frontend/src/app/features/notification/documents/document-upload-dialog/document-upload-dialog.component.ts b/alcs-frontend/src/app/features/notification/documents/document-upload-dialog/document-upload-dialog.component.ts index 58a010c3a6..94489d8ebb 100644 --- a/alcs-frontend/src/app/features/notification/documents/document-upload-dialog/document-upload-dialog.component.ts +++ b/alcs-frontend/src/app/features/notification/documents/document-upload-dialog/document-upload-dialog.component.ts @@ -56,7 +56,7 @@ export class DocumentUploadDialogComponent implements OnInit, OnDestroy { public data: { fileId: string; existingDocument?: NotificationDocumentDto }, protected dialog: MatDialogRef, private notificationDocumentService: NotificationDocumentService, - private toastService: ToastService + private toastService: ToastService, ) {} ngOnInit(): void { @@ -94,14 +94,15 @@ export class DocumentUploadDialogComponent implements OnInit, OnDestroy { visibilityFlags.push('P'); } + const file = this.pendingFile; const dto: UpdateNoticeOfIntentDocumentDto = { fileName: this.name.value!, source: this.source.value as DOCUMENT_SOURCE, typeCode: this.type.value as DOCUMENT_TYPE, visibilityFlags, + file, }; - const file = this.pendingFile; this.isSaving = true; if (this.data.existingDocument) { await this.notificationDocumentService.update(this.data.existingDocument.uuid, dto); @@ -171,7 +172,7 @@ export class DocumentUploadDialogComponent implements OnInit, OnDestroy { if (this.data.existingDocument) { await this.notificationDocumentService.download( this.data.existingDocument.uuid, - this.data.existingDocument.fileName + this.data.existingDocument.fileName, ); } } From c49ab99a2c2f9c49e49f2dff6a684faa9e1c6800 Mon Sep 17 00:00:00 2001 From: Daniel Haselhan Date: Mon, 25 Mar 2024 09:30:42 -0700 Subject: [PATCH 2/2] Add Production Routes to API Guard * Production is set to have /api/ added to all routes breaking how the maintenance guard normally checks. --- services/apps/alcs/src/portal/guards/maintenance.guard.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/apps/alcs/src/portal/guards/maintenance.guard.ts b/services/apps/alcs/src/portal/guards/maintenance.guard.ts index 6c28b7b296..2a0ff61f25 100644 --- a/services/apps/alcs/src/portal/guards/maintenance.guard.ts +++ b/services/apps/alcs/src/portal/guards/maintenance.guard.ts @@ -30,7 +30,9 @@ export class MaintenanceGuard implements CanActivate { if ( req.routeOptions.url.startsWith('/portal') || - req.routeOptions.url.startsWith('/public') + req.routeOptions.url.startsWith('/public') || + req.routeOptions.url.startsWith('/api/portal') || + req.routeOptions.url.startsWith('/api/public') ) { const maintenanceMode = await this.configurationRepository.findOne({ where: {