From d8399d8e32c906367de22bfe3ab8d80a1c209697 Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Wed, 10 Nov 2021 09:35:13 +0200 Subject: [PATCH] additional rework on some existing types --- .../src/app/models/file/annotation.wrapper.ts | 22 +++++-------------- .../red-ui/src/app/state/app-state.service.ts | 17 -------------- .../annotation-types-translations.ts | 3 --- .../app/utils/sorters/super-type-sorter.ts | 3 --- apps/red-ui/src/assets/i18n/de.json | 1 - apps/red-ui/src/assets/i18n/en.json | 2 -- 6 files changed, 5 insertions(+), 43 deletions(-) diff --git a/apps/red-ui/src/app/models/file/annotation.wrapper.ts b/apps/red-ui/src/app/models/file/annotation.wrapper.ts index 214119cb4..df45ab979 100644 --- a/apps/red-ui/src/app/models/file/annotation.wrapper.ts +++ b/apps/red-ui/src/app/models/file/annotation.wrapper.ts @@ -4,9 +4,6 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { IComment, IPoint, IRectangle } from '@red/domain'; export type AnnotationSuperType = - | 'add-dictionary' - | 'remove-only-here' - | 'change-legal-basis' | 'suggestion-change-legal-basis' | 'suggestion-recategorize-image' | 'suggestion-add-dictionary' @@ -121,7 +118,7 @@ export class AnnotationWrapper { } get isReadyForAnalysis() { - return this.superType === 'add-dictionary' || this.superType === 'remove-only-here' || this.superType === 'change-legal-basis'; + return false; } get isApproved() { @@ -165,7 +162,7 @@ export class AnnotationWrapper { } get isConvertedRecommendation() { - return this.isRecommendation && (this.superType === 'suggestion-add-dictionary' || this.superType === 'add-dictionary'); + return this.isRecommendation && this.superType === 'suggestion-add-dictionary'; } get isRecommendation() { @@ -264,10 +261,6 @@ export class AnnotationWrapper { annotationWrapper.superType = 'suggestion-add-dictionary'; return; } - if (redactionLogEntryWrapper.status === 'APPROVED') { - annotationWrapper.superType = 'add-dictionary'; - return; - } if (redactionLogEntryWrapper.status === 'DECLINED') { annotationWrapper.superType = 'declined-suggestion'; return; @@ -319,10 +312,6 @@ export class AnnotationWrapper { annotationWrapper.superType = 'suggestion-add-dictionary'; return; } - if (redactionLogEntryWrapper.status === 'APPROVED') { - annotationWrapper.superType = 'add-dictionary'; - return; - } if (redactionLogEntryWrapper.status === 'DECLINED') { annotationWrapper.superType = 'declined-suggestion'; return; @@ -370,17 +359,16 @@ export class AnnotationWrapper { if (redactionLogEntryWrapper.status === 'APPROVED') { if (redactionLogEntryWrapper.dictionaryEntry) { + annotationWrapper.superType = annotationWrapper.redaction ? 'redaction' : annotationWrapper.hint ? 'hint' : 'skipped'; + } else { annotationWrapper.superType = redactionLogEntryWrapper.manualRedactionType === 'ADD' - ? 'add-dictionary' + ? 'manual-redaction' : annotationWrapper.redaction ? 'redaction' : annotationWrapper.hint ? 'hint' : 'skipped'; - } else { - annotationWrapper.superType = - redactionLogEntryWrapper.manualRedactionType === 'ADD' ? 'manual-redaction' : 'remove-only-here'; } return; } diff --git a/apps/red-ui/src/app/state/app-state.service.ts b/apps/red-ui/src/app/state/app-state.service.ts index fa713d60c..a2a34a236 100644 --- a/apps/red-ui/src/app/state/app-state.service.ts +++ b/apps/red-ui/src/app/state/app-state.service.ts @@ -339,15 +339,6 @@ export class AppStateService { true, ); - // dictionary actions - dictionaryData['add-dictionary'] = new Dictionary( - { - hexColor: colors.analysisColor || FALLBACK_COLOR, - type: 'add-dictionary', - }, - true, - ); - dictionaryData['remove-only-here'] = new Dictionary( { hexColor: colors.analysisColor || FALLBACK_COLOR, @@ -453,14 +444,6 @@ export class AppStateService { true, ); - dictionaryData['change-legal-basis'] = new Dictionary( - { - hexColor: colors.analysisColor || FALLBACK_COLOR, - type: 'analysis', - }, - true, - ); - dictionaryData['hint'] = new Dictionary( { hexColor: '#fa98f7', diff --git a/apps/red-ui/src/app/translations/annotation-types-translations.ts b/apps/red-ui/src/app/translations/annotation-types-translations.ts index 3ef4a04c2..25bc736f1 100644 --- a/apps/red-ui/src/app/translations/annotation-types-translations.ts +++ b/apps/red-ui/src/app/translations/annotation-types-translations.ts @@ -2,14 +2,11 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { AnnotationSuperType } from '../models/file/annotation.wrapper'; export const annotationTypesTranslations: { [key in AnnotationSuperType]: string } = { - 'add-dictionary': _('annotation-type.add-dictionary'), - 'change-legal-basis': _('annotation-type.change-legal-basis'), 'declined-suggestion': _('annotation-type.declined-suggestion'), hint: _('annotation-type.hint'), 'manual-redaction': _('annotation-type.manual-redaction'), recommendation: _('annotation-type.recommendation'), redaction: _('annotation-type.redaction'), - 'remove-only-here': _('annotation-type.remove-only-here'), skipped: _('annotation-type.skipped'), 'suggestion-add': _('annotation-type.suggestion-add'), 'suggestion-add-dictionary': _('annotation-type.suggestion-add-dictionary'), diff --git a/apps/red-ui/src/app/utils/sorters/super-type-sorter.ts b/apps/red-ui/src/app/utils/sorters/super-type-sorter.ts index 23e30bb4e..1be4b46d7 100644 --- a/apps/red-ui/src/app/utils/sorters/super-type-sorter.ts +++ b/apps/red-ui/src/app/utils/sorters/super-type-sorter.ts @@ -6,9 +6,6 @@ export const SuperTypeSorter: { [key in AnnotationSuperType]: number } = { 'suggestion-recategorize-image': 16, 'suggestion-resize': 18, recommendation: 7, - 'add-dictionary': 2, - 'change-legal-basis': 5, - 'remove-only-here': 6, 'suggestion-add-dictionary': 12, 'suggestion-remove-dictionary': 13, 'suggestion-add': 10, diff --git a/apps/red-ui/src/assets/i18n/de.json b/apps/red-ui/src/assets/i18n/de.json index a35b78738..f9a58ee80 100644 --- a/apps/red-ui/src/assets/i18n/de.json +++ b/apps/red-ui/src/assets/i18n/de.json @@ -273,7 +273,6 @@ "rule": "Schwärzung basierend auf Regel {rule}" }, "annotation-type": { - "add-dictionary": "Ausstehende Ergänzung zum Wörterbuch", "change-legal-basis": "Änderung der Rechtsgrundlage ausstehend", "declined-suggestion": "Abgelehnter Vorschlag", "hint": "Hinweis", diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index f8ec73164..c82e4bd4d 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -264,8 +264,6 @@ }, "annotation-type": { "suggestion-resize": "Suggested Resize", - "add-dictionary": "Pending add to dictionary", - "change-legal-basis": "Pending Change of Legal Basis", "declined-suggestion": "Declined Suggestion", "hint": "Hint", "manual-redaction": "Manual Redaction",