From 21c9c83064ea050c2d6b7dddae95b4f8239ce524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Mon, 7 Feb 2022 17:52:47 +0200 Subject: [PATCH] Changes on redaction colors --- .../default-colors/default-colors-screen.component.ts | 2 +- .../table-item/file-workload/file-workload.component.ts | 2 +- .../dossier-workload-column.component.ts | 2 +- apps/red-ui/src/assets/i18n/en.json | 2 +- .../lib/dossier-templates/dossier-template-stats.model.ts | 7 ++++++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts index a81508f20..5bfcba4ce 100644 --- a/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/default-colors/default-colors-screen.component.ts @@ -55,7 +55,7 @@ export class DefaultColorsScreenComponent extends ListingComponent imp await this._loadColors(); } - openEditColorDialog($event: any, color: { key: DefaultColorType | string; value: string }) { + openEditColorDialog($event: MouseEvent, color: { key: DefaultColorType | string; value: string }) { this._dialogService.openDialog( 'editColor', $event, diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/table-item/file-workload/file-workload.component.ts b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/table-item/file-workload/file-workload.component.ts index cd7ceaddc..ab3b664e1 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/table-item/file-workload/file-workload.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/dossier-overview/components/table-item/file-workload/file-workload.component.ts @@ -40,7 +40,7 @@ export class FileWorkloadComponent { } get redactionColor() { - return this._getDictionaryColor('redaction'); + return this._getDictionaryColor('dossier_redaction'); } private _getDictionaryColor(type: string) { diff --git a/apps/red-ui/src/app/modules/dossier/screens/dossiers-listing/components/dossier-workload-column/dossier-workload-column.component.ts b/apps/red-ui/src/app/modules/dossier/screens/dossiers-listing/components/dossier-workload-column/dossier-workload-column.component.ts index 4989a0a84..a78074fe6 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/dossiers-listing/components/dossier-workload-column/dossier-workload-column.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/dossiers-listing/components/dossier-workload-column/dossier-workload-column.component.ts @@ -23,6 +23,6 @@ export class DossierWorkloadColumnComponent { } get redactionColor() { - return this._appStateService.getDictionaryColor('redaction', this.dossier.dossierTemplateId); + return this._appStateService.getDictionaryColor('dossier_redaction', this.dossier.dossierTemplateId); } } diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 2771a953f..4cfab2283 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -498,7 +498,7 @@ "defaultColor": "Default Color", "dictionaryRequestColor": "Dictionary Request", "ignoredHintColor": "Ignored Hint", - "manualRedactionColor": "Manual Redaction", + "manualRedactionColor": "Redaction Color", "notRedacted": "Skipped", "previewColor": "Preview", "requestAdd": "Request Add", diff --git a/libs/red-domain/src/lib/dossier-templates/dossier-template-stats.model.ts b/libs/red-domain/src/lib/dossier-templates/dossier-template-stats.model.ts index ad19e2a82..50bb0b7d9 100644 --- a/libs/red-domain/src/lib/dossier-templates/dossier-template-stats.model.ts +++ b/libs/red-domain/src/lib/dossier-templates/dossier-template-stats.model.ts @@ -18,6 +18,11 @@ export class DossierTemplateStats implements IDossierTemplateStats { } dictionarySummary(type: string): DictionarySummary | undefined { - return this._dictionarySummaryMap.get(type); + const defaultValue: DictionarySummary = { entriesCount: 0, id: type, name: type, type }; + if (!this._dictionarySummaryMap.get(type)) { + // TODO + console.error(`Missing type ${type}`); + } + return this._dictionarySummaryMap.get(type) || defaultValue; } }