RED-4514: Allow multi-file report upload for all files
This commit is contained in:
parent
c8af658d06
commit
5918ca03e6
@ -50,10 +50,6 @@ export class ReportsScreenComponent implements OnInit {
|
||||
this._loadingService.stop();
|
||||
}
|
||||
|
||||
uploadTemplate($event) {
|
||||
this._loadingService.loadWhile(this._uploadTemplate($event));
|
||||
}
|
||||
|
||||
async download(template: IReportTemplate) {
|
||||
this._loadingService.start();
|
||||
try {
|
||||
@ -74,17 +70,7 @@ export class ReportsScreenComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
private _getAttributeName(placeholder: string): string {
|
||||
return removeBraces(placeholder).split('.').pop();
|
||||
}
|
||||
|
||||
private _getPlaceholderDescriptionTranslation(type: PlaceholderType, placeholder: string): string {
|
||||
return type === 'generalPlaceholders'
|
||||
? generalPlaceholdersDescriptionsTranslations[removeBraces(placeholder)]
|
||||
: placeholdersDescriptionsTranslations[type];
|
||||
}
|
||||
|
||||
private async _uploadTemplate($event) {
|
||||
uploadTemplate($event) {
|
||||
const file: File = $event.target.files[0];
|
||||
|
||||
if (!this._isValidFile(file)) {
|
||||
@ -103,40 +89,47 @@ export class ReportsScreenComponent implements OnInit {
|
||||
},
|
||||
});
|
||||
|
||||
this._dialogService.openDialog('confirm', null, data, null, async result => {
|
||||
this._dialogService.openDialog('confirm', null, data, null, result => {
|
||||
if (result) {
|
||||
await this._openConfirmationDialog(file);
|
||||
this._openConfirmationDialog(file);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
await this._openConfirmationDialog(file);
|
||||
this._openConfirmationDialog(file);
|
||||
}
|
||||
|
||||
this._fileInput.nativeElement.value = null;
|
||||
}
|
||||
|
||||
private async _openConfirmationDialog(file: File) {
|
||||
if (this._isExcelFile(file)) {
|
||||
const data = new ConfirmationDialogInput({
|
||||
title: _('confirmation-dialog.upload-report-template.title'),
|
||||
question: _('confirmation-dialog.upload-report-template.question'),
|
||||
confirmationText: _('confirmation-dialog.upload-report-template.confirmation-text'),
|
||||
denyText: _('confirmation-dialog.upload-report-template.deny-text'),
|
||||
alternativeConfirmationText: _('confirmation-dialog.upload-report-template.alternate-confirmation-text'),
|
||||
translateParams: {
|
||||
fileName: file.name,
|
||||
},
|
||||
});
|
||||
this._dialogService.openDialog('confirm', null, data, null, async result => {
|
||||
if (result) {
|
||||
await firstValueFrom(this._reportTemplateService.uploadTemplateForm(this.#dossierTemplateId, result > 1, file));
|
||||
await this._loadReportTemplates();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
await firstValueFrom(this._reportTemplateService.uploadTemplateForm(this.#dossierTemplateId, false, file));
|
||||
await this._loadReportTemplates();
|
||||
}
|
||||
private _getAttributeName(placeholder: string): string {
|
||||
return removeBraces(placeholder).split('.').pop();
|
||||
}
|
||||
|
||||
private _getPlaceholderDescriptionTranslation(type: PlaceholderType, placeholder: string): string {
|
||||
return type === 'generalPlaceholders'
|
||||
? generalPlaceholdersDescriptionsTranslations[removeBraces(placeholder)]
|
||||
: placeholdersDescriptionsTranslations[type];
|
||||
}
|
||||
|
||||
private _openConfirmationDialog(file: File): void {
|
||||
const data = new ConfirmationDialogInput({
|
||||
title: _('confirmation-dialog.upload-report-template.title'),
|
||||
question: _('confirmation-dialog.upload-report-template.question'),
|
||||
confirmationText: _('confirmation-dialog.upload-report-template.confirmation-text'),
|
||||
denyText: _('confirmation-dialog.upload-report-template.deny-text'),
|
||||
alternativeConfirmationText: _('confirmation-dialog.upload-report-template.alternate-confirmation-text'),
|
||||
translateParams: {
|
||||
fileName: file.name,
|
||||
},
|
||||
});
|
||||
this._dialogService.openDialog('confirm', null, data, null, async result => {
|
||||
if (result) {
|
||||
this._loadingService.start();
|
||||
await firstValueFrom(this._reportTemplateService.uploadTemplateForm(this.#dossierTemplateId, result > 1, file));
|
||||
await this._loadReportTemplates();
|
||||
this._loadingService.stop();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private async _deleteTemplate(template: IReportTemplate) {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
{
|
||||
"ADMIN_CONTACT_NAME": null,
|
||||
"ADMIN_CONTACT_URL": null,
|
||||
"API_URL": "https://dev-08.iqser.cloud/redaction-gateway-v1",
|
||||
"API_URL": "https://dev-05.iqser.cloud/redaction-gateway-v1",
|
||||
"APP_NAME": "RedactManager",
|
||||
"AUTO_READ_TIME": 3,
|
||||
"BACKEND_APP_VERSION": "4.4.40",
|
||||
@ -11,7 +11,7 @@
|
||||
"MAX_RETRIES_ON_SERVER_ERROR": 3,
|
||||
"OAUTH_CLIENT_ID": "redaction",
|
||||
"OAUTH_IDP_HINT": null,
|
||||
"OAUTH_URL": "https://dev-08.iqser.cloud/auth/realms/redaction",
|
||||
"OAUTH_URL": "https://dev-05.iqser.cloud/auth/realms/redaction",
|
||||
"RECENT_PERIOD_IN_HOURS": 24,
|
||||
"SELECTION_MODE": "structural",
|
||||
"MANUAL_BASE_URL": "https://docs.redactmanager.com/preview"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user