From a1f8451ee6bd5d3f33a0984629420d4d48949ddb Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Mon, 22 Jan 2024 16:31:07 +0200 Subject: [PATCH] RED-8270: prevent future bug. --- .../models/file/annotation-permissions.utils.ts | 10 ++++++---- .../src/app/models/file/annotation.wrapper.ts | 14 +++++--------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/apps/red-ui/src/app/models/file/annotation-permissions.utils.ts b/apps/red-ui/src/app/models/file/annotation-permissions.utils.ts index 500041df3..e1aab36d1 100644 --- a/apps/red-ui/src/app/models/file/annotation-permissions.utils.ts +++ b/apps/red-ui/src/app/models/file/annotation-permissions.utils.ts @@ -16,11 +16,13 @@ export const canMarkAsFalsePositive = (annotation: AnnotationWrapper, annotation annotation.canBeMarkedAsFalsePositive && annotationEntity?.hasDictionary; export const canRemoveOnlyHere = (annotation: AnnotationWrapper, canAddRedaction: boolean, autoAnalysisDisabled: boolean) => - canAddRedaction && (autoAnalysisDisabled || !annotation.pending) && (annotation.isRedacted || (annotation.HINT && !annotation.isImage)); + canAddRedaction && + (autoAnalysisDisabled || !annotation.pending) && + (annotation.isRedacted || (annotation.isHint && !annotation.isImage)); export const canRemoveFromDictionary = (annotation: AnnotationWrapper, autoAnalysisDisabled: boolean) => annotation.isModifyDictionary && - (annotation.isRedacted || annotation.isSkipped || annotation.HINT) && + (annotation.isRedacted || annotation.isSkipped || annotation.isHint) && (autoAnalysisDisabled || !annotation.pending) && !annotation.hasBeenResized; @@ -32,7 +34,7 @@ export const canChangeLegalBasis = (annotation: AnnotationWrapper, canAddRedacti canAddRedaction && annotation.isRedacted && (autoAnalysisDisabled || !annotation.pending); export const canRecategorizeAnnotation = (annotation: AnnotationWrapper, canRecategorize: boolean, autoAnalysisDisabled: boolean) => - canRecategorize && (annotation.isImage || annotation.HINT) && (autoAnalysisDisabled || !annotation.pending); + canRecategorize && (annotation.isImage || annotation.isHint) && (autoAnalysisDisabled || !annotation.pending); export const canResizeAnnotation = ( annotation: AnnotationWrapper, @@ -45,7 +47,7 @@ export const canResizeAnnotation = ( (autoAnalysisDisabled || !annotation.pending) && (annotation.isRedacted || annotation.isImage || - annotation.HINT || + annotation.isHint || annotation.isRecommendation || (hasDictionary && annotation.isRuleBased)); 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 67eec1e76..00eab80cd 100644 --- a/apps/red-ui/src/app/models/file/annotation.wrapper.ts +++ b/apps/red-ui/src/app/models/file/annotation.wrapper.ts @@ -126,7 +126,11 @@ export class AnnotationWrapper implements IListable { } get isHint() { - return this.superType === SuperTypes.Hint; + return this.superType === SuperTypes.Hint || this.superType === SuperTypes.ManualHint; + } + + get isIgnoredHint() { + return this.superType === SuperTypes.IgnoredHint; } get isEarmark() { @@ -145,14 +149,6 @@ export class AnnotationWrapper implements IListable { return 'square'; } - get isDictBasedHint() { - return this.isHint && this.engines.includes(LogEntryEngines.DICTIONARY); - } - - get isIgnoredHint() { - return this.superType === SuperTypes.IgnoredHint; - } - get isRedacted() { return this.superType === SuperTypes.Redaction || this.superType === SuperTypes.ManualRedaction; }