Merge branch 'RED-5108' into 'master'
RED-5108: added redact functionality for hint images. See merge request redactmanager/red-ui!438
This commit is contained in:
commit
f02323561c
@ -8,7 +8,10 @@ export const canForceHint = (annotation: AnnotationWrapper, canAddRedaction: boo
|
|||||||
canAddRedaction && annotation.isIgnoredHint && !annotation.pending;
|
canAddRedaction && annotation.isIgnoredHint && !annotation.pending;
|
||||||
|
|
||||||
export const canForceRedaction = (annotation: AnnotationWrapper, canAddRedaction: boolean) =>
|
export const canForceRedaction = (annotation: AnnotationWrapper, canAddRedaction: boolean) =>
|
||||||
canAddRedaction && annotation.isSkipped && !annotation.isFalsePositive && !annotation.pending;
|
canAddRedaction &&
|
||||||
|
(annotation.isSkipped || (annotation.IMAGE_HINT && !annotation.hasBeenForcedRedaction)) &&
|
||||||
|
!annotation.isFalsePositive &&
|
||||||
|
!annotation.pending;
|
||||||
|
|
||||||
export const canAcceptRecommendation = (annotation: AnnotationWrapper) => annotation.isRecommendation && !annotation.pending;
|
export const canAcceptRecommendation = (annotation: AnnotationWrapper) => annotation.isRecommendation && !annotation.pending;
|
||||||
|
|
||||||
|
|||||||
@ -108,7 +108,7 @@
|
|||||||
[tooltip]="'annotation-actions.force-redaction.label' | translate"
|
[tooltip]="'annotation-actions.force-redaction.label' | translate"
|
||||||
[type]="buttonType"
|
[type]="buttonType"
|
||||||
[buttonId]="annotations.length === 1 ? 'annotation-' + annotations[0].id + '-force_redaction' : 'annotations-force_redaction'"
|
[buttonId]="annotations.length === 1 ? 'annotation-' + annotations[0].id + '-force_redaction' : 'annotations-force_redaction'"
|
||||||
icon="iqser:thumb-up"
|
[icon]="isImageHint ? 'red:pdftron-action-add-redaction' : 'iqser:thumb-up'"
|
||||||
></iqser-circle-button>
|
></iqser-circle-button>
|
||||||
|
|
||||||
<iqser-circle-button
|
<iqser-circle-button
|
||||||
|
|||||||
@ -58,6 +58,10 @@ export class AnnotationActionsComponent implements OnChanges {
|
|||||||
return this.#annotations;
|
return this.#annotations;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isImageHint(): boolean {
|
||||||
|
return this.annotations.every(annotation => annotation.IMAGE_HINT);
|
||||||
|
}
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
set annotations(annotations: AnnotationWrapper[]) {
|
set annotations(annotations: AnnotationWrapper[]) {
|
||||||
this.#annotations = annotations.filter(a => a !== undefined);
|
this.#annotations = annotations.filter(a => a !== undefined);
|
||||||
|
|||||||
@ -8,6 +8,7 @@
|
|||||||
[columns]="tableColumns"
|
[columns]="tableColumns"
|
||||||
[data]="tableData"
|
[data]="tableData"
|
||||||
[staticColumns]="true"
|
[staticColumns]="true"
|
||||||
|
*ngIf="!isImageHint"
|
||||||
></redaction-selected-annotations-table>
|
></redaction-selected-annotations-table>
|
||||||
<div *ngIf="!isHintDialog && !isDocumine" class="iqser-input-group required w-400">
|
<div *ngIf="!isHintDialog && !isDocumine" class="iqser-input-group required w-400">
|
||||||
<label [translate]="'manual-annotation.dialog.content.reason'"></label>
|
<label [translate]="'manual-annotation.dialog.content.reason'"></label>
|
||||||
|
|||||||
@ -53,6 +53,10 @@ export class ForceAnnotationDialogComponent extends BaseDialogComponent implemen
|
|||||||
this.form = this.#getForm();
|
this.form = this.#getForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isImageHint() {
|
||||||
|
return this._data.annotations.every(annotation => annotation.IMAGE_HINT);
|
||||||
|
}
|
||||||
|
|
||||||
get isHintDialog() {
|
get isHintDialog() {
|
||||||
return this._data.hint;
|
return this._data.hint;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -81,8 +81,11 @@ export class PdfAnnotationActionsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (permissions.canForceRedaction && annotationChangesAllowed) {
|
if (permissions.canForceRedaction && annotationChangesAllowed) {
|
||||||
const forceRedactionButton = this.#getButton('thumb-up', _('annotation-actions.force-redaction.label'), () =>
|
const isImageHint = annotations.every(annotation => annotation.IMAGE_HINT);
|
||||||
this.#annotationActionsService.forceAnnotation(annotations),
|
const forceRedactionButton = this.#getButton(
|
||||||
|
isImageHint ? 'general/pdftron-action-add-redaction' : 'thumb-up',
|
||||||
|
_('annotation-actions.force-redaction.label'),
|
||||||
|
() => this.#annotationActionsService.forceAnnotation(annotations),
|
||||||
);
|
);
|
||||||
availableActions.push(forceRedactionButton);
|
availableActions.push(forceRedactionButton);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -86,6 +86,7 @@ export class IconsModule {
|
|||||||
'visibility',
|
'visibility',
|
||||||
'visibility-off',
|
'visibility-off',
|
||||||
'warning',
|
'warning',
|
||||||
|
'pdftron-action-add-redaction',
|
||||||
];
|
];
|
||||||
|
|
||||||
for (const icon of icons) {
|
for (const icon of icons) {
|
||||||
|
|||||||
@ -88,7 +88,7 @@ export const SuperTypeMapper: Record<EntityType, Record<EntryState, (entry: IEnt
|
|||||||
[EntryStates.PENDING]: entry => resolveRedactionType(entry),
|
[EntryStates.PENDING]: entry => resolveRedactionType(entry),
|
||||||
},
|
},
|
||||||
[EntityTypes.IMAGE_HINT]: {
|
[EntityTypes.IMAGE_HINT]: {
|
||||||
[EntryStates.APPLIED]: wrongSuperTypeHandler,
|
[EntryStates.APPLIED]: entry => resolveRedactionType(entry),
|
||||||
[EntryStates.SKIPPED]: () => SuperTypes.Hint,
|
[EntryStates.SKIPPED]: () => SuperTypes.Hint,
|
||||||
[EntryStates.IGNORED]: () => SuperTypes.IgnoredHint,
|
[EntryStates.IGNORED]: () => SuperTypes.IgnoredHint,
|
||||||
[EntryStates.REMOVED]: wrongSuperTypeHandler,
|
[EntryStates.REMOVED]: wrongSuperTypeHandler,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user