RED-7990 fix rule based annotations cannot be resized
This commit is contained in:
parent
17891f5579
commit
db1edf162f
@ -34,11 +34,15 @@ export const canChangeLegalBasis = (annotation: AnnotationWrapper, canAddRedacti
|
||||
export const canRecategorizeAnnotation = (annotation: AnnotationWrapper, canRecategorize: boolean) =>
|
||||
canRecategorize && (annotation.isImage || annotation.isDictBasedHint) && !annotation.pending;
|
||||
|
||||
export const canResizeAnnotation = (annotation: AnnotationWrapper, canAddRedaction: boolean) =>
|
||||
export const canResizeAnnotation = (annotation: AnnotationWrapper, canAddRedaction: boolean, hasDictionary = false) =>
|
||||
canAddRedaction &&
|
||||
!annotation.isSkipped &&
|
||||
!annotation.pending &&
|
||||
(annotation.isRedacted || annotation.isImage || annotation.isDictBasedHint || annotation.isRecommendation);
|
||||
(annotation.isRedacted ||
|
||||
annotation.isImage ||
|
||||
annotation.isDictBasedHint ||
|
||||
annotation.isRecommendation ||
|
||||
(hasDictionary && annotation.isRuleBased));
|
||||
|
||||
export const canEditAnnotation = (annotation: AnnotationWrapper) => (annotation.isRedacted || annotation.isSkipped) && !annotation.isImage;
|
||||
|
||||
|
||||
@ -62,7 +62,7 @@ export class AnnotationPermissions {
|
||||
permissions.canRemoveRedaction = canRemoveRedaction(annotation, permissions);
|
||||
permissions.canChangeLegalBasis = canChangeLegalBasis(annotation, canAddRedaction);
|
||||
permissions.canRecategorizeAnnotation = canRecategorizeAnnotation(annotation, canAddRedaction);
|
||||
permissions.canResizeAnnotation = canResizeAnnotation(annotation, canAddRedaction);
|
||||
permissions.canResizeAnnotation = canResizeAnnotation(annotation, canAddRedaction, annotationEntity.hasDictionary);
|
||||
permissions.canEditAnnotations = canEditAnnotation(annotation);
|
||||
permissions.canEditHints = canEditHint(annotation);
|
||||
permissions.canEditImages = canEditImage(annotation);
|
||||
|
||||
@ -61,6 +61,10 @@ export class AnnotationWrapper implements IListable {
|
||||
hasBeenRemovedByManualOverride: boolean;
|
||||
isRemoved = false;
|
||||
|
||||
get isRuleBased() {
|
||||
return this.engines.includes(LogEntryEngines.RULE);
|
||||
}
|
||||
|
||||
get searchKey(): string {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user