RED-6536 - Related download options no longer grouped together

This commit is contained in:
Valentin Mihai 2023-04-15 12:21:36 +03:00
parent 5a1bf8a3be
commit 9fb0675f75

View File

@ -63,7 +63,7 @@ export class DownloadDialogComponent extends BaseDialogComponent {
private get _availableReportTypes() {
const dossierTemplateId = this.data.dossier.dossierTemplateId;
const result = this._reportTemplateController.getAvailableReportTemplates(dossierTemplateId);
return result.then(values => values ?? []);
return result.then(values => this._sortAvailableReportTypes(values) ?? []);
}
private get _formDownloadTypes() {
@ -131,4 +131,8 @@ export class DownloadDialogComponent extends BaseDialogComponent {
const isHexColor = /^#[0-9A-F]{6}$/i.test(color);
return isHexColor ? null : { redactionPreviewColor: true };
}
private _sortAvailableReportTypes(values) {
return values.sort((a, b) => (a.fileName > b.fileName ? 1 : b.fileName > a.fileName ? -1 : 0));
}
}