Merge branch 'master' into VM/RED-8748

This commit is contained in:
Valentin Mihai 2024-04-08 19:51:10 +03:00
commit e4502ea55c
11 changed files with 41 additions and 50 deletions

View File

@ -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) &&

View File

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

View File

@ -21,7 +21,7 @@
>
<mat-icon
*ngIf="!form.get('color').value || form.get('color').value?.length === 0"
svgIcon="red:color-picker"
svgIcon="iqser:color-picker"
></mat-icon>
</div>
</div>

View File

@ -1,5 +1,5 @@
<section class="dialog">
<div [innerHTML]="'add-edit-dossier-state.title' | translate : titleTranslateParams" class="dialog-header heading-l"></div>
<div [innerHTML]="'add-edit-dossier-state.title' | translate: titleTranslateParams" class="dialog-header heading-l"></div>
<form [formGroup]="form">
<div class="dialog-content">
@ -37,7 +37,7 @@
>
<mat-icon
*ngIf="!form.get('color').value || form.get('color').value?.length === 0"
svgIcon="red:color-picker"
svgIcon="iqser:color-picker"
></mat-icon>
</div>
</div>

View File

@ -121,7 +121,7 @@
>
<mat-icon
*ngIf="!form.controls.hexColor?.value || form.controls.hexColor.value?.length === 0"
svgIcon="red:color-picker"
svgIcon="iqser:color-picker"
></mat-icon>
</div>
</div>

View File

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

View File

@ -33,7 +33,6 @@ export class IconsModule {
'assign-me',
'attribute',
'case-sensitive',
'color-picker',
'comment',
'comment-fill',
'convert',

View File

@ -30,7 +30,7 @@
[style.cursor]="cpDisabled(color) ? 'default' : 'pointer'"
class="input-icon"
>
<mat-icon *ngIf="color.hasColor$ | async" svgIcon="red:color-picker"></mat-icon>
<mat-icon *ngIf="color.hasColor$ | async" svgIcon="iqser:color-picker"></mat-icon>
</div>
</div>
</div>

View File

@ -42,7 +42,7 @@
>
<mat-icon
*ngIf="!form.controls.redactionPreviewColor.value || form.controls.redactionPreviewColor.value?.length === 0"
svgIcon="red:color-picker"
svgIcon="iqser:color-picker"
></mat-icon>
</div>
</div>

View File

@ -1,15 +0,0 @@
<svg id="Capa_1" style="enable-background:new 0 0 464.736 464.736;" viewBox="0 0 464.736 464.736"
x="0px"
xml:space="preserve" xmlns="http://www.w3.org/2000/svg" y="0px">
<g>
<path d="M446.598,18.143c-24.183-24.184-63.393-24.191-87.592-0.008l-16.717,16.717c-8.98-8.979-23.525-8.979-32.504,0
c-8.981,8.972-8.981,23.533,0,32.505l5.416,5.419L134.613,253.377h-0.016l-62.685,62.691c-4.982,4.982-7.919,11.646-8.235,18.684
l-0.15,3.344c0,0.016,0,0.03,0,0.046l-2.529,56.704c-0.104,2.633,0.883,5.185,2.739,7.048c1.751,1.759,4.145,2.738,6.63,2.738
c0.135,0,0.269,0,0.42-0.008l30.064-1.331h0.016l18.318-0.815l8.318-0.366c9.203-0.412,17.944-4.259,24.469-10.776l240.898-240.891
l4.506,4.505c4.49,4.488,10.372,6.733,16.252,6.733c5.881,0,11.764-2.245,16.253-6.733c8.98-8.973,8.98-23.534,0-32.505
l16.716-16.718C470.782,81.544,470.782,42.334,446.598,18.143z M272.639,227.33l-84.6,15.96l137.998-138.004l34.332,34.316
L272.639,227.33z" fill="currentColor" />
<path d="M64.5,423.872c-35.617,0-64.5,9.145-64.5,20.435c0,11.284,28.883,20.428,64.5,20.428s64.486-9.143,64.486-20.428
C128.986,433.016,100.117,423.872,64.5,423.872z" fill="currentColor" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -13,14 +13,13 @@ export type LogEntryEngine = ValuesOf<typeof LogEntryEngines>;
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<typeof ManualRedactionTypes>;