From e57d54a75512e8b1fc4988445ca7fb6491f4585d Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Mon, 23 Sep 2024 11:58:39 +0300 Subject: [PATCH] RED-10028: added OPTIMIZED_PREVIEW file type in download selection. --- .../dossier-template-info-screen.component.ts | 2 +- .../edit-dossier-download-package.component.ts | 16 ++++++++++------ .../add-dossier-dialog.component.ts | 16 ++++++++++------ .../download-dialog/download-dialog.component.ts | 2 +- .../translations/download-types-translations.ts | 2 ++ apps/red-ui/src/assets/i18n/redact/de.json | 1 + apps/red-ui/src/assets/i18n/redact/en.json | 1 + apps/red-ui/src/assets/i18n/scm/de.json | 1 + apps/red-ui/src/assets/i18n/scm/en.json | 1 + libs/red-domain/src/lib/shared/types.ts | 1 + 10 files changed, 29 insertions(+), 14 deletions(-) diff --git a/apps/red-ui/src/app/modules/admin/screens/info/dossier-template-info-screen/dossier-template-info-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/info/dossier-template-info-screen/dossier-template-info-screen.component.ts index 0d21402f1..486d5681a 100644 --- a/apps/red-ui/src/app/modules/admin/screens/info/dossier-template-info-screen/dossier-template-info-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/info/dossier-template-info-screen/dossier-template-info-screen.component.ts @@ -27,7 +27,7 @@ import { MatDatepickerModule } from '@angular/material/datepicker'; import { MatIcon } from '@angular/material/icon'; import { SelectComponent } from '@shared/components/select/select.component'; -const downloadTypes = ['ORIGINAL', 'PREVIEW', 'DELTA_PREVIEW', 'REDACTED'].map(type => ({ +const downloadTypes = ['ORIGINAL', 'PREVIEW', 'OPTIMIZED_PREVIEW', 'DELTA_PREVIEW', 'REDACTED'].map(type => ({ key: type, label: downloadTypesTranslations[type], })); diff --git a/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/download-package/edit-dossier-download-package.component.ts b/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/download-package/edit-dossier-download-package.component.ts index ce7c1d58c..c41932fba 100644 --- a/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/download-package/edit-dossier-download-package.component.ts +++ b/apps/red-ui/src/app/modules/shared-dossiers/dialogs/edit-dossier-dialog/download-package/edit-dossier-download-package.component.ts @@ -42,12 +42,16 @@ export class EditDossierDownloadPackageComponent { #existsWatermarks$: Observable; form: FormGroup; - downloadTypes: { key: DownloadFileType; label: string }[] = ['ORIGINAL', 'PREVIEW', 'DELTA_PREVIEW', 'REDACTED'].map( - (type: DownloadFileType) => ({ - key: type, - label: downloadTypesTranslations[type], - }), - ); + downloadTypes: { key: DownloadFileType; label: string }[] = [ + 'ORIGINAL', + 'PREVIEW', + 'OPTIMIZED_PREVIEW', + 'DELTA_PREVIEW', + 'REDACTED', + ].map((type: DownloadFileType) => ({ + key: type, + label: downloadTypesTranslations[type], + })); availableReportTypes: IReportTemplate[] = []; readonly roles = Roles; @Input() dossier: Dossier; diff --git a/apps/red-ui/src/app/modules/shared/dialogs/add-dossier-dialog/add-dossier-dialog.component.ts b/apps/red-ui/src/app/modules/shared/dialogs/add-dossier-dialog/add-dossier-dialog.component.ts index b79ea0e3d..23cfa0374 100644 --- a/apps/red-ui/src/app/modules/shared/dialogs/add-dossier-dialog/add-dossier-dialog.component.ts +++ b/apps/red-ui/src/app/modules/shared/dialogs/add-dossier-dialog/add-dossier-dialog.component.ts @@ -71,12 +71,16 @@ export class AddDossierDialogComponent extends BaseDialogComponent implements On readonly roles = Roles; readonly iconButtonTypes = IconButtonTypes; hasDueDate = false; - readonly downloadTypes: { key: DownloadFileType; label: string }[] = ['ORIGINAL', 'PREVIEW', 'DELTA_PREVIEW', 'REDACTED'].map( - (type: DownloadFileType) => ({ - key: type, - label: downloadTypesTranslations[type], - }), - ); + readonly downloadTypes: { key: DownloadFileType; label: string }[] = [ + 'ORIGINAL', + 'PREVIEW', + 'OPTIMIZED_PREVIEW', + 'DELTA_PREVIEW', + 'REDACTED', + ].map((type: DownloadFileType) => ({ + key: type, + label: downloadTypesTranslations[type], + })); dossierTemplates: IDossierTemplate[]; availableReportTypes: IReportTemplate[] = []; dossierTemplateId: string; 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 169c55d91..27b90a794 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 @@ -90,7 +90,7 @@ export class DownloadDialogComponent extends IqserDialogComponent ({ key: type, label: downloadTypesForDownloadTranslations[type], diff --git a/apps/red-ui/src/app/translations/download-types-translations.ts b/apps/red-ui/src/app/translations/download-types-translations.ts index e11ea04a9..57ed1c79f 100644 --- a/apps/red-ui/src/app/translations/download-types-translations.ts +++ b/apps/red-ui/src/app/translations/download-types-translations.ts @@ -4,6 +4,7 @@ import { DownloadFileType } from '@red/domain'; export const downloadTypesTranslations: { [key in DownloadFileType]: string } = { ORIGINAL: _('download-type.original'), PREVIEW: _('download-type.preview'), + OPTIMIZED_PREVIEW: _('download-type.optimized-preview'), REDACTED: _('download-type.redacted'), ANNOTATED: _('download-type.annotated'), FLATTEN: _('download-type.flatten'), @@ -13,6 +14,7 @@ export const downloadTypesTranslations: { [key in DownloadFileType]: string } = export const downloadTypesForDownloadTranslations: { [key in DownloadFileType]: string } = { ORIGINAL: _('download-type.original'), PREVIEW: _('download-type.preview'), + OPTIMIZED_PREVIEW: _('download-type.optimized-preview'), REDACTED: _('download-type.redacted-only'), ANNOTATED: _('download-type.annotated'), FLATTEN: _('download-type.flatten'), diff --git a/apps/red-ui/src/assets/i18n/redact/de.json b/apps/red-ui/src/assets/i18n/redact/de.json index 725601f97..52bbab8ef 100644 --- a/apps/red-ui/src/assets/i18n/redact/de.json +++ b/apps/red-ui/src/assets/i18n/redact/de.json @@ -1154,6 +1154,7 @@ "delta-preview": "Delta-PDF", "flatten": "Verflachte PDF", "label": "{length} Dokumenten{length, plural, one{typ} other{typen}}", + "optimized-preview": "Optimized Preview PDF", "original": "Optimierte PDF", "preview": "Vorschau-PDF", "redacted": "Geschwärzte PDF", diff --git a/apps/red-ui/src/assets/i18n/redact/en.json b/apps/red-ui/src/assets/i18n/redact/en.json index 501225308..7ed31345c 100644 --- a/apps/red-ui/src/assets/i18n/redact/en.json +++ b/apps/red-ui/src/assets/i18n/redact/en.json @@ -1154,6 +1154,7 @@ "delta-preview": "Delta PDF", "flatten": "Flatten PDF", "label": "{length} document {length, plural, one{version} other{versions}}", + "optimized-preview": "Optimized Preview PDF", "original": "Optimized PDF", "preview": "Preview PDF", "redacted": "Redacted PDF", diff --git a/apps/red-ui/src/assets/i18n/scm/de.json b/apps/red-ui/src/assets/i18n/scm/de.json index e43c33760..f953ab37a 100644 --- a/apps/red-ui/src/assets/i18n/scm/de.json +++ b/apps/red-ui/src/assets/i18n/scm/de.json @@ -1154,6 +1154,7 @@ "delta-preview": "Delta PDF", "flatten": "PDF verflachen", "label": "{length} document {length, plural, one{version} other{versions}}", + "optimized-preview": "Optimized Preview PDF", "original": "Optimiertes PDF", "preview": "PDF-Vorschau", "redacted": "geschwärztes PDF", diff --git a/apps/red-ui/src/assets/i18n/scm/en.json b/apps/red-ui/src/assets/i18n/scm/en.json index 2ab27f327..c1ebf8c4b 100644 --- a/apps/red-ui/src/assets/i18n/scm/en.json +++ b/apps/red-ui/src/assets/i18n/scm/en.json @@ -1154,6 +1154,7 @@ "delta-preview": "Delta PDF", "flatten": "Flatten PDF", "label": "{length} document {length, plural, one{version} other{versions}}", + "optimized-preview": "Optimized Preview PDF", "original": "Optimized PDF", "preview": "Preview PDF", "redacted": "Redacted PDF", diff --git a/libs/red-domain/src/lib/shared/types.ts b/libs/red-domain/src/lib/shared/types.ts index 84fdf4d00..5603dbf09 100644 --- a/libs/red-domain/src/lib/shared/types.ts +++ b/libs/red-domain/src/lib/shared/types.ts @@ -3,6 +3,7 @@ export const DownloadFileTypes = { FLATTEN: 'FLATTEN', ORIGINAL: 'ORIGINAL', PREVIEW: 'PREVIEW', + OPTIMIZED_PREVIEW: 'OPTIMIZED_PREVIEW', REDACTED: 'REDACTED', DELTA_PREVIEW: 'DELTA_PREVIEW', } as const;