+
diff --git a/apps/red-ui/src/app/modules/shared/dialogs/download-dialog/download-dialog.component.ts b/apps/red-ui/src/app/modules/shared/dialogs/download-dialog/download-dialog.component.ts
index 873288aab..cc719b47e 100644
--- a/apps/red-ui/src/app/modules/shared/dialogs/download-dialog/download-dialog.component.ts
+++ b/apps/red-ui/src/app/modules/shared/dialogs/download-dialog/download-dialog.component.ts
@@ -1,5 +1,5 @@
import { Component, Inject } from '@angular/core';
-import { Dossier, DownloadFileType, DownloadFileTypes, IReportTemplate } from '@red/domain';
+import { Dossier, DownloadFileType, DownloadFileTypes, IReportTemplate, File, WorkflowFileStatuses } from '@red/domain';
import { downloadTypesForDownloadTranslations } from '@translations/download-types-translations';
import { ReportTemplateService } from '@services/report-template.service';
import { AbstractControl, FormBuilder } from '@angular/forms';
@@ -9,7 +9,7 @@ import { IconButtonTypes, List } from '@iqser/common-ui';
export interface DownloadDialogData {
readonly dossier: Dossier;
- readonly hasUnapprovedDocuments: boolean;
+ readonly files: File[];
}
export interface DownloadDialogResult {
@@ -50,6 +50,18 @@ export class DownloadDialogComponent {
return this.form.controls.downloadFileTypes?.value?.length || 0;
}
+ get hasUnapprovedFiles() {
+ return this.data.files.some(file => !file.isApproved);
+ }
+
+ get invalidDownload() {
+ return (
+ !!this.form.controls.downloadFileTypes.value.length &&
+ this.form.controls.downloadFileTypes.value.every(type => type === DownloadFileTypes.REDACTED) &&
+ !this.data.files.some(file => file.workflowStatus === WorkflowFileStatuses.APPROVED)
+ );
+ }
+
private get _availableReportTypes() {
const dossierTemplateId = this.data.dossier.dossierTemplateId;
const result = this._reportTemplateController.getAvailableReportTemplates(dossierTemplateId);
@@ -72,13 +84,6 @@ export class DownloadDialogComponent {
this._dialogRef.close();
}
- get invalidDownload() {
- return (
- this.form.controls.downloadFileTypes.value.every(type => type === DownloadFileTypes.REDACTED) &&
- this.data.hasUnapprovedDocuments
- );
- }
-
private _hasReportTemplateOrDownloadType(control: AbstractControl) {
const atLeastAReportSelected = control.get('reportTemplateIds')?.value.length > 0;
const atLeastATypeSelected = control.get('downloadFileTypes')?.value.length > 0;
diff --git a/apps/red-ui/src/assets/i18n/redact/de.json b/apps/red-ui/src/assets/i18n/redact/de.json
index 3acc5a9bd..eeeff716b 100644
--- a/apps/red-ui/src/assets/i18n/redact/de.json
+++ b/apps/red-ui/src/assets/i18n/redact/de.json
@@ -1053,7 +1053,8 @@
},
"download-includes": "Wählen Sie die Dokumente für Ihr Download-Paket aus",
"download-status": {
- "queued": "Ihr Download wurde zur Warteschlange hinzugefügt. Hier finden Sie alle angeforderten Downloads:
My Downloads."
+ "queued": "Ihr Download wurde zur Warteschlange hinzugefügt. Hier finden Sie alle angeforderten Downloads:
My Downloads.",
+ "error": ""
},
"download-type": {
"annotated": "PDF mit Anmerkungen",
diff --git a/apps/red-ui/src/assets/i18n/redact/en.json b/apps/red-ui/src/assets/i18n/redact/en.json
index 327d32d4b..5346e40aa 100644
--- a/apps/red-ui/src/assets/i18n/redact/en.json
+++ b/apps/red-ui/src/assets/i18n/redact/en.json
@@ -1053,7 +1053,8 @@
},
"download-includes": "Choose what is included at download:",
"download-status": {
- "queued": "Your download has been queued, you can see all your requested downloads here:
My Downloads."
+ "queued": "Your download has been queued, you can see all your requested downloads here:
My Downloads.",
+ "error": "The download preparation failed, please recheck the selected files and download option settings."
},
"download-type": {
"annotated": "Annotated PDF",