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 d19b067c3..4ea3ee437 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 @@ -34,7 +34,9 @@ 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.isDictBasedHint) && (autoAnalysisDisabled || !annotation.pending); + canRecategorize && + (annotation.isImage || (annotation.isHint && !annotation.isRuleBased)) && + (autoAnalysisDisabled || !annotation.pending); export const canResizeAnnotation = ( annotation: AnnotationWrapper, @@ -42,17 +44,18 @@ export const canResizeAnnotation = ( autoAnalysisDisabled: boolean, hasDictionary = false, ) => - canAddRedaction && - !annotation.isSkipped && - (autoAnalysisDisabled || !annotation.pending) && - (annotation.isRedacted || - annotation.isImage || - annotation.isDictBasedHint || - annotation.isRecommendation || - (hasDictionary && annotation.isRuleBased)); + (canAddRedaction && + !annotation.isSkipped && + !annotation.isIgnoredHint && + (autoAnalysisDisabled || !annotation.pending) && + (annotation.isRedacted || + annotation.isImage || + (annotation.isHint && !annotation.isRuleBased) || + (!annotation.isHint && hasDictionary && annotation.isRuleBased))) || + annotation.isRecommendation; export const canEditAnnotation = (annotation: AnnotationWrapper) => (annotation.isRedacted || annotation.isSkipped) && !annotation.isImage; -export const canEditHint = (annotation: AnnotationWrapper) => annotation.HINT || annotation.isIgnoredHint; +export const canEditHint = (annotation: AnnotationWrapper) => (annotation.isHint && !annotation.isRuleBased) || annotation.isIgnoredHint; export const canEditImage = (annotation: AnnotationWrapper) => annotation.isImage; 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; }