Merge branch 'VM/RED-10453' into 'master'

RED-10453 - reload file or files (bulk case) after approval request

Closes RED-10453

See merge request redactmanager/red-ui!696
This commit is contained in:
Nicoleta Panaghiu 2024-11-13 10:43:01 +01:00
commit 32dd6e6ced
2 changed files with 6 additions and 2 deletions

View File

@ -113,11 +113,13 @@ export class BulkActionsService {
async approve(files: File[]): Promise<void> {
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)

View File

@ -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'),