From 7fcad33eb3ddfe3bc29bb4b1f6dcb03335c53a76 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Wed, 6 Dec 2023 17:11:27 +0200 Subject: [PATCH 1/2] RED-7980 - Not all unprocessed annotations are displayed correctly --- apps/red-ui/src/app/models/file/annotation.wrapper.ts | 3 +++ .../components/annotation-card/annotation-card.component.html | 2 +- .../components/annotation-card/annotation-card.component.ts | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) 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 4688b0587..054b7f8ed 100644 --- a/apps/red-ui/src/app/models/file/annotation.wrapper.ts +++ b/apps/red-ui/src/app/models/file/annotation.wrapper.ts @@ -60,6 +60,7 @@ export class AnnotationWrapper implements IListable { hasBeenForcedRedaction: boolean; hasBeenRemovedByManualOverride: boolean; isRemoved = false; + isRemovedLocally = false; get isRuleBased() { return this.engines.includes(LogEntryEngines.RULE); @@ -237,6 +238,8 @@ export class AnnotationWrapper implements IListable { annotationWrapper.IMAGE_HINT = logEntry.entryType === EntityTypes.IMAGE_HINT; annotationWrapper.isRemoved = logEntry.state === EntryStates.REMOVED; + annotationWrapper.isRemovedLocally = + logEntry.manualChanges.slice(-1)[0]?.manualRedactionType === ManualRedactionTypes.REMOVE_LOCALLY; annotationWrapper.numberOfComments = logEntry.numberOfComments; annotationWrapper.imported = logEntry.imported; diff --git a/apps/red-ui/src/app/modules/file-preview/components/annotation-card/annotation-card.component.html b/apps/red-ui/src/app/modules/file-preview/components/annotation-card/annotation-card.component.html index 50a482417..99c2ed520 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/annotation-card/annotation-card.component.html +++ b/apps/red-ui/src/app/modules/file-preview/components/annotation-card/annotation-card.component.html @@ -10,7 +10,7 @@
{{ annotation.superTypeLabel | translate }}   - + {{ 'annotation.pending' | translate }}
diff --git a/apps/red-ui/src/app/modules/file-preview/components/annotation-card/annotation-card.component.ts b/apps/red-ui/src/app/modules/file-preview/components/annotation-card/annotation-card.component.ts index 8fb71348f..10cba30f6 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/annotation-card/annotation-card.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/annotation-card/annotation-card.component.ts @@ -16,4 +16,8 @@ export class AnnotationCardComponent { @Input() isSelected = false; constructor(readonly multiSelectService: MultiSelectService) {} + + get pending() { + return this.annotation.pending && this.annotation.isModifyDictionary && !this.annotation.isRemovedLocally; + } } From 5415677034942e0a6727b78576270275f259a093 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Wed, 6 Dec 2023 17:19:14 +0200 Subject: [PATCH 2/2] RED-7980 - update to use already existing "lastRelevantManualChange" variable --- apps/red-ui/src/app/models/file/annotation.wrapper.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 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 054b7f8ed..13755fe4c 100644 --- a/apps/red-ui/src/app/models/file/annotation.wrapper.ts +++ b/apps/red-ui/src/app/models/file/annotation.wrapper.ts @@ -237,10 +237,6 @@ export class AnnotationWrapper implements IListable { annotationWrapper.AREA = logEntry.entryType === EntityTypes.AREA; annotationWrapper.IMAGE_HINT = logEntry.entryType === EntityTypes.IMAGE_HINT; - annotationWrapper.isRemoved = logEntry.state === EntryStates.REMOVED; - annotationWrapper.isRemovedLocally = - logEntry.manualChanges.slice(-1)[0]?.manualRedactionType === ManualRedactionTypes.REMOVE_LOCALLY; - annotationWrapper.numberOfComments = logEntry.numberOfComments; annotationWrapper.imported = logEntry.imported; annotationWrapper.legalBasisValue = logEntry.legalBasis; @@ -274,6 +270,9 @@ export class AnnotationWrapper implements IListable { annotationWrapper.superType = SuperTypeMapper[logEntry.entryType][logEntry.state](logEntry); annotationWrapper.superTypeLabel = annotationTypesTranslations[annotationWrapper.superType]; + annotationWrapper.isRemoved = logEntry.state === EntryStates.REMOVED; + annotationWrapper.isRemovedLocally = lastRelevantManualChange?.manualRedactionType === ManualRedactionTypes.REMOVE_LOCALLY; + annotationWrapper.typeLabel = dictionary.virtual ? undefined : dictionary.label; const colorKey = annotationEntityColorConfig[annotationWrapper.superType];