diff --git a/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.ts
index 3d34001ee..1d51481ec 100644
--- a/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.ts
+++ b/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.ts
@@ -92,6 +92,28 @@ export class ReportsScreenComponent implements OnInit {
}
const dossierTemplateId = this._dossierTemplatesService.activeDossierTemplateId;
+
+ if (!!this.availableTemplates.find(template => template.fileName === file.name)) {
+ const data = new ConfirmationDialogInput({
+ title: _('confirmation-dialog.report-template-same-name.title'),
+ question: _('confirmation-dialog.report-template-same-name.question'),
+ confirmationText: _('confirmation-dialog.report-template-same-name.confirmation-text'),
+ denyText: _('confirmation-dialog.report-template-same-name.deny-text'),
+ });
+
+ this._dialogService.openDialog('confirm', null, data, null, async result => {
+ if (result) {
+ await this._openConfirmationDialog(file, dossierTemplateId);
+ }
+ });
+ } else {
+ await this._openConfirmationDialog(file, dossierTemplateId);
+ }
+
+ this._fileInput.nativeElement.value = null;
+ }
+
+ private async _openConfirmationDialog(file: File, dossierTemplateId: string) {
if (this._isExcelFile(file)) {
const data = new ConfirmationDialogInput({
title: _('confirmation-dialog.upload-report-template.title'),
@@ -113,7 +135,6 @@ export class ReportsScreenComponent implements OnInit {
await this._reportTemplateService.uploadTemplateForm(dossierTemplateId, false, file).toPromise();
await this._loadReportTemplates();
}
- this._fileInput.nativeElement.value = null;
}
private async _deleteTemplate(template: IReportTemplate) {
diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json
index fa8141da2..b651fd42b 100644
--- a/apps/red-ui/src/assets/i18n/en.json
+++ b/apps/red-ui/src/assets/i18n/en.json
@@ -454,6 +454,12 @@
"deny-text": "Cancel Upload",
"question": "Please choose if {fileName} is a single or multi-file report template",
"title": "Report Template Upload"
+ },
+ "report-template-same-name": {
+ "confirmation-text": "Yes. Continue upload.",
+ "deny-text": "No. Cancel Upload",
+ "question": "There is already a Report Template with the name: {fileName}. Do you wish to continue?",
+ "title": "Report Template Upload"
}
},
"content": "Reason",