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 e1985d7bd..836651065 100644 --- a/apps/red-ui/src/app/models/file/annotation.wrapper.ts +++ b/apps/red-ui/src/app/models/file/annotation.wrapper.ts @@ -63,6 +63,7 @@ export class AnnotationWrapper implements IListable { hasBeenForcedHint: boolean; hasBeenForcedRedaction: boolean; hasBeenRemovedByManualOverride: boolean; + hasBeenAdded: boolean; isRemoved = false; isRemovedLocally = false; hiddenInWorkload = false; @@ -269,6 +270,7 @@ export class AnnotationWrapper implements IListable { annotationWrapper.hasBeenRemovedByManualOverride = !!logEntry.manualChanges?.find( c => c.manualRedactionType === ManualRedactionTypes.REMOVE, ); + annotationWrapper.hasBeenAdded = !!logEntry.manualChanges?.find(c => c.manualRedactionType === ManualRedactionTypes.ADD); const content = this.#createContent(annotationWrapper, logEntry, isDocumine); annotationWrapper.shortContent = this.#getShortContent(annotationWrapper, legalBasisList) || content; diff --git a/apps/red-ui/src/app/modules/file-preview/components/annotation-details/annotation-details.component.ts b/apps/red-ui/src/app/modules/file-preview/components/annotation-details/annotation-details.component.ts index b3b385268..0f30fa6ea 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/annotation-details/annotation-details.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/annotation-details/annotation-details.component.ts @@ -14,7 +14,7 @@ interface Engine { readonly translateParams?: Record; } -const Engines = { +export const Engines = { DICTIONARY: 'DICTIONARY', NER: 'NER', RULE: 'RULE', @@ -29,6 +29,7 @@ function isBasedOn(annotation: AnnotationWrapper, engineName: EngineName) { } const changesProperties: KeysOf[] = [ + 'hasBeenAdded', 'hasBeenResized', 'hasBeenRecategorized', 'hasLegalBasisChanged', @@ -52,12 +53,12 @@ export class AnnotationDetailsComponent implements OnChanges { noSelection: boolean; getChangesTooltip(): string | undefined { - const changes = changesProperties.filter(key => this.annotation.item[key]); - - if (!changes.length) { + if (!this.annotation.item.engines?.includes(Engines.MANUAL)) { return; } + const changes = changesProperties.filter(key => this.annotation.item[key]); + const header = this._translateService.instant(_('annotation-changes.header')); const details = changes.map(change => this._translateService.instant(annotationChangesTranslations[change])); return [header, ...details.map(change => `• ${change}`)].join('\n'); @@ -93,11 +94,6 @@ export class AnnotationDetailsComponent implements OnChanges { description: _('annotation-engines.imported'), show: isBasedOn(annotation, Engines.IMPORTED), }, - { - icon: 'red:redaction-changes', - description: _('annotation-engines.manual'), - show: isBasedOn(annotation, Engines.MANUAL), - }, ]; } } diff --git a/apps/red-ui/src/app/modules/file-preview/services/annotation-processing.service.ts b/apps/red-ui/src/app/modules/file-preview/services/annotation-processing.service.ts index a73ab5c50..e7fbb0d94 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/annotation-processing.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/annotation-processing.service.ts @@ -19,6 +19,7 @@ import { } from '../utils/sort-by-page-rotation.utils'; import { FileDataService } from './file-data.service'; import { FilePreviewStateService } from './file-preview-state.service'; +import { Engines } from '../components/annotation-details/annotation-details.component'; @Injectable() export class AnnotationProcessingService { @@ -50,7 +51,7 @@ export class AnnotationProcessingService { label: _('filter-menu.redaction-changes'), checked: false, topLevelFilter: true, - checker: (annotation: AnnotationWrapper) => annotation?.hasRedactionChanges, + checker: (annotation: AnnotationWrapper) => annotation?.engines?.includes(Engines.MANUAL), }, { id: 'unseen-pages', diff --git a/apps/red-ui/src/app/translations/annotation-changes-translations.ts b/apps/red-ui/src/app/translations/annotation-changes-translations.ts index cdc0a534f..59c0fee42 100644 --- a/apps/red-ui/src/app/translations/annotation-changes-translations.ts +++ b/apps/red-ui/src/app/translations/annotation-changes-translations.ts @@ -3,6 +3,7 @@ import { AnnotationWrapper } from '@models/file/annotation.wrapper'; import { KeysOf } from '@iqser/common-ui/lib/utils'; export const annotationChangesTranslations: { [key in KeysOf]?: string } = { + hasBeenAdded: _('annotation-changes.added'), hasBeenResized: _('annotation-changes.resized'), hasBeenRecategorized: _('annotation-changes.recategorized'), hasLegalBasisChanged: _('annotation-changes.legal-basis'), diff --git a/apps/red-ui/src/assets/i18n/redact/de.json b/apps/red-ui/src/assets/i18n/redact/de.json index 4756ded38..263e509ec 100644 --- a/apps/red-ui/src/assets/i18n/redact/de.json +++ b/apps/red-ui/src/assets/i18n/redact/de.json @@ -347,6 +347,7 @@ "undo": "Rückgängig" }, "annotation-changes": { + "added": "", "forced-hint": "Hint forced", "forced-redaction": "Redaction forced", "header": "Manuelle Änderungen:", diff --git a/apps/red-ui/src/assets/i18n/redact/en.json b/apps/red-ui/src/assets/i18n/redact/en.json index f918c16e6..ec75a2144 100644 --- a/apps/red-ui/src/assets/i18n/redact/en.json +++ b/apps/red-ui/src/assets/i18n/redact/en.json @@ -340,6 +340,7 @@ "undo": "Undo" }, "annotation-changes": { + "added": "Redaction/Hint added", "forced-hint": "Hint forced", "forced-redaction": "Redaction forced", "header": "Manual changes:", @@ -351,7 +352,6 @@ "annotation-engines": { "dictionary": "Based on dictionary", "imported": "Imported", - "manual": "Manual", "ner": "Based on AI", "rule": "Based on rule" }, diff --git a/apps/red-ui/src/assets/i18n/scm/de.json b/apps/red-ui/src/assets/i18n/scm/de.json index 0331d4eea..bcbb00588 100644 --- a/apps/red-ui/src/assets/i18n/scm/de.json +++ b/apps/red-ui/src/assets/i18n/scm/de.json @@ -347,6 +347,7 @@ "undo": "Rückgängig" }, "annotation-changes": { + "added": "", "forced-hint": "Hint forced", "forced-redaction": "Annotation forced", "header": "Manuelle Änderungen:", diff --git a/apps/red-ui/src/assets/i18n/scm/en.json b/apps/red-ui/src/assets/i18n/scm/en.json index 97c79bddc..2c0d1ebb1 100644 --- a/apps/red-ui/src/assets/i18n/scm/en.json +++ b/apps/red-ui/src/assets/i18n/scm/en.json @@ -340,6 +340,7 @@ "undo": "Undo" }, "annotation-changes": { + "added": "Redaction/Hint added", "forced-hint": "Hint forced", "forced-redaction": "Annotation forced", "header": "Manual changes:", @@ -351,7 +352,6 @@ "annotation-engines": { "dictionary": "{isHint, select, true{Hint} other{Annotation}} based on dictionary", "imported": "Annotation is imported", - "manual": "Manual", "ner": "Annotation based on AI", "rule": "Annotation based on rule {rule}" }, diff --git a/libs/red-domain/src/lib/redaction-log/types.ts b/libs/red-domain/src/lib/redaction-log/types.ts index c35068387..e1cf69f1a 100644 --- a/libs/red-domain/src/lib/redaction-log/types.ts +++ b/libs/red-domain/src/lib/redaction-log/types.ts @@ -11,6 +11,7 @@ export const LogEntryEngines = { export type LogEntryEngine = ValuesOf; export const ManualRedactionTypes = { + ADD: 'ADD', ADD_LOCALLY: 'ADD_LOCALLY', ADD_TO_DICTIONARY: 'ADD_TO_DICTIONARY', REMOVE: 'REMOVE',