From fcd898de779de0d9b06252ac5a1a6afd83e66c56 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Thu, 15 Sep 2022 10:56:22 +0300 Subject: [PATCH] RED-5201 -> update to not ask for confirmation when multiFileReport flag is different than already existing file --- .../reports-screen/reports-screen.component.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen/reports-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen/reports-screen.component.ts index ac8c10e67..94b6d70d1 100644 --- a/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen/reports-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen/reports-screen.component.ts @@ -90,10 +90,15 @@ export class ReportsScreenComponent implements OnInit { }); this._dialogService.openDialog('confirm', null, data, null, async result => { if (result) { - if (this.availableTemplates$.value.some(template => template.fileName === file.name)) { - await this._openOverwriteConfirmationDialog(file, result > 1); + const multiFileReport = result > 1; + if ( + this.availableTemplates$.value.some( + template => template.fileName === file.name && template.multiFileReport === multiFileReport, + ) + ) { + await this._openOverwriteConfirmationDialog(file, multiFileReport); } else { - await this._uploadTemplateForm(file, result > 1); + await this._uploadTemplateForm(file, multiFileReport); } } });