From 905cf6a860fb735baf379412a7fabf5ad24d37ee Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Mon, 16 Nov 2020 16:21:02 +0200 Subject: [PATCH] fixes --- .../src/app/common/filter/model/filter.model.ts | 1 + .../file-preview-screen.component.html | 8 ++++---- .../file-preview-screen.component.ts | 4 ---- .../app/screens/file/model/annotation.wrapper.ts | 6 +----- .../file/service/annotation-processing.service.ts | 3 ++- apps/red-ui/src/assets/i18n/en.json | 13 ++----------- 6 files changed, 10 insertions(+), 25 deletions(-) diff --git a/apps/red-ui/src/app/common/filter/model/filter.model.ts b/apps/red-ui/src/app/common/filter/model/filter.model.ts index a9453e125..908a0af47 100644 --- a/apps/red-ui/src/app/common/filter/model/filter.model.ts +++ b/apps/red-ui/src/app/common/filter/model/filter.model.ts @@ -4,5 +4,6 @@ export interface FilterModel { checked?: boolean; indeterminate?: boolean; expanded?: boolean; + topLevelFilter?: boolean; filters?: FilterModel[]; } diff --git a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html index 76b3afcb0..19b508bf5 100644 --- a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html +++ b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.html @@ -97,7 +97,7 @@
{{ annotation.typeLabel | translate }}
-
+
: {{ annotation.dictionary | humanize }}
@@ -122,9 +122,9 @@ - - + + - {{ 'annotation-type.' + filter.key | translate }} + {{ filter.key | humanize }} diff --git a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts index 20d164b6b..9f8c62a3a 100644 --- a/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/screens/file/file-preview-screen/file-preview-screen.component.ts @@ -440,10 +440,6 @@ export class FilePreviewScreenComponent implements OnInit, OnDestroy { await this.appStateService.reloadActiveProjectFiles(); } - isCategoryFilter(filter: FilterModel) { - return filter.filters && filter.filters.length > 0; - } - get displayData() { return this.fileData ? (this.redactedView ? this.fileData.redactedFileData : this.fileData.annotatedFileData) : null; } diff --git a/apps/red-ui/src/app/screens/file/model/annotation.wrapper.ts b/apps/red-ui/src/app/screens/file/model/annotation.wrapper.ts index bd020ac4f..4eadcc0c7 100644 --- a/apps/red-ui/src/app/screens/file/model/annotation.wrapper.ts +++ b/apps/red-ui/src/app/screens/file/model/annotation.wrapper.ts @@ -150,11 +150,7 @@ export class AnnotationWrapper { AnnotationWrapper._setSuperType(annotationWrapper, redactionLogEntry, manualRedactionEntry, idRemoval); - if (annotationWrapper.superType === 'hint' || annotationWrapper.superType === 'redaction') { - annotationWrapper.typeLabel = humanize(annotationWrapper.dictionary); - } else { - annotationWrapper.typeLabel = 'annotation-type.' + annotationWrapper.superType; - } + annotationWrapper.typeLabel = 'annotation-type.' + annotationWrapper.superType; return annotationWrapper; } diff --git a/apps/red-ui/src/app/screens/file/service/annotation-processing.service.ts b/apps/red-ui/src/app/screens/file/service/annotation-processing.service.ts index 8e198148c..ee84bba0b 100644 --- a/apps/red-ui/src/app/screens/file/service/annotation-processing.service.ts +++ b/apps/red-ui/src/app/screens/file/service/annotation-processing.service.ts @@ -30,7 +30,8 @@ export class AnnotationProcessingService { for (const key of Object.keys(availableAnnotationTypes)) { const filter: FilterModel = { key: key, - label: 'annotation-filter.super-type.' + key, + topLevelFilter: true, + label: 'annotation-type.' + key, filters: Array.from(availableAnnotationTypes[key]).map((dc: string) => { // const defaultFilter = this._appStateService.dictionaryData[dc]?.defaultFilter; return { key: dc, checked: false, filters: [] }; diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index afe37454d..8ae25c282 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -301,7 +301,7 @@ "comment": "Comment", "suggestion": "Suggestion for redaction", "dictionary": "Dictionary", - "content": "Content", + "content": "Reason", "page": "Page", "filter": { "hint": "Hints only", @@ -310,15 +310,6 @@ "analysis": "Re-analysis required", "none": "No Annotations" }, - "annotation-filter": { - "super-type": { - "redaction": "Redaction", - "hint": "Hint", - "suggestion": "Suggestion", - "suggestion-remove": "Suggestion to Remove", - "ignore": "Ignored redaction" - } - }, "filter-menu": { "label": "Filter", "all": "All", @@ -391,7 +382,7 @@ "error": "Failed to remove redaction." }, "redaction-add": { - "success": "Redaction added.", + "success": "Manual Redaction added.", "error": "Failed to add redaction." } },