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 77addc55a..f9334fb7b 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 @@ -17,9 +17,7 @@ export const canMarkAsFalsePositive = (annotation: AnnotationWrapper, annotation annotation.canBeMarkedAsFalsePositive && annotationEntity.hasDictionary; export const canRemoveOnlyHere = (annotation: AnnotationWrapper, canAddRedaction: boolean) => - canAddRedaction && - !annotation.pending && - (annotation.isRedacted || annotation.isRecommendation || (annotation.isHint && !annotation.isImage)); + canAddRedaction && !annotation.pending && (annotation.isRedacted || (annotation.isHint && !annotation.isImage)); export const canRemoveFromDictionary = (annotation: AnnotationWrapper) => annotation.isModifyDictionary && diff --git a/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts b/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts index 1b7a8c416..06aeec728 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts @@ -166,7 +166,10 @@ export class AnnotationActionsService { const result = await this.#getRemoveRedactionDialog(data).result(); if (result) { - if (result.option.value === RemoveRedactionOptions.FALSE_POSITIVE) { + if ( + result.option.value === RemoveRedactionOptions.FALSE_POSITIVE || + result.option.value === RemoveRedactionOptions.DO_NOT_RECOMMEND + ) { this.#setAsFalsePositive(redaction, result); } else { this.#removeRedaction(redaction, result); 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 9c5962597..6375b9dc0 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 @@ -1,10 +1,6 @@ import { DetailsRadioOption } from '@iqser/common-ui'; import { addHintTranslations } from '@translations/add-hint-translations'; -import { - editRedactionTranslations, - redactTextTranslations, - removeActionDescriptorTranslations, -} from '@translations/redact-text-translations'; +import { editRedactionTranslations, redactTextTranslations } from '@translations/redact-text-translations'; import { Dossier } from '@red/domain'; import { removeRedactionTranslations } from '@translations/remove-redaction-translations'; import { RemoveRedactionData } from './dialog-types'; @@ -30,6 +26,7 @@ export const RemoveRedactionOptions = { ONLY_HERE: 'ONLY_HERE', IN_DOSSIER: 'IN_DOSSIER', FALSE_POSITIVE: 'FALSE_POSITIVE', + DO_NOT_RECOMMEND: 'DO_NOT_RECOMMEND', } as const; export const RemoveAnnotationOptions = RemoveRedactionOptions; @@ -151,9 +148,6 @@ export const getRemoveRedactionOptions = ( description: translations.ONLY_HERE.description, descriptionParams: { value: redaction.value, - type: data.redaction.isRecommendation - ? removeActionDescriptorTranslations.recommend - : removeActionDescriptorTranslations.redact, }, icon: PIN_ICON, value: RemoveRedactionOptions.ONLY_HERE, @@ -176,20 +170,37 @@ export const getRemoveRedactionOptions = ( }); } if (permissions.canMarkAsFalsePositive) { - options.push({ - label: translations.FALSE_POSITIVE.label, - description: translations.FALSE_POSITIVE.description, - descriptionParams: { value: redaction.value, type: redaction.type, context: falsePositiveContext }, - icon: REMOVE_FROM_DICT_ICON, - value: RemoveRedactionOptions.FALSE_POSITIVE, - extraOption: !isDocumine - ? { - label: translations.FALSE_POSITIVE.extraOptionLabel, - checked: applyToAllDossiers ?? true, - hidden: !isApprover, - } - : null, - }); + if (data.redaction.isRecommendation) { + options.push({ + label: translations.DO_NOT_RECOMMEND.label, + description: translations.DO_NOT_RECOMMEND.description, + descriptionParams: { value: redaction.value, type: redaction.type, context: falsePositiveContext }, + icon: FOLDER_ICON, + value: RemoveRedactionOptions.DO_NOT_RECOMMEND, + extraOption: !isDocumine + ? { + label: translations.DO_NOT_RECOMMEND.extraOptionLabel, + checked: applyToAllDossiers ?? true, + hidden: !isApprover, + } + : null, + }); + } else { + options.push({ + label: translations.FALSE_POSITIVE.label, + description: translations.FALSE_POSITIVE.description, + descriptionParams: { value: redaction.value, type: redaction.type, context: falsePositiveContext }, + icon: REMOVE_FROM_DICT_ICON, + value: RemoveRedactionOptions.FALSE_POSITIVE, + extraOption: !isDocumine + ? { + label: translations.FALSE_POSITIVE.extraOptionLabel, + checked: applyToAllDossiers ?? true, + hidden: !isApprover, + } + : null, + }); + } } return options; }; diff --git a/apps/red-ui/src/app/translations/redact-text-translations.ts b/apps/red-ui/src/app/translations/redact-text-translations.ts index 65953bf11..5c149848b 100644 --- a/apps/red-ui/src/app/translations/redact-text-translations.ts +++ b/apps/red-ui/src/app/translations/redact-text-translations.ts @@ -29,8 +29,3 @@ export const editRedactionTranslations: Record<'onlyHere' | 'inDossier', DialogO extraOptionLabel: _('edit-redaction.dialog.content.options.in-dossier.extraOptionLabel'), }, } as const; - -export const removeActionDescriptorTranslations = { - redact: _('remove-redaction.dialog.content.options.only-here.types.redact'), - recommend: _('remove-redaction.dialog.content.options.only-here.types.recommend'), -}; diff --git a/apps/red-ui/src/app/translations/remove-annotation-translations.ts b/apps/red-ui/src/app/translations/remove-annotation-translations.ts index 0b056844c..e2f544389 100644 --- a/apps/red-ui/src/app/translations/remove-annotation-translations.ts +++ b/apps/red-ui/src/app/translations/remove-annotation-translations.ts @@ -15,4 +15,8 @@ export const removeAnnotationTranslations: { [key in RemoveAnnotationOption]: Di label: _('remove-annotation.dialog.content.options.false-positive.label'), description: _('remove-annotation.dialog.content.options.false-positive.description'), }, + DO_NOT_RECOMMEND: { + label: _('remove-redaction.dialog.content.options.do-not-recommend.label'), + description: _('remove-redaction.dialog.content.options.do-not-recommend.description'), + }, }; diff --git a/apps/red-ui/src/app/translations/remove-redaction-translations.ts b/apps/red-ui/src/app/translations/remove-redaction-translations.ts index 05b850b66..2a7d7b790 100644 --- a/apps/red-ui/src/app/translations/remove-redaction-translations.ts +++ b/apps/red-ui/src/app/translations/remove-redaction-translations.ts @@ -17,4 +17,9 @@ export const removeRedactionTranslations: { [key in RemoveRedactionOption]: Dial description: _('remove-redaction.dialog.content.options.false-positive.description'), extraOptionLabel: _('remove-redaction.dialog.content.options.false-positive.extraOptionLabel'), }, + DO_NOT_RECOMMEND: { + label: _('remove-redaction.dialog.content.options.do-not-recommend.label'), + description: _('remove-redaction.dialog.content.options.do-not-recommend.description'), + extraOptionLabel: _('remove-redaction.dialog.content.options.do-not-recommend.extraOptionLabel'), + }, }; diff --git a/apps/red-ui/src/assets/i18n/redact/de.json b/apps/red-ui/src/assets/i18n/redact/de.json index 402f8d048..0c862f349 100644 --- a/apps/red-ui/src/assets/i18n/redact/de.json +++ b/apps/red-ui/src/assets/i18n/redact/de.json @@ -2055,6 +2055,11 @@ "comment": "", "comment-placeholder": "", "options": { + "do-not-recommend": { + "description": "", + "extraOptionLabel": "", + "label": "" + }, "false-positive": { "description": "", "extraOptionLabel": "", @@ -2067,11 +2072,7 @@ }, "only-here": { "description": "", - "label": "", - "types": { - "recommend": "", - "redact": "" - } + "label": "" } } }, diff --git a/apps/red-ui/src/assets/i18n/redact/en.json b/apps/red-ui/src/assets/i18n/redact/en.json index a247f485b..aabf77d85 100644 --- a/apps/red-ui/src/assets/i18n/redact/en.json +++ b/apps/red-ui/src/assets/i18n/redact/en.json @@ -2055,6 +2055,11 @@ "comment": "Comment", "comment-placeholder": "Add remarks or mentions ...", "options": { + "do-not-recommend": { + "description": "Do not recommend \"{value}\" as {type} in any document of the current dossier.", + "extraOptionLabel": "Apply to all dossiers", + "label": "Remove from dossier" + }, "false-positive": { "description": "\"{value}\" is not a {type} in this context: \"{context}\".", "extraOptionLabel": "Apply to all dossiers", @@ -2066,12 +2071,8 @@ "label": "Remove from dossier" }, "only-here": { - "description": "Do not {type} \"{value}\" at this position in the current document.", - "label": "Remove here", - "types": { - "recommend": "recommend", - "redact": "redact" - } + "description": "Do not {type, select, undefined{redact} other{type}} \"{value}\" at this position in the current document.", + "label": "Remove here" } } }, diff --git a/apps/red-ui/src/assets/i18n/scm/de.json b/apps/red-ui/src/assets/i18n/scm/de.json index 3bed22f37..eb48d50fa 100644 --- a/apps/red-ui/src/assets/i18n/scm/de.json +++ b/apps/red-ui/src/assets/i18n/scm/de.json @@ -2055,6 +2055,11 @@ "comment": "", "comment-placeholder": "", "options": { + "do-not-recommend": { + "description": "", + "extraOptionLabel": "", + "label": "" + }, "false-positive": { "description": "", "extraOptionLabel": "", @@ -2067,11 +2072,7 @@ }, "only-here": { "description": "", - "label": "", - "types": { - "recommend": "", - "redact": "" - } + "label": "" } } }, diff --git a/apps/red-ui/src/assets/i18n/scm/en.json b/apps/red-ui/src/assets/i18n/scm/en.json index 9bdf482ce..afab713a2 100644 --- a/apps/red-ui/src/assets/i18n/scm/en.json +++ b/apps/red-ui/src/assets/i18n/scm/en.json @@ -2055,6 +2055,11 @@ "comment": "Comment", "comment-placeholder": "Add remarks or mentions ...", "options": { + "do-not-recommend": { + "description": "", + "extraOptionLabel": "", + "label": "" + }, "false-positive": { "description": "\"{value}\" is not a {type} in this context: \"{context}\".", "extraOptionLabel": "Apply to all dossiers", @@ -2067,11 +2072,7 @@ }, "only-here": { "description": "Do not {type} \"{value}\" at this position in the current document.", - "label": "Remove here", - "types": { - "recommend": "", - "redact": "" - } + "label": "Remove here" } } }, diff --git a/libs/common-ui b/libs/common-ui index fdaf59175..5a4ed98aa 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit fdaf591751c06a5fbeb9f504406cd97c078474e0 +Subproject commit 5a4ed98aafcc92c437022664787677fcccaf04eb