RED-8907: changed dialog options permissions based on local changes.
This commit is contained in:
parent
6e5eb1d91a
commit
ee8d66ba41
@ -13,7 +13,10 @@ export const canForceRedaction = (annotation: AnnotationWrapper, canAddRedaction
|
|||||||
export const canAcceptRecommendation = (annotation: AnnotationWrapper) => annotation.isRecommendation && !annotation.pending;
|
export const canAcceptRecommendation = (annotation: AnnotationWrapper) => annotation.isRecommendation && !annotation.pending;
|
||||||
|
|
||||||
export const canMarkAsFalsePositive = (annotation: AnnotationWrapper, annotationEntity: Dictionary) =>
|
export const canMarkAsFalsePositive = (annotation: AnnotationWrapper, annotationEntity: Dictionary) =>
|
||||||
annotation.canBeMarkedAsFalsePositive && !annotation.hasBeenForcedRedaction && annotationEntity?.hasDictionary;
|
annotation.canBeMarkedAsFalsePositive &&
|
||||||
|
!annotation.hasBeenForcedRedaction &&
|
||||||
|
!annotation.hasBeenResizedLocally &&
|
||||||
|
annotationEntity?.hasDictionary;
|
||||||
|
|
||||||
export const canRemoveOnlyHere = (annotation: AnnotationWrapper, canAddRedaction: boolean, autoAnalysisDisabled: boolean) =>
|
export const canRemoveOnlyHere = (annotation: AnnotationWrapper, canAddRedaction: boolean, autoAnalysisDisabled: boolean) =>
|
||||||
canAddRedaction &&
|
canAddRedaction &&
|
||||||
@ -24,7 +27,8 @@ export const canRemoveFromDictionary = (annotation: AnnotationWrapper, autoAnaly
|
|||||||
annotation.isModifyDictionary &&
|
annotation.isModifyDictionary &&
|
||||||
(annotation.isRedacted || annotation.isSkipped || annotation.isHint || (annotation.isIgnoredHint && !annotation.isRuleBased)) &&
|
(annotation.isRedacted || annotation.isSkipped || annotation.isHint || (annotation.isIgnoredHint && !annotation.isRuleBased)) &&
|
||||||
(autoAnalysisDisabled || !annotation.pending) &&
|
(autoAnalysisDisabled || !annotation.pending) &&
|
||||||
!annotation.hasBeenResized;
|
!annotation.hasBeenResizedLocally &&
|
||||||
|
(!annotation.hasBeenForcedHint || !annotation.hasBeenForcedRedaction);
|
||||||
|
|
||||||
export const canRemoveRedaction = (annotation: AnnotationWrapper, permissions: AnnotationPermissions) =>
|
export const canRemoveRedaction = (annotation: AnnotationWrapper, permissions: AnnotationPermissions) =>
|
||||||
(!annotation.isIgnoredHint || !annotation.isRuleBased) &&
|
(!annotation.isIgnoredHint || !annotation.isRuleBased) &&
|
||||||
|
|||||||
@ -57,6 +57,7 @@ export class AnnotationWrapper implements IListable {
|
|||||||
isChangeLogEntry = false;
|
isChangeLogEntry = false;
|
||||||
engines: LogEntryEngine[] = [];
|
engines: LogEntryEngine[] = [];
|
||||||
hasBeenResized: boolean;
|
hasBeenResized: boolean;
|
||||||
|
hasBeenResizedLocally: boolean;
|
||||||
hasBeenRecategorized: boolean;
|
hasBeenRecategorized: boolean;
|
||||||
hasLegalBasisChanged: boolean;
|
hasLegalBasisChanged: boolean;
|
||||||
hasBeenForcedHint: boolean;
|
hasBeenForcedHint: boolean;
|
||||||
@ -253,20 +254,20 @@ export class AnnotationWrapper implements IListable {
|
|||||||
annotationWrapper.section = logEntry.section;
|
annotationWrapper.section = logEntry.section;
|
||||||
annotationWrapper.reference = logEntry.reference || [];
|
annotationWrapper.reference = logEntry.reference || [];
|
||||||
annotationWrapper.hasBeenResized = !!logEntry.manualChanges?.find(c => c.manualRedactionType === ManualRedactionTypes.RESIZE);
|
annotationWrapper.hasBeenResized = !!logEntry.manualChanges?.find(c => c.manualRedactionType === ManualRedactionTypes.RESIZE);
|
||||||
|
annotationWrapper.hasBeenResizedLocally =
|
||||||
|
annotationWrapper.hasBeenResized && annotationWrapper.engines.includes(LogEntryEngines.MANUAL);
|
||||||
annotationWrapper.hasBeenRecategorized = !!logEntry.manualChanges?.find(
|
annotationWrapper.hasBeenRecategorized = !!logEntry.manualChanges?.find(
|
||||||
c => c.manualRedactionType === ManualRedactionTypes.RECATEGORIZE,
|
c => c.manualRedactionType === ManualRedactionTypes.RECATEGORIZE,
|
||||||
);
|
);
|
||||||
annotationWrapper.hasLegalBasisChanged = !!logEntry.manualChanges?.find(
|
annotationWrapper.hasLegalBasisChanged = !!logEntry.manualChanges?.find(
|
||||||
c => c.manualRedactionType === ManualRedactionTypes.LEGAL_BASIS_CHANGE,
|
c => c.manualRedactionType === ManualRedactionTypes.LEGAL_BASIS_CHANGE,
|
||||||
);
|
);
|
||||||
annotationWrapper.hasBeenForcedHint = !!logEntry.manualChanges?.find(
|
annotationWrapper.hasBeenForcedHint = !!logEntry.manualChanges?.find(c => c.manualRedactionType === ManualRedactionTypes.FORCE);
|
||||||
c => c.manualRedactionType === ManualRedactionTypes.FORCE_HINT,
|
|
||||||
);
|
|
||||||
annotationWrapper.hasBeenForcedRedaction = !!logEntry.manualChanges?.find(
|
annotationWrapper.hasBeenForcedRedaction = !!logEntry.manualChanges?.find(
|
||||||
c => c.manualRedactionType === ManualRedactionTypes.FORCE_REDACT,
|
c => c.manualRedactionType === ManualRedactionTypes.FORCE,
|
||||||
);
|
);
|
||||||
annotationWrapper.hasBeenRemovedByManualOverride = !!logEntry.manualChanges?.find(
|
annotationWrapper.hasBeenRemovedByManualOverride = !!logEntry.manualChanges?.find(
|
||||||
c => c.manualRedactionType === ManualRedactionTypes.REMOVE_LOCALLY,
|
c => c.manualRedactionType === ManualRedactionTypes.REMOVE,
|
||||||
);
|
);
|
||||||
|
|
||||||
const content = this.#createContent(annotationWrapper, logEntry, isDocumine);
|
const content = this.#createContent(annotationWrapper, logEntry, isDocumine);
|
||||||
@ -279,7 +280,9 @@ export class AnnotationWrapper implements IListable {
|
|||||||
annotationWrapper.superTypeLabel = annotationTypesTranslations[annotationWrapper.superType];
|
annotationWrapper.superTypeLabel = annotationTypesTranslations[annotationWrapper.superType];
|
||||||
|
|
||||||
annotationWrapper.isRemoved = logEntry.state === EntryStates.REMOVED;
|
annotationWrapper.isRemoved = logEntry.state === EntryStates.REMOVED;
|
||||||
annotationWrapper.isRemovedLocally = lastRelevantManualChange?.manualRedactionType === ManualRedactionTypes.REMOVE_LOCALLY;
|
annotationWrapper.isRemovedLocally =
|
||||||
|
lastRelevantManualChange?.manualRedactionType === ManualRedactionTypes.REMOVE &&
|
||||||
|
logEntry.engines.includes(LogEntryEngines.MANUAL);
|
||||||
|
|
||||||
annotationWrapper.typeLabel = dictionary?.virtual ? undefined : dictionary?.label;
|
annotationWrapper.typeLabel = dictionary?.virtual ? undefined : dictionary?.label;
|
||||||
|
|
||||||
|
|||||||
@ -127,7 +127,7 @@ export const getResizeRedactionOptions = (
|
|||||||
if (isRss) {
|
if (isRss) {
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
if (!redaction.hasBeenResizedLocally) {
|
||||||
const dictBasedType = redaction.isModifyDictionary;
|
const dictBasedType = redaction.isModifyDictionary;
|
||||||
options.push({
|
options.push({
|
||||||
label: translations.inDossier.label,
|
label: translations.inDossier.label,
|
||||||
@ -143,6 +143,7 @@ export const getResizeRedactionOptions = (
|
|||||||
hidden: !isApprover,
|
hidden: !isApprover,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
}
|
||||||
return options;
|
return options;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -13,14 +13,13 @@ export type LogEntryEngine = ValuesOf<typeof LogEntryEngines>;
|
|||||||
export const ManualRedactionTypes = {
|
export const ManualRedactionTypes = {
|
||||||
ADD_LOCALLY: 'ADD_LOCALLY',
|
ADD_LOCALLY: 'ADD_LOCALLY',
|
||||||
ADD_TO_DICTIONARY: 'ADD_TO_DICTIONARY',
|
ADD_TO_DICTIONARY: 'ADD_TO_DICTIONARY',
|
||||||
REMOVE_LOCALLY: 'REMOVE_LOCALLY',
|
REMOVE: 'REMOVE',
|
||||||
REMOVE_FROM_DICTIONARY: 'REMOVE_FROM_DICTIONARY',
|
REMOVE_FROM_DICTIONARY: 'REMOVE_FROM_DICTIONARY',
|
||||||
FORCE_REDACT: 'FORCE_REDACT',
|
FORCE: 'FORCE',
|
||||||
FORCE_HINT: 'FORCE_HINT',
|
|
||||||
RECATEGORIZE: 'RECATEGORIZE',
|
RECATEGORIZE: 'RECATEGORIZE',
|
||||||
LEGAL_BASIS_CHANGE: 'LEGAL_BASIS_CHANGE',
|
LEGAL_BASIS_CHANGE: 'LEGAL_BASIS_CHANGE',
|
||||||
RESIZE: 'RESIZE',
|
RESIZE: 'RESIZE',
|
||||||
RESIZE_LOCALLY: 'RESIZE_LOCALLY',
|
RESIZE_WITH_DICTIONARY: 'RESIZE_WITH_DICTIONARY',
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type ManualRedactionType = ValuesOf<typeof ManualRedactionTypes>;
|
export type ManualRedactionType = ValuesOf<typeof ManualRedactionTypes>;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user