Merge branch 'RED-8270' into 'master'

RED-8270: fixed actions not available for manually added hints.

See merge request redactmanager/red-ui!266
This commit is contained in:
Dan Percic 2024-01-23 11:46:49 +01:00
commit ef286355db
2 changed files with 18 additions and 19 deletions

View File

@ -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;

View File

@ -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;
}