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 ec313b6de..e725d852a 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 @@ -13,7 +13,10 @@ export const canForceRedaction = (annotation: AnnotationWrapper, canAddRedaction export const canAcceptRecommendation = (annotation: AnnotationWrapper) => annotation.isRecommendation && !annotation.pending; 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) => canAddRedaction && @@ -24,7 +27,8 @@ export const canRemoveFromDictionary = (annotation: AnnotationWrapper, autoAnaly annotation.isModifyDictionary && (annotation.isRedacted || annotation.isSkipped || annotation.isHint || (annotation.isIgnoredHint && !annotation.isRuleBased)) && (autoAnalysisDisabled || !annotation.pending) && - !annotation.hasBeenResized; + !annotation.hasBeenResizedLocally && + (!annotation.hasBeenForcedHint || !annotation.hasBeenForcedRedaction); export const canRemoveRedaction = (annotation: AnnotationWrapper, permissions: AnnotationPermissions) => (!annotation.isIgnoredHint || !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 1a8f5db59..e1985d7bd 100644 --- a/apps/red-ui/src/app/models/file/annotation.wrapper.ts +++ b/apps/red-ui/src/app/models/file/annotation.wrapper.ts @@ -57,6 +57,7 @@ export class AnnotationWrapper implements IListable { isChangeLogEntry = false; engines: LogEntryEngine[] = []; hasBeenResized: boolean; + hasBeenResizedLocally: boolean; hasBeenRecategorized: boolean; hasLegalBasisChanged: boolean; hasBeenForcedHint: boolean; @@ -253,20 +254,20 @@ export class AnnotationWrapper implements IListable { annotationWrapper.section = logEntry.section; annotationWrapper.reference = logEntry.reference || []; annotationWrapper.hasBeenResized = !!logEntry.manualChanges?.find(c => c.manualRedactionType === ManualRedactionTypes.RESIZE); + annotationWrapper.hasBeenResizedLocally = + annotationWrapper.hasBeenResized && annotationWrapper.engines.includes(LogEntryEngines.MANUAL); annotationWrapper.hasBeenRecategorized = !!logEntry.manualChanges?.find( c => c.manualRedactionType === ManualRedactionTypes.RECATEGORIZE, ); annotationWrapper.hasLegalBasisChanged = !!logEntry.manualChanges?.find( c => c.manualRedactionType === ManualRedactionTypes.LEGAL_BASIS_CHANGE, ); - annotationWrapper.hasBeenForcedHint = !!logEntry.manualChanges?.find( - c => c.manualRedactionType === ManualRedactionTypes.FORCE_HINT, - ); + annotationWrapper.hasBeenForcedHint = !!logEntry.manualChanges?.find(c => c.manualRedactionType === ManualRedactionTypes.FORCE); annotationWrapper.hasBeenForcedRedaction = !!logEntry.manualChanges?.find( - c => c.manualRedactionType === ManualRedactionTypes.FORCE_REDACT, + c => c.manualRedactionType === ManualRedactionTypes.FORCE, ); annotationWrapper.hasBeenRemovedByManualOverride = !!logEntry.manualChanges?.find( - c => c.manualRedactionType === ManualRedactionTypes.REMOVE_LOCALLY, + c => c.manualRedactionType === ManualRedactionTypes.REMOVE, ); const content = this.#createContent(annotationWrapper, logEntry, isDocumine); @@ -279,7 +280,9 @@ export class AnnotationWrapper implements IListable { annotationWrapper.superTypeLabel = annotationTypesTranslations[annotationWrapper.superType]; 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; diff --git a/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.html index d392e69e3..0739859ac 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/edit-color-dialog/edit-color-dialog.component.html @@ -21,7 +21,7 @@ > diff --git a/apps/red-ui/src/app/modules/admin/screens/dossier-states-listing/add-edit-dossier-state-dialog/add-edit-dossier-state-dialog.component.html b/apps/red-ui/src/app/modules/admin/screens/dossier-states-listing/add-edit-dossier-state-dialog/add-edit-dossier-state-dialog.component.html index 41c82eed6..0b6be06f3 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dossier-states-listing/add-edit-dossier-state-dialog/add-edit-dossier-state-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/dossier-states-listing/add-edit-dossier-state-dialog/add-edit-dossier-state-dialog.component.html @@ -1,5 +1,5 @@
-
+
@@ -37,7 +37,7 @@ >
diff --git a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen/watermark-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen/watermark-screen.component.html index 6ad37f690..5ad404b91 100644 --- a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen/watermark-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen/watermark-screen.component.html @@ -121,7 +121,7 @@ > diff --git a/apps/red-ui/src/app/modules/file-preview/utils/dialog-options.ts b/apps/red-ui/src/app/modules/file-preview/utils/dialog-options.ts index 82894b5db..c949a3af1 100644 --- a/apps/red-ui/src/app/modules/file-preview/utils/dialog-options.ts +++ b/apps/red-ui/src/app/modules/file-preview/utils/dialog-options.ts @@ -127,22 +127,23 @@ export const getResizeRedactionOptions = ( if (isRss) { return options; } - - const dictBasedType = redaction.isModifyDictionary; - options.push({ - label: translations.inDossier.label, - description: translations.inDossier.description, - descriptionParams: { dossierName: dossier.dossierName }, - disabled: !dictBasedType || redaction.hasBeenRecategorized, - tooltip: !dictBasedType ? translations.inDossier.tooltip : null, - icon: FOLDER_ICON, - value: RedactOrHintOptions.IN_DOSSIER, - extraOption: { - label: translations.inDossier.extraOptionLabel, - checked: applyToAllDossiers, - hidden: !isApprover, - }, - }); + if (!redaction.hasBeenResizedLocally) { + const dictBasedType = redaction.isModifyDictionary; + options.push({ + label: translations.inDossier.label, + description: translations.inDossier.description, + descriptionParams: { dossierName: dossier.dossierName }, + disabled: !dictBasedType || redaction.hasBeenRecategorized, + tooltip: !dictBasedType ? translations.inDossier.tooltip : null, + icon: FOLDER_ICON, + value: RedactOrHintOptions.IN_DOSSIER, + extraOption: { + label: translations.inDossier.extraOptionLabel, + checked: applyToAllDossiers, + hidden: !isApprover, + }, + }); + } return options; }; diff --git a/apps/red-ui/src/app/modules/icons/icons.module.ts b/apps/red-ui/src/app/modules/icons/icons.module.ts index 45e74b71f..a2b7a8376 100644 --- a/apps/red-ui/src/app/modules/icons/icons.module.ts +++ b/apps/red-ui/src/app/modules/icons/icons.module.ts @@ -33,7 +33,6 @@ export class IconsModule { 'assign-me', 'attribute', 'case-sensitive', - 'color-picker', 'comment', 'comment-fill', 'convert', diff --git a/apps/red-ui/src/app/modules/shared/components/add-edit-entity/add-edit-entity.component.html b/apps/red-ui/src/app/modules/shared/components/add-edit-entity/add-edit-entity.component.html index b40a4c6c7..d5790c69f 100644 --- a/apps/red-ui/src/app/modules/shared/components/add-edit-entity/add-edit-entity.component.html +++ b/apps/red-ui/src/app/modules/shared/components/add-edit-entity/add-edit-entity.component.html @@ -30,7 +30,7 @@ [style.cursor]="cpDisabled(color) ? 'default' : 'pointer'" class="input-icon" > - + diff --git a/apps/red-ui/src/app/modules/shared/dialogs/download-dialog/download-dialog.component.html b/apps/red-ui/src/app/modules/shared/dialogs/download-dialog/download-dialog.component.html index e532119af..9d63dbd2d 100644 --- a/apps/red-ui/src/app/modules/shared/dialogs/download-dialog/download-dialog.component.html +++ b/apps/red-ui/src/app/modules/shared/dialogs/download-dialog/download-dialog.component.html @@ -42,7 +42,7 @@ > diff --git a/apps/red-ui/src/assets/icons/general/color-picker.svg b/apps/red-ui/src/assets/icons/general/color-picker.svg deleted file mode 100644 index 7c1574d55..000000000 --- a/apps/red-ui/src/assets/icons/general/color-picker.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - diff --git a/libs/red-domain/src/lib/redaction-log/types.ts b/libs/red-domain/src/lib/redaction-log/types.ts index 1a6f2abd3..c35068387 100644 --- a/libs/red-domain/src/lib/redaction-log/types.ts +++ b/libs/red-domain/src/lib/redaction-log/types.ts @@ -13,14 +13,13 @@ export type LogEntryEngine = ValuesOf; export const ManualRedactionTypes = { ADD_LOCALLY: 'ADD_LOCALLY', ADD_TO_DICTIONARY: 'ADD_TO_DICTIONARY', - REMOVE_LOCALLY: 'REMOVE_LOCALLY', + REMOVE: 'REMOVE', REMOVE_FROM_DICTIONARY: 'REMOVE_FROM_DICTIONARY', - FORCE_REDACT: 'FORCE_REDACT', - FORCE_HINT: 'FORCE_HINT', + FORCE: 'FORCE', RECATEGORIZE: 'RECATEGORIZE', LEGAL_BASIS_CHANGE: 'LEGAL_BASIS_CHANGE', RESIZE: 'RESIZE', - RESIZE_LOCALLY: 'RESIZE_LOCALLY', + RESIZE_WITH_DICTIONARY: 'RESIZE_WITH_DICTIONARY', } as const; export type ManualRedactionType = ValuesOf;