RED-6774 - fixed "cannot add hint here any longer" and hint types

This commit is contained in:
Valentin Mihai 2023-07-26 16:33:02 +03:00
parent fd9d1e06d5
commit 5989bcb1b6
2 changed files with 2 additions and 9 deletions

View File

@ -126,11 +126,7 @@ export class AddHintDialogComponent extends IqserDialogComponent<AddHintDialogCo
addRedactionRequest.value = this.form.get('selectedText').value;
const selectedType = this.dictionaries.find(d => 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;

View File

@ -166,10 +166,7 @@ export class DictionaryService extends EntitiesService<IDictionary, Dictionary>
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);