From 42a16f11b5303eccbbf764660c24946f5e0ca0be Mon Sep 17 00:00:00 2001 From: Timo Date: Thu, 18 Feb 2021 19:18:02 +0200 Subject: [PATCH] dictionaries based on backend flag --- .../manual-annotation-dialog.component.ts | 6 ++---- .../app/screens/file/service/manual-annotation.service.ts | 1 - libs/red-ui-http/src/lib/model/typeValue.ts | 2 ++ libs/red-ui-http/src/lib/model/updateTypeValue.ts | 2 ++ 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts b/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts index ed7082a25..0e27b091c 100644 --- a/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts +++ b/apps/red-ui/src/app/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts @@ -77,10 +77,8 @@ export class ManualAnnotationDialogComponent implements OnInit { for (const key of Object.keys(this._appStateService.dictionaryData[this._appStateService.activeProject.ruleSetId])) { const dictionaryData = this._appStateService.getDictionaryTypeValue(key); - if (!dictionaryData.virtual && !(dictionaryData.type.indexOf('recommendation_') === 0)) { - if (!dictionaryData.hint && dictionaryData.type !== 'manual') { - this.redactionDictionaries.push(dictionaryData); - } + if (!dictionaryData.virtual && dictionaryData.addToDictionaryAction) { + this.redactionDictionaries.push(dictionaryData); } } this.redactionDictionaries.sort((a, b) => a.label.localeCompare(b.label)); diff --git a/apps/red-ui/src/app/screens/file/service/manual-annotation.service.ts b/apps/red-ui/src/app/screens/file/service/manual-annotation.service.ts index 2cc22d7f4..29a364576 100644 --- a/apps/red-ui/src/app/screens/file/service/manual-annotation.service.ts +++ b/apps/red-ui/src/app/screens/file/service/manual-annotation.service.ts @@ -7,7 +7,6 @@ import { TranslateService } from '@ngx-translate/core'; import { tap } from 'rxjs/operators'; import { UserService } from '../../../user/user.service'; import { PermissionsService } from '../../../common/service/permissions.service'; -import { of } from 'rxjs'; @Injectable({ providedIn: 'root' diff --git a/libs/red-ui-http/src/lib/model/typeValue.ts b/libs/red-ui-http/src/lib/model/typeValue.ts index 1812b30bc..d4d317efb 100644 --- a/libs/red-ui-http/src/lib/model/typeValue.ts +++ b/libs/red-ui-http/src/lib/model/typeValue.ts @@ -18,6 +18,8 @@ export interface TypeValue { * True if the entries in this type should be matched case insensitively, default is false. */ caseInsensitive?: boolean; + + addToDictionaryAction?: boolean; defaultFilter?: boolean; /** * The value of color must be a correct hex color diff --git a/libs/red-ui-http/src/lib/model/updateTypeValue.ts b/libs/red-ui-http/src/lib/model/updateTypeValue.ts index 626a7720a..e2bf53f5b 100644 --- a/libs/red-ui-http/src/lib/model/updateTypeValue.ts +++ b/libs/red-ui-http/src/lib/model/updateTypeValue.ts @@ -18,6 +18,8 @@ export interface UpdateTypeValue { * True if the entries in this type should be matched case insensitively, default is false. */ caseInsensitive?: boolean; + + addToDictionaryAction?: boolean; /** * The value of color must be a correct hex color */