Pull request #331: confirmation dialog for template upload with the same name
Merge in RED/ui from RED-3123 to master * commit 'efa924f3bf7fdf96923f6b25fc68420ba6edf44c': some instead of find confirmation dialog for template upload with the same name
This commit is contained in:
commit
10f82a9ca1
@ -92,6 +92,28 @@ export class ReportsScreenComponent implements OnInit {
|
||||
}
|
||||
|
||||
const dossierTemplateId = this._dossierTemplatesService.activeDossierTemplateId;
|
||||
|
||||
if (this.availableTemplates.some(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) {
|
||||
|
||||
@ -449,6 +449,12 @@
|
||||
"deny-text": "Uploads abbrechen",
|
||||
"question": "Wählen Sie bitte aus, ob <b>{fileName}</b> eine Berichtsvorlage für eine oder für mehrere Dateien ist",
|
||||
"title": "Upload der Berichtsvorlage"
|
||||
},
|
||||
"report-template-same-name": {
|
||||
"confirmation-text": "",
|
||||
"deny-text": "",
|
||||
"question": "<b>{fileName}</b>",
|
||||
"title": ""
|
||||
}
|
||||
},
|
||||
"content": "Begründung",
|
||||
|
||||
@ -454,6 +454,12 @@
|
||||
"deny-text": "Cancel Upload",
|
||||
"question": "Please choose if <b>{fileName}</b> 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: <b>{fileName}</b>. Do you wish to continue?",
|
||||
"title": "Report Template Upload"
|
||||
}
|
||||
},
|
||||
"content": "Reason",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user