From dd6d41a96718fa515d894e45d66bd44b37b87e0a Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Mon, 10 Jul 2023 15:22:10 +0300 Subject: [PATCH] RED-7041 - Take into consideration if entity type only has dossier dictionaries --- .../redact-text-dialog/redact-text-dialog.component.html | 1 + .../redact-text-dialog/redact-text-dialog.component.ts | 8 ++++++++ libs/common-ui | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.html index fec0d8467..a64d7c690 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.html @@ -52,6 +52,7 @@ *ngFor="let dictionary of dictionaries" [matTooltip]="dictionary.description" [value]="dictionary.type" + (click)="typeChanged()" matTooltipPosition="after" > {{ dictionary.label }} diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.ts index 080bd28bd..4755d984e 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.ts @@ -141,6 +141,14 @@ export class RedactTextDialogComponent } } + typeChanged() { + if (!this.#applyToAllDossiers) { + const selectedDictionaryType = this.form.get('dictionary').value; + const selectedDictionary = this.dictionaries.find(d => d.type === selectedDictionaryType); + this.options[1].extraOption.disabled = selectedDictionary.dossierDictionaryOnly; + } + } + save(): void { this.#enhanceManualRedaction(this.data.manualRedactionEntryWrapper.manualRedactionEntry); const redaction = this.data.manualRedactionEntryWrapper.manualRedactionEntry; diff --git a/libs/common-ui b/libs/common-ui index eb58e96d0..a8f5fb2e2 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit eb58e96d01290051858613dcfaed0288adaa3d53 +Subproject commit a8f5fb2e25cd1f150c1099d387b4f9dece3b922c