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> { async approve(files: File[]): Promise<void> {
this._loadingService.start(); this._loadingService.start();
const approvalResponse: ApproveResponse[] = await this._filesService.getApproveWarnings(files); const approvalResponse: ApproveResponse[] = await this._filesService.getApproveWarnings(files);
this._loadingService.stop();
const hasWarnings = approvalResponse.some(response => response.hasWarnings); const hasWarnings = approvalResponse.some(response => response.hasWarnings);
if (!hasWarnings) { if (!hasWarnings) {
await firstValueFrom(this._filesService.loadAll(files[0].dossierId));
this._loadingService.stop();
return; return;
} }
this._loadingService.stop();
const fileWarnings = approvalResponse const fileWarnings = approvalResponse
.filter(response => response.hasWarnings) .filter(response => response.hasWarnings)

View File

@ -320,10 +320,12 @@ export class FileActionsComponent implements OnChanges {
async setFileApproved() { async setFileApproved() {
this._loadingService.start(); this._loadingService.start();
const approvalResponse: ApproveResponse = (await this._filesService.getApproveWarnings([this.file]))[0]; const approvalResponse: ApproveResponse = (await this._filesService.getApproveWarnings([this.file]))[0];
this._loadingService.stop();
if (!approvalResponse.hasWarnings) { if (!approvalResponse.hasWarnings) {
await this._filesService.reload(this.file.dossierId, this.file);
this._loadingService.stop();
return; return;
} }
this._loadingService.stop();
const data: IConfirmationDialogData = { const data: IConfirmationDialogData = {
title: _('confirmation-dialog.approve-file.title'), title: _('confirmation-dialog.approve-file.title'),