From fb9242f6372e0947293409727268788ea75b4109 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Wed, 13 Nov 2024 11:28:41 +0200 Subject: [PATCH] RED-10453 - reload file or files (bulk case) after approval request --- .../modules/dossier-overview/services/bulk-actions.service.ts | 4 +++- .../components/file-actions/file-actions.component.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/red-ui/src/app/modules/dossier-overview/services/bulk-actions.service.ts b/apps/red-ui/src/app/modules/dossier-overview/services/bulk-actions.service.ts index d0517aef4..cc289af02 100644 --- a/apps/red-ui/src/app/modules/dossier-overview/services/bulk-actions.service.ts +++ b/apps/red-ui/src/app/modules/dossier-overview/services/bulk-actions.service.ts @@ -113,11 +113,13 @@ export class BulkActionsService { async approve(files: File[]): Promise { this._loadingService.start(); const approvalResponse: ApproveResponse[] = await this._filesService.getApproveWarnings(files); - this._loadingService.stop(); const hasWarnings = approvalResponse.some(response => response.hasWarnings); if (!hasWarnings) { + await firstValueFrom(this._filesService.loadAll(files[0].dossierId)); + this._loadingService.stop(); return; } + this._loadingService.stop(); const fileWarnings = approvalResponse .filter(response => response.hasWarnings) diff --git a/apps/red-ui/src/app/modules/shared-dossiers/components/file-actions/file-actions.component.ts b/apps/red-ui/src/app/modules/shared-dossiers/components/file-actions/file-actions.component.ts index 04375e949..8a43d507c 100644 --- a/apps/red-ui/src/app/modules/shared-dossiers/components/file-actions/file-actions.component.ts +++ b/apps/red-ui/src/app/modules/shared-dossiers/components/file-actions/file-actions.component.ts @@ -320,10 +320,12 @@ export class FileActionsComponent implements OnChanges { async setFileApproved() { this._loadingService.start(); const approvalResponse: ApproveResponse = (await this._filesService.getApproveWarnings([this.file]))[0]; - this._loadingService.stop(); if (!approvalResponse.hasWarnings) { + await this._filesService.reload(this.file.dossierId, this.file); + this._loadingService.stop(); return; } + this._loadingService.stop(); const data: IConfirmationDialogData = { title: _('confirmation-dialog.approve-file.title'),