RED-6774 - REVIEWERS should no longer send requests
This commit is contained in:
parent
831ced7ac9
commit
37ee771a1e
@ -5,50 +5,40 @@ import { Dictionary } from '@red/domain';
|
|||||||
export const canUndo = (annotation: AnnotationWrapper, isApprover: boolean) =>
|
export const canUndo = (annotation: AnnotationWrapper, isApprover: boolean) =>
|
||||||
!isApprover && (annotation.isSuggestion || annotation.pending);
|
!isApprover && (annotation.isSuggestion || annotation.pending);
|
||||||
|
|
||||||
export const canAcceptSuggestion = (annotation: AnnotationWrapper, isApprover: boolean, canProcessManualRedaction: boolean) => {
|
export const canForceHint = (annotation: AnnotationWrapper, canAddRedaction: boolean) =>
|
||||||
const can = isApprover && (annotation.isSuggestion || annotation.isDeclinedSuggestion);
|
canAddRedaction && annotation.isIgnoredHint && !annotation.pending;
|
||||||
return annotation.isSuggestionAdd || annotation.isSuggestionRemoveDictionary ? can && canProcessManualRedaction : can;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const canRejectSuggestion = (annotation: AnnotationWrapper, isApprover: boolean, canProcessManualRedaction: boolean) => {
|
export const canForceRedaction = (annotation: AnnotationWrapper, canAddRedaction: boolean) =>
|
||||||
const can = isApprover && annotation.isSuggestion;
|
canAddRedaction && annotation.isSkipped && !annotation.isFalsePositive && !annotation.pending;
|
||||||
return annotation.isSuggestionAdd || annotation.isSuggestionRemoveDictionary ? can && canProcessManualRedaction : can;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const canForceHint = (annotation: AnnotationWrapper, canAddOrRequestRedaction: boolean) =>
|
|
||||||
canAddOrRequestRedaction && annotation.isIgnoredHint && !annotation.pending;
|
|
||||||
|
|
||||||
export const canForceRedaction = (annotation: AnnotationWrapper, canAddOrRequestRedaction: boolean) =>
|
|
||||||
canAddOrRequestRedaction && annotation.isSkipped && !annotation.isFalsePositive && !annotation.pending;
|
|
||||||
|
|
||||||
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 && annotationEntity.hasDictionary;
|
annotation.canBeMarkedAsFalsePositive && annotationEntity.hasDictionary;
|
||||||
|
|
||||||
export const canRemoveOrSuggestToRemoveOnlyHere = (annotation: AnnotationWrapper, canAddOrRequestRedaction: boolean) =>
|
export const canRemoveOnlyHere = (annotation: AnnotationWrapper, canAddRedaction: boolean) =>
|
||||||
canAddOrRequestRedaction && !annotation.pending && (annotation.isRedacted || (annotation.isHint && !annotation.isImage));
|
canAddRedaction && !annotation.pending && (annotation.isRedacted || (annotation.isHint && !annotation.isImage));
|
||||||
|
|
||||||
export const canRemoveOrSuggestToRemoveFromDictionary = (annotation: AnnotationWrapper) =>
|
export const canRemoveFromDictionary = (annotation: AnnotationWrapper) =>
|
||||||
annotation.isModifyDictionary &&
|
annotation.isModifyDictionary &&
|
||||||
(annotation.isRedacted || annotation.isSkipped || annotation.isHint) &&
|
(annotation.isRedacted || annotation.isSkipped || annotation.isHint) &&
|
||||||
!annotation.pending &&
|
!annotation.pending &&
|
||||||
!annotation.hasBeenResized;
|
!annotation.hasBeenResized;
|
||||||
|
|
||||||
export const canRemoveOrSuggestToRemoveRedaction = (annotations: AnnotationWrapper[], permissions: AnnotationPermissions) =>
|
export const canRemoveRedaction = (annotations: AnnotationWrapper[], permissions: AnnotationPermissions) =>
|
||||||
annotations.length === 1 &&
|
annotations.length === 1 &&
|
||||||
(permissions.canRemoveOrSuggestToRemoveOnlyHere ||
|
(permissions.canRemoveOnlyHere || permissions.canRemoveFromDictionary || permissions.canMarkAsFalsePositive);
|
||||||
permissions.canRemoveOrSuggestToRemoveFromDictionary ||
|
|
||||||
permissions.canMarkAsFalsePositive);
|
|
||||||
|
|
||||||
export const canChangeLegalBasis = (annotation: AnnotationWrapper, canAddOrRequestRedaction: boolean) =>
|
export const canChangeLegalBasis = (annotation: AnnotationWrapper, canAddRedaction: boolean) =>
|
||||||
canAddOrRequestRedaction && annotation.isRedacted && !annotation.pending;
|
canAddRedaction && annotation.isRedacted && !annotation.pending;
|
||||||
|
|
||||||
export const canRecategorizeImage = (annotation: AnnotationWrapper) =>
|
export const canRecategorizeImage = (annotation: AnnotationWrapper, canRecategorize: boolean) =>
|
||||||
((annotation.isImage && !annotation.isSuggestion) || annotation.isSuggestionRecategorizeImage) && !annotation.pending;
|
canRecategorize &&
|
||||||
|
((annotation.isImage && !annotation.isSuggestion) || annotation.isSuggestionRecategorizeImage) &&
|
||||||
|
!annotation.pending;
|
||||||
|
|
||||||
export const canResizeAnnotation = (annotation: AnnotationWrapper, canAddOrRequestRedaction: boolean) =>
|
export const canResizeAnnotation = (annotation: AnnotationWrapper, canAddRedaction: boolean) =>
|
||||||
canAddOrRequestRedaction &&
|
canAddRedaction &&
|
||||||
(((annotation.isRedacted || annotation.isImage) && !annotation.isSuggestion) ||
|
(((annotation.isRedacted || annotation.isImage) && !annotation.isSuggestion) ||
|
||||||
annotation.isSuggestionResize ||
|
annotation.isSuggestionResize ||
|
||||||
annotation.isRecommendation) &&
|
annotation.isRecommendation) &&
|
||||||
|
|||||||
@ -5,16 +5,14 @@ import { IqserPermissionsService } from '@iqser/common-ui';
|
|||||||
import { Roles } from '@users/roles';
|
import { Roles } from '@users/roles';
|
||||||
import {
|
import {
|
||||||
canAcceptRecommendation,
|
canAcceptRecommendation,
|
||||||
canAcceptSuggestion,
|
|
||||||
canChangeLegalBasis,
|
canChangeLegalBasis,
|
||||||
canForceHint,
|
canForceHint,
|
||||||
canForceRedaction,
|
canForceRedaction,
|
||||||
canMarkAsFalsePositive,
|
canMarkAsFalsePositive,
|
||||||
canRecategorizeImage,
|
canRecategorizeImage,
|
||||||
canRejectSuggestion,
|
canRemoveFromDictionary,
|
||||||
canRemoveOrSuggestToRemoveFromDictionary,
|
canRemoveOnlyHere,
|
||||||
canRemoveOrSuggestToRemoveOnlyHere,
|
canRemoveRedaction,
|
||||||
canRemoveOrSuggestToRemoveRedaction,
|
|
||||||
canResizeAnnotation,
|
canResizeAnnotation,
|
||||||
canUndo,
|
canUndo,
|
||||||
} from './annotation-permissions.utils';
|
} from './annotation-permissions.utils';
|
||||||
@ -23,11 +21,9 @@ export class AnnotationPermissions {
|
|||||||
canUndo = true;
|
canUndo = true;
|
||||||
canAcceptRecommendation = true;
|
canAcceptRecommendation = true;
|
||||||
canMarkAsFalsePositive = true;
|
canMarkAsFalsePositive = true;
|
||||||
canRemoveOrSuggestToRemoveOnlyHere = true;
|
canRemoveOnlyHere = true;
|
||||||
canRemoveOrSuggestToRemoveFromDictionary = true;
|
canRemoveFromDictionary = true;
|
||||||
canRemoveOrSuggestToRemoveRedaction = true;
|
canRemoveRedaction = true;
|
||||||
canAcceptSuggestion = true;
|
|
||||||
canRejectSuggestion = true;
|
|
||||||
canForceRedaction = true;
|
canForceRedaction = true;
|
||||||
canChangeLegalBasis = true;
|
canChangeLegalBasis = true;
|
||||||
canResizeAnnotation = true;
|
canResizeAnnotation = true;
|
||||||
@ -46,27 +42,23 @@ export class AnnotationPermissions {
|
|||||||
|
|
||||||
const summedPermissions: AnnotationPermissions = new AnnotationPermissions();
|
const summedPermissions: AnnotationPermissions = new AnnotationPermissions();
|
||||||
const canAddRedaction = permissionsService.has(Roles.redactions.write);
|
const canAddRedaction = permissionsService.has(Roles.redactions.write);
|
||||||
const canRequestRedaction = permissionsService.has(Roles.redactions.request);
|
const canDoAnyApproverAction = canAddRedaction && isApprover;
|
||||||
const canProcessManualRedaction = permissionsService.has(Roles.redactions.processManualRequest);
|
|
||||||
const canAddOrRequestRedaction = canAddRedaction || canRequestRedaction;
|
|
||||||
|
|
||||||
for (const annotation of annotations) {
|
for (const annotation of annotations) {
|
||||||
const permissions: AnnotationPermissions = new AnnotationPermissions();
|
const permissions: AnnotationPermissions = new AnnotationPermissions();
|
||||||
const annotationEntity = entities.find(entity => entity.type === annotation.type);
|
const annotationEntity = entities.find(entity => entity.type === annotation.type);
|
||||||
|
|
||||||
permissions.canUndo = canUndo(annotation, isApprover);
|
permissions.canUndo = canUndo(annotation, isApprover);
|
||||||
permissions.canAcceptSuggestion = canAcceptSuggestion(annotation, isApprover, canProcessManualRedaction);
|
permissions.canForceHint = canForceHint(annotation, canDoAnyApproverAction);
|
||||||
permissions.canRejectSuggestion = canRejectSuggestion(annotation, isApprover, canProcessManualRedaction);
|
permissions.canForceRedaction = canForceRedaction(annotation, canDoAnyApproverAction);
|
||||||
permissions.canForceHint = canForceHint(annotation, canAddOrRequestRedaction);
|
|
||||||
permissions.canForceRedaction = canForceRedaction(annotation, canAddOrRequestRedaction);
|
|
||||||
permissions.canAcceptRecommendation = canAcceptRecommendation(annotation);
|
permissions.canAcceptRecommendation = canAcceptRecommendation(annotation);
|
||||||
permissions.canMarkAsFalsePositive = canMarkAsFalsePositive(annotation, annotationEntity);
|
permissions.canMarkAsFalsePositive = canMarkAsFalsePositive(annotation, annotationEntity);
|
||||||
permissions.canRemoveOrSuggestToRemoveOnlyHere = canRemoveOrSuggestToRemoveOnlyHere(annotation, canAddOrRequestRedaction);
|
permissions.canRemoveOnlyHere = canRemoveOnlyHere(annotation, canAddRedaction);
|
||||||
permissions.canRemoveOrSuggestToRemoveFromDictionary = canRemoveOrSuggestToRemoveFromDictionary(annotation);
|
permissions.canRemoveFromDictionary = canRemoveFromDictionary(annotation);
|
||||||
permissions.canRemoveOrSuggestToRemoveRedaction = canRemoveOrSuggestToRemoveRedaction(annotations, permissions);
|
permissions.canRemoveRedaction = canRemoveRedaction(annotations, permissions);
|
||||||
permissions.canChangeLegalBasis = canChangeLegalBasis(annotation, canAddOrRequestRedaction);
|
permissions.canChangeLegalBasis = canChangeLegalBasis(annotation, canDoAnyApproverAction);
|
||||||
permissions.canRecategorizeImage = canRecategorizeImage(annotation);
|
permissions.canRecategorizeImage = canRecategorizeImage(annotation, canDoAnyApproverAction);
|
||||||
permissions.canResizeAnnotation = canResizeAnnotation(annotation, canAddOrRequestRedaction);
|
permissions.canResizeAnnotation = canResizeAnnotation(annotation, canDoAnyApproverAction);
|
||||||
|
|
||||||
summedPermissions._merge(permissions);
|
summedPermissions._merge(permissions);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,15 +51,6 @@
|
|||||||
icon="iqser:check"
|
icon="iqser:check"
|
||||||
></iqser-circle-button>
|
></iqser-circle-button>
|
||||||
|
|
||||||
<iqser-circle-button
|
|
||||||
(action)="annotationActionsService.acceptSuggestion(annotations)"
|
|
||||||
*ngIf="annotationPermissions.canAcceptSuggestion"
|
|
||||||
[tooltipPosition]="tooltipPosition"
|
|
||||||
[tooltip]="'annotation-actions.accept-suggestion.label' | translate"
|
|
||||||
[type]="buttonType"
|
|
||||||
icon="iqser:check"
|
|
||||||
></iqser-circle-button>
|
|
||||||
|
|
||||||
<iqser-circle-button
|
<iqser-circle-button
|
||||||
(action)="annotationActionsService.convertHighlights(annotations)"
|
(action)="annotationActionsService.convertHighlights(annotations)"
|
||||||
*ngIf="viewModeService.isEarmarks()"
|
*ngIf="viewModeService.isEarmarks()"
|
||||||
@ -88,12 +79,12 @@
|
|||||||
></iqser-circle-button>
|
></iqser-circle-button>
|
||||||
|
|
||||||
<iqser-circle-button
|
<iqser-circle-button
|
||||||
(action)="annotationActionsService.rejectSuggestion(annotations)"
|
(action)="annotationActionsService.undoDirectAction(annotations)"
|
||||||
*ngIf="annotationPermissions.canRejectSuggestion"
|
*allow="roles.redactions.deleteManual; if: annotationPermissions.canUndo"
|
||||||
[tooltipPosition]="tooltipPosition"
|
[tooltipPosition]="tooltipPosition"
|
||||||
[tooltip]="'annotation-actions.reject-suggestion' | translate"
|
[tooltip]="'annotation-actions.undo' | translate"
|
||||||
[type]="buttonType"
|
[type]="buttonType"
|
||||||
icon="iqser:close"
|
icon="red:undo"
|
||||||
></iqser-circle-button>
|
></iqser-circle-button>
|
||||||
|
|
||||||
<iqser-circle-button
|
<iqser-circle-button
|
||||||
@ -152,7 +143,7 @@
|
|||||||
|
|
||||||
<iqser-circle-button
|
<iqser-circle-button
|
||||||
(action)="removeOrSuggestRemoveRedaction()"
|
(action)="removeOrSuggestRemoveRedaction()"
|
||||||
*ngIf="annotationPermissions.canRemoveOrSuggestToRemoveRedaction"
|
*ngIf="annotationPermissions.canRemoveRedaction"
|
||||||
[tooltipPosition]="tooltipPosition"
|
[tooltipPosition]="tooltipPosition"
|
||||||
[tooltip]="'annotation-actions.remove-annotation.remove-redaction' | translate"
|
[tooltip]="'annotation-actions.remove-annotation.remove-redaction' | translate"
|
||||||
[type]="buttonType"
|
[type]="buttonType"
|
||||||
|
|||||||
@ -177,7 +177,6 @@ export class ManualAnnotationDialogComponent extends BaseDialogComponent impleme
|
|||||||
addRedactionRequest.addToDictionary = selectedType.hasDictionary;
|
addRedactionRequest.addToDictionary = selectedType.hasDictionary;
|
||||||
} else {
|
} else {
|
||||||
addRedactionRequest.addToDictionary = this.isDictionaryRequest && addRedactionRequest.type !== 'dossier_redaction';
|
addRedactionRequest.addToDictionary = this.isDictionaryRequest && addRedactionRequest.type !== 'dossier_redaction';
|
||||||
addRedactionRequest.addToDossierDictionary = this.isDictionaryRequest && addRedactionRequest.type === 'dossier_redaction';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!addRedactionRequest.reason) {
|
if (!addRedactionRequest.reason) {
|
||||||
|
|||||||
@ -198,7 +198,6 @@ export class RedactTextDialogComponent
|
|||||||
addRedactionRequest.addToDictionary = selectedType.hasDictionary;
|
addRedactionRequest.addToDictionary = selectedType.hasDictionary;
|
||||||
} else {
|
} else {
|
||||||
addRedactionRequest.addToDictionary = this.dictionaryRequest && addRedactionRequest.type !== 'dossier_redaction';
|
addRedactionRequest.addToDictionary = this.dictionaryRequest && addRedactionRequest.type !== 'dossier_redaction';
|
||||||
addRedactionRequest.addToDossierDictionary = this.dictionaryRequest && addRedactionRequest.type === 'dossier_redaction';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!addRedactionRequest.reason) {
|
if (!addRedactionRequest.reason) {
|
||||||
|
|||||||
@ -16,8 +16,8 @@ const FOLDER_ICON = 'red:folder';
|
|||||||
const REMOVE_FROM_DICT_ICON = 'red:remove-from-dict';
|
const REMOVE_FROM_DICT_ICON = 'red:remove-from-dict';
|
||||||
|
|
||||||
export interface RemoveRedactionPermissions {
|
export interface RemoveRedactionPermissions {
|
||||||
canRemoveOrSuggestToRemoveOnlyHere: boolean;
|
canRemoveOnlyHere: boolean;
|
||||||
canRemoveOrSuggestToRemoveFromDictionary: boolean;
|
canRemoveFromDictionary: boolean;
|
||||||
canMarkAsFalsePositive: boolean;
|
canMarkAsFalsePositive: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ export class RemoveRedactionDialogComponent extends IqserDialogComponent<
|
|||||||
|
|
||||||
#options() {
|
#options() {
|
||||||
const options: DetailsRadioOption<RemoveRedactionOption>[] = [];
|
const options: DetailsRadioOption<RemoveRedactionOption>[] = [];
|
||||||
if (this.#permissions.canRemoveOrSuggestToRemoveOnlyHere) {
|
if (this.#permissions.canRemoveOnlyHere) {
|
||||||
options.push({
|
options.push({
|
||||||
label: this.#translations.ONLY_HERE.label,
|
label: this.#translations.ONLY_HERE.label,
|
||||||
description: this.#translations.ONLY_HERE.description,
|
description: this.#translations.ONLY_HERE.description,
|
||||||
@ -102,7 +102,7 @@ export class RemoveRedactionDialogComponent extends IqserDialogComponent<
|
|||||||
value: RemoveRedactionOptions.ONLY_HERE,
|
value: RemoveRedactionOptions.ONLY_HERE,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (this.#permissions.canRemoveOrSuggestToRemoveFromDictionary) {
|
if (this.#permissions.canRemoveFromDictionary) {
|
||||||
options.push({
|
options.push({
|
||||||
label: this.#translations.IN_DOSSIER.label,
|
label: this.#translations.IN_DOSSIER.label,
|
||||||
description: this.#translations.IN_DOSSIER.description,
|
description: this.#translations.IN_DOSSIER.description,
|
||||||
|
|||||||
@ -123,8 +123,8 @@ export class AnnotationActionsService {
|
|||||||
|
|
||||||
async removeOrSuggestRemoveRedaction(redaction: AnnotationWrapper, permissions) {
|
async removeOrSuggestRemoveRedaction(redaction: AnnotationWrapper, permissions) {
|
||||||
const removePermissions: RemoveRedactionPermissions = {
|
const removePermissions: RemoveRedactionPermissions = {
|
||||||
canRemoveOrSuggestToRemoveOnlyHere: permissions.canRemoveOrSuggestToRemoveOnlyHere,
|
canRemoveOnlyHere: permissions.canRemoveOnlyHere,
|
||||||
canRemoveOrSuggestToRemoveFromDictionary: permissions.canRemoveOrSuggestToRemoveFromDictionary,
|
canRemoveFromDictionary: permissions.canRemoveFromDictionary,
|
||||||
canMarkAsFalsePositive: permissions.canMarkAsFalsePositive,
|
canMarkAsFalsePositive: permissions.canMarkAsFalsePositive,
|
||||||
};
|
};
|
||||||
const dossierTemplate = this._dossierTemplatesService.find(this._state.dossierTemplateId);
|
const dossierTemplate = this._dossierTemplatesService.find(this._state.dossierTemplateId);
|
||||||
|
|||||||
@ -63,15 +63,6 @@ export class PdfAnnotationActionsService {
|
|||||||
availableActions.push(recategorizeButton);
|
availableActions.push(recategorizeButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (permissions.canRemoveOrSuggestToRemoveFromDictionary) {
|
|
||||||
// const removeFromDictButton = this.#getButton(
|
|
||||||
// 'remove-from-dict',
|
|
||||||
// _('annotation-actions.remove-annotation.remove-from-dict'),
|
|
||||||
// () => this.#annotationActionsService.removeOrSuggestRemoveAnnotation(annotations, true),
|
|
||||||
// );
|
|
||||||
// availableActions.push(removeFromDictButton);
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (permissions.canAcceptRecommendation) {
|
if (permissions.canAcceptRecommendation) {
|
||||||
const acceptRecommendationButton = this.#getButton('check', _('annotation-actions.accept-recommendation.label'), () =>
|
const acceptRecommendationButton = this.#getButton('check', _('annotation-actions.accept-recommendation.label'), () =>
|
||||||
this.#annotationActionsService.convertRecommendationToAnnotation(annotations),
|
this.#annotationActionsService.convertRecommendationToAnnotation(annotations),
|
||||||
@ -79,27 +70,6 @@ export class PdfAnnotationActionsService {
|
|||||||
availableActions.push(acceptRecommendationButton);
|
availableActions.push(acceptRecommendationButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (permissions.canAcceptSuggestion) {
|
|
||||||
const acceptSuggestionButton = this.#getButton('check', _('annotation-actions.accept-suggestion.label'), () =>
|
|
||||||
this.#annotationActionsService.acceptSuggestion(annotations),
|
|
||||||
);
|
|
||||||
availableActions.push(acceptSuggestionButton);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (permissions.canUndo) {
|
|
||||||
const undoButton = this.#getButton('undo', _('annotation-actions.undo'), () =>
|
|
||||||
this.#annotationActionsService.undoDirectAction(annotations),
|
|
||||||
);
|
|
||||||
availableActions.push(undoButton);
|
|
||||||
}
|
|
||||||
|
|
||||||
// if (permissions.canMarkAsFalsePositive) {
|
|
||||||
// const markAsFalsePositiveButton = this.#getButton('thumb-down', _('annotation-actions.remove-annotation.false-positive'), () =>
|
|
||||||
// this.#annotationActionsService.markAsFalsePositive(annotations),
|
|
||||||
// );
|
|
||||||
// availableActions.push(markAsFalsePositiveButton);
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (permissions.canForceRedaction) {
|
if (permissions.canForceRedaction) {
|
||||||
const forceRedactionButton = this.#getButton('thumb-up', _('annotation-actions.force-redaction.label'), () =>
|
const forceRedactionButton = this.#getButton('thumb-up', _('annotation-actions.force-redaction.label'), () =>
|
||||||
this.#annotationActionsService.forceAnnotation(annotations),
|
this.#annotationActionsService.forceAnnotation(annotations),
|
||||||
@ -114,27 +84,11 @@ export class PdfAnnotationActionsService {
|
|||||||
availableActions.push(forceHintButton);
|
availableActions.push(forceHintButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (permissions.canRejectSuggestion) {
|
if (permissions.canRemoveRedaction) {
|
||||||
const rejectSuggestionButton = this.#getButton('close', _('annotation-actions.reject-suggestion'), () =>
|
const removeRedactionButton = this.#getButton('trash', _('annotation-actions.remove-annotation.remove-redaction'), () =>
|
||||||
this.#annotationActionsService.rejectSuggestion(annotations),
|
|
||||||
);
|
|
||||||
availableActions.push(rejectSuggestionButton);
|
|
||||||
}
|
|
||||||
|
|
||||||
// if (permissions.canRemoveOrSuggestToRemoveOnlyHere) {
|
|
||||||
// const removeOrSuggestToRemoveOnlyHereButton = this.#getButton(
|
|
||||||
// 'trash',
|
|
||||||
// _('annotation-actions.remove-annotation.only-here'),
|
|
||||||
// () => this.#annotationActionsService.removeOrSuggestRemoveAnnotation(annotations, false),
|
|
||||||
// );
|
|
||||||
// availableActions.push(removeOrSuggestToRemoveOnlyHereButton);
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (permissions.canRemoveOrSuggestToRemoveRedaction) {
|
|
||||||
const removeOrSuggestToRemoveButton = this.#getButton('trash', _('annotation-actions.remove-annotation.remove-redaction'), () =>
|
|
||||||
this.#annotationActionsService.removeOrSuggestRemoveRedaction(annotations[0], permissions),
|
this.#annotationActionsService.removeOrSuggestRemoveRedaction(annotations[0], permissions),
|
||||||
);
|
);
|
||||||
availableActions.push(removeOrSuggestToRemoveButton);
|
availableActions.push(removeRedactionButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
return availableActions;
|
return availableActions;
|
||||||
@ -158,21 +112,13 @@ export class PdfAnnotationActionsService {
|
|||||||
canResize: permissions.length === 1 && permissions[0].canResizeAnnotation,
|
canResize: permissions.length === 1 && permissions[0].canResizeAnnotation,
|
||||||
canChangeLegalBasis: permissions.reduce((acc, next) => acc && next.canChangeLegalBasis, true),
|
canChangeLegalBasis: permissions.reduce((acc, next) => acc && next.canChangeLegalBasis, true),
|
||||||
canRecategorizeImage: permissions.reduce((acc, next) => acc && next.canRecategorizeImage, true),
|
canRecategorizeImage: permissions.reduce((acc, next) => acc && next.canRecategorizeImage, true),
|
||||||
canRemoveOrSuggestToRemoveFromDictionary: permissions.reduce(
|
canRemoveFromDictionary: permissions.reduce((acc, next) => acc && next.canRemoveFromDictionary, true),
|
||||||
(acc, next) => acc && next.canRemoveOrSuggestToRemoveFromDictionary,
|
|
||||||
true,
|
|
||||||
),
|
|
||||||
canAcceptRecommendation: permissions.reduce((acc, next) => acc && next.canAcceptRecommendation, true),
|
canAcceptRecommendation: permissions.reduce((acc, next) => acc && next.canAcceptRecommendation, true),
|
||||||
canAcceptSuggestion: permissions.reduce((acc, next) => acc && next.canAcceptSuggestion, true),
|
|
||||||
canUndo:
|
|
||||||
this.#iqserPermissionsService.has(Roles.redactions.deleteManual) &&
|
|
||||||
permissions.reduce((acc, next) => acc && next.canUndo, true),
|
|
||||||
canMarkAsFalsePositive: permissions.reduce((acc, next) => acc && next.canMarkAsFalsePositive, true),
|
canMarkAsFalsePositive: permissions.reduce((acc, next) => acc && next.canMarkAsFalsePositive, true),
|
||||||
canForceRedaction: permissions.reduce((acc, next) => acc && next.canForceRedaction, true),
|
canForceRedaction: permissions.reduce((acc, next) => acc && next.canForceRedaction, true),
|
||||||
canForceHint: permissions.reduce((acc, next) => acc && next.canForceHint, true),
|
canForceHint: permissions.reduce((acc, next) => acc && next.canForceHint, true),
|
||||||
canRejectSuggestion: permissions.reduce((acc, next) => acc && next.canRejectSuggestion, true),
|
canRemoveOnlyHere: permissions.reduce((acc, next) => acc && next.canRemoveOnlyHere, true),
|
||||||
canRemoveOrSuggestToRemoveOnlyHere: permissions.reduce((acc, next) => acc && next.canRemoveOrSuggestToRemoveOnlyHere, true),
|
canRemoveRedaction: permissions.reduce((acc, next) => acc && next.canRemoveRedaction, true),
|
||||||
canRemoveOrSuggestToRemoveRedaction: permissions.reduce((acc, next) => acc && next.canRemoveOrSuggestToRemoveRedaction, true),
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1958,7 +1958,7 @@
|
|||||||
},
|
},
|
||||||
"in-dossier": {
|
"in-dossier": {
|
||||||
"description": "Do not {type} \"{value}\" in any document of the current dossier.",
|
"description": "Do not {type} \"{value}\" in any document of the current dossier.",
|
||||||
"label": "Remove in dossier"
|
"label": "Remove from dossier"
|
||||||
},
|
},
|
||||||
"only-here": {
|
"only-here": {
|
||||||
"description": "Do not {type} \"{value}\" at this position in the current document.",
|
"description": "Do not {type} \"{value}\" at this position in the current document.",
|
||||||
|
|||||||
@ -1958,7 +1958,7 @@
|
|||||||
},
|
},
|
||||||
"in-dossier": {
|
"in-dossier": {
|
||||||
"description": "Do not {type} \"{value}\" in any document of the current dossier.",
|
"description": "Do not {type} \"{value}\" in any document of the current dossier.",
|
||||||
"label": "Remove in dossier"
|
"label": "Remove from dossier"
|
||||||
},
|
},
|
||||||
"only-here": {
|
"only-here": {
|
||||||
"description": "Do not {type} \"{value}\" at this position in the current document.",
|
"description": "Do not {type} \"{value}\" at this position in the current document.",
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import { DictionaryEntryType } from './dictionary-entry-types';
|
|||||||
|
|
||||||
export interface IAddRedactionRequest {
|
export interface IAddRedactionRequest {
|
||||||
addToDictionary?: boolean;
|
addToDictionary?: boolean;
|
||||||
addToDossierDictionary?: boolean;
|
|
||||||
dictionaryEntryType?: DictionaryEntryType;
|
dictionaryEntryType?: DictionaryEntryType;
|
||||||
comment?: { text: string };
|
comment?: { text: string };
|
||||||
legalBasis?: string;
|
legalBasis?: string;
|
||||||
|
|||||||
@ -3,7 +3,6 @@ import { LogEntryStatus } from './types';
|
|||||||
|
|
||||||
export interface IManualRedactionEntry {
|
export interface IManualRedactionEntry {
|
||||||
addToDictionary?: boolean;
|
addToDictionary?: boolean;
|
||||||
addToDossierDictionary?: boolean;
|
|
||||||
annotationId?: string;
|
annotationId?: string;
|
||||||
fileId?: string;
|
fileId?: string;
|
||||||
legalBasis?: string;
|
legalBasis?: string;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user