From 5989bcb1b69574de6130b166357fd3a808c52758 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Wed, 26 Jul 2023 16:33:02 +0300 Subject: [PATCH] RED-6774 - fixed "cannot add hint here any longer" and hint types --- .../dialogs/add-hint-dialog/add-hint-dialog.component.ts | 6 +----- .../src/app/services/entity-services/dictionary.service.ts | 5 +---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.ts index 2b8200120..ef76bca54 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.ts @@ -126,11 +126,7 @@ export class AddHintDialogComponent extends IqserDialogComponent d.type === addRedactionRequest.type); - if (selectedType) { - addRedactionRequest.addToDictionary = selectedType.hasDictionary; - } else { - addRedactionRequest.addToDictionary = this.dictionaryRequest && addRedactionRequest.type !== 'dossier_redaction'; - } + addRedactionRequest.addToDictionary = this.dictionaryRequest && !!selectedType?.hasDictionary; const commentValue = this.form.get('comment').value; addRedactionRequest.comment = commentValue ? { text: commentValue } : null; diff --git a/apps/red-ui/src/app/services/entity-services/dictionary.service.ts b/apps/red-ui/src/app/services/entity-services/dictionary.service.ts index 5101fb33c..28e00d303 100644 --- a/apps/red-ui/src/app/services/entity-services/dictionary.service.ts +++ b/apps/red-ui/src/app/services/entity-services/dictionary.service.ts @@ -166,10 +166,7 @@ export class DictionaryService extends EntitiesService const dictionaries: Dictionary[] = []; this._dictionariesMapService.get(dossierTemplateId).forEach((d: Dictionary) => { - if ( - (d.hint && d.hasDictionary && d.addToDictionaryAction && d.type) || - (dictionaryRequest && dossierDictionaryOnly && d.dossierDictionaryOnly) - ) { + if (d.hint || (dictionaryRequest && dossierDictionaryOnly && d.dossierDictionaryOnly && d.type !== 'dossier_redaction')) { if (!dictionaryRequest) { if (!IMAGE_TYPES.includes(d.type)) { dictionaries.push(d);