From f49c9ea48596bfc9b6ac60be6bbfab3b413f2a0d Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Sat, 22 Jul 2023 23:24:01 +0300 Subject: [PATCH] RED-6774 - split AddHint and RedactText actions in two separate dialogs --- .../annotation-actions.component.ts | 2 +- .../add-hint-dialog.component.html | 65 +++++++ .../add-hint-dialog.component.scss | 8 + .../add-hint-dialog.component.ts | 163 ++++++++++++++++++ .../redact-text-dialog.component.html | 6 +- .../redact-text-dialog.component.ts | 98 ++--------- .../redact-text-dialog/redact-text-options.ts | 6 - ...=> remove-redaction-dialog.component.html} | 0 .../remove-redaction-dialog.component.ts | 87 +--------- .../remove-redaction-options.ts | 7 - .../file-preview-screen.component.ts | 44 +++-- .../file-preview/file-preview.module.ts | 2 + .../services/annotation-actions.service.ts | 13 +- .../pdf-annotation-actions.service.ts | 2 +- .../services/pdf-proxy.service.ts | 11 +- .../file-preview/utils/dialog-options.ts | 103 +++++++++++ .../file-preview/utils/dialog-types.ts | 39 +++++ .../entity-services/dictionary.service.ts | 36 ++++ .../app/translations/add-hint-translations.ts | 14 ++ .../translations/redact-text-translations.ts | 31 +--- .../remove-redaction-translations.ts | 6 +- apps/red-ui/src/assets/i18n/redact/de.json | 65 +++---- apps/red-ui/src/assets/i18n/redact/en.json | 65 +++---- apps/red-ui/src/assets/i18n/scm/de.json | 65 +++---- apps/red-ui/src/assets/i18n/scm/en.json | 65 +++---- 25 files changed, 660 insertions(+), 343 deletions(-) create mode 100644 apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.html create mode 100644 apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.scss create mode 100644 apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.ts delete mode 100644 apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-options.ts rename apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/{remove-redaction-dialog.html => remove-redaction-dialog.component.html} (100%) delete mode 100644 apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-options.ts create mode 100644 apps/red-ui/src/app/modules/file-preview/utils/dialog-options.ts create mode 100644 apps/red-ui/src/app/modules/file-preview/utils/dialog-types.ts create mode 100644 apps/red-ui/src/app/translations/add-hint-translations.ts diff --git a/apps/red-ui/src/app/modules/file-preview/components/annotation-actions/annotation-actions.component.ts b/apps/red-ui/src/app/modules/file-preview/components/annotation-actions/annotation-actions.component.ts index 7300fb5a7..a426b09bd 100644 --- a/apps/red-ui/src/app/modules/file-preview/components/annotation-actions/annotation-actions.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/components/annotation-actions/annotation-actions.component.ts @@ -75,7 +75,7 @@ export class AnnotationActionsComponent implements OnChanges { } removeOrSuggestRemoveRedaction() { - this.annotationActionsService.removeOrSuggestRemoveRedaction(this.annotations[0], this.annotationPermissions); + this.annotationActionsService.removeRedaction(this.annotations[0], this.annotationPermissions); } acceptRecommendation() { diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.html new file mode 100644 index 000000000..b51e471cb --- /dev/null +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.html @@ -0,0 +1,65 @@ +
+
+
+ +
+
+ + {{ form.get('selectedText').value }} +
+ + + + +
+ + + + + {{ displayedDictionaryLabel }} + + {{ dictionary.label }} + + + +
+
+ +
+ + +
+
+ +
+ + + +
+
+
+ + +
diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.scss b/apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.scss new file mode 100644 index 000000000..0bc0b2eb8 --- /dev/null +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.scss @@ -0,0 +1,8 @@ +label { + font-weight: bold; + padding-bottom: 8px; +} + +iqser-details-radio { + padding-top: 20px; +} diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.ts new file mode 100644 index 000000000..a6135d5da --- /dev/null +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/add-hint-dialog/add-hint-dialog.component.ts @@ -0,0 +1,163 @@ +import { Component, OnInit } from '@angular/core'; +import { DetailsRadioOption, IconButtonTypes, IqserPermissionsService } from '@iqser/common-ui'; +import { Dictionary, Dossier, IAddRedactionRequest, SuperTypes } from '@red/domain'; +import { FormBuilder, UntypedFormGroup } from '@angular/forms'; +import { Roles } from '@users/roles'; +import { JustificationsService } from '@services/entity-services/justifications.service'; +import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service'; +import { DictionaryService } from '@services/entity-services/dictionary.service'; +import { tap } from 'rxjs/operators'; +import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { IqserDialogComponent } from '@common-ui/dialog/iqser-dialog-component.directive'; +import { RedactOrHintData, RedactOrHintResult } from '../../utils/dialog-types'; +import { getRedactOrHintOptions, RedactOrHintOption, RedactOrHintOptions } from '../../utils/dialog-options'; + +@Component({ + templateUrl: './add-hint-dialog.component.html', + styleUrls: ['./add-hint-dialog.component.scss'], +}) +export class AddHintDialogComponent + extends IqserDialogComponent + implements OnInit +{ + readonly roles = Roles; + readonly iconButtonTypes = IconButtonTypes; + readonly options: DetailsRadioOption[]; + dictionaryRequest = false; + dictionaries: Dictionary[] = []; + form!: UntypedFormGroup; + + #manualRedactionTypeExists = true; + #applyToAllDossiers: boolean; + + readonly #dossier: Dossier; + readonly #isRss = this._iqserPermissionsService.has(Roles.getRss); + + constructor( + private readonly _justificationsService: JustificationsService, + private readonly _activeDossiersService: ActiveDossiersService, + private readonly _dictionaryService: DictionaryService, + private readonly _iqserPermissionsService: IqserPermissionsService, + private readonly _formBuilder: FormBuilder, + ) { + super(); + this.#dossier = _activeDossiersService.find(this.data.dossierId); + this.#applyToAllDossiers = this.data.applyToAllDossiers ?? true; + this.#manualRedactionTypeExists = this._dictionaryService.hasManualType(this.#dossier.dossierTemplateId); + this.options = getRedactOrHintOptions(this.#dossier, this.#isRss, true, this.#applyToAllDossiers, this.data.isApprover); + + this.form = this.#getForm(); + + this.form + .get('option') + .valueChanges.pipe( + tap((option: DetailsRadioOption) => { + this.dictionaryRequest = option.value === RedactOrHintOptions.IN_DOSSIER; + this.#setDictionaries(); + this.#resetValues(); + }), + takeUntilDestroyed(), + ) + .subscribe(); + } + + get displayedDictionaryLabel() { + const dictType = this.form.get('dictionary').value; + if (dictType) { + return this.dictionaries.find(d => d.type === dictType)?.label ?? null; + } + return null; + } + + get disabled() { + if (this.dictionaryRequest || this.#isRss) { + return !this.form.get('dictionary').value; + } + return false; + } + + async ngOnInit(): Promise { + this.#setDictionaries(); + this.#resetValues(); + } + + extraOptionChanged(option: DetailsRadioOption): void { + this.#applyToAllDossiers = option.extraOption.checked; + + this.#setDictionaries(); + if (this.#applyToAllDossiers && this.form.get('dictionary').value) { + const selectedDictionaryLabel = this.form.get('dictionary').value; + const selectedDictionary = this.dictionaries.find(d => d.type === selectedDictionaryLabel); + if (!selectedDictionary) { + this.form.get('dictionary').setValue(null); + } + } + } + + typeChanged() { + if (!this.#applyToAllDossiers) { + const selectedDictionaryType = this.form.get('dictionary').value; + const selectedDictionary = this.dictionaries.find(d => d.type === selectedDictionaryType); + this.options[1].extraOption.disabled = selectedDictionary.dossierDictionaryOnly; + } + } + + save(): void { + this.#enhanceManualRedaction(this.data.manualRedactionEntryWrapper.manualRedactionEntry); + const redaction = this.data.manualRedactionEntryWrapper.manualRedactionEntry; + this.dialogRef.close({ + redaction, + dictionary: this.dictionaries.find(d => d.type === this.form.get('dictionary').value), + }); + } + + #setDictionaries() { + this.dictionaries = this._dictionaryService.getAddHintDictionaries( + this.#dossier.dossierTemplateId, + !this.#applyToAllDossiers, + this.dictionaryRequest, + ); + } + + #getForm(): UntypedFormGroup { + return this._formBuilder.group({ + selectedText: this.data?.manualRedactionEntryWrapper?.manualRedactionEntry?.value, + reason: [null], + comment: [null], + dictionary: [this.#manualRedactionTypeExists ? SuperTypes.ManualRedaction : null], + classification: ['non-readable content'], + section: [null], + option: [this.options[0]], + }); + } + + #enhanceManualRedaction(addRedactionRequest: IAddRedactionRequest) { + addRedactionRequest.reason = 'Dictionary Request'; + addRedactionRequest.type = this.form.get('dictionary').value; + addRedactionRequest.section = this.form.get('section').value; + addRedactionRequest.value = this.form.get('selectedText').value; + + const selectedType = this.dictionaries.find(d => d.type === addRedactionRequest.type); + if (selectedType) { + addRedactionRequest.addToDictionary = selectedType.hasDictionary; + } else { + addRedactionRequest.addToDictionary = this.dictionaryRequest && addRedactionRequest.type !== 'dossier_redaction'; + } + + const commentValue = this.form.get('comment').value; + addRedactionRequest.comment = commentValue ? { text: commentValue } : null; + addRedactionRequest.addToAllDossiers = this.data.isApprover && this.dictionaryRequest && this.#applyToAllDossiers; + } + + #resetValues() { + this.#applyToAllDossiers = this.data.applyToAllDossiers ?? true; + if (!this.#isRss) { + this.options[1].extraOption.checked = this.#applyToAllDossiers; + } + if (this.dictionaryRequest) { + this.form.get('dictionary').setValue(null); + return; + } + this.form.get('dictionary').setValue(this.#manualRedactionTypeExists ? SuperTypes.ManualRedaction : null); + } +} diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.html index 7c145d43e..5c4700cd9 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.html @@ -1,6 +1,6 @@
-
+
@@ -14,7 +14,7 @@ formControlName="option" > - +
@@ -41,7 +41,7 @@
- +
diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.ts index fdb1e990a..e103a4e17 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-dialog.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { DetailsRadioOption, IconButtonTypes, IqserPermissionsService } from '@iqser/common-ui'; -import { Dictionary, Dossier, File, IAddRedactionRequest, IManualRedactionEntry, SuperTypes } from '@red/domain'; +import { Dictionary, Dossier, IAddRedactionRequest, SuperTypes } from '@red/domain'; import { FormBuilder, UntypedFormGroup } from '@angular/forms'; import { Roles } from '@users/roles'; import { firstValueFrom } from 'rxjs'; @@ -8,44 +8,23 @@ import { JustificationsService } from '@services/entity-services/justifications. import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service'; import { LegalBasisOption } from '../manual-redaction-dialog/manual-annotation-dialog.component'; import { DictionaryService } from '@services/entity-services/dictionary.service'; - -import { ManualRedactionEntryType, ManualRedactionEntryWrapper } from '@models/file/manual-redaction-entry.wrapper'; -import { redactTextTranslations } from '@translations/redact-text-translations'; -import { RedactTextOption, RedactTextOptions } from './redact-text-options'; import { tap } from 'rxjs/operators'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; -import { IqserDialogComponent } from '../../../../../../../../libs/common-ui/src/lib/dialog/iqser-dialog-component.directive'; - -const PIN_ICON = 'red:push-pin'; -const FOLDER_ICON = 'red:folder'; - -interface RedactTextData { - manualRedactionEntryWrapper: ManualRedactionEntryWrapper; - dossierId: string; - file: File; - applyToAllDossiers: boolean; - isApprover: boolean; - hint: boolean; -} - -interface DialogResult { - redaction: IManualRedactionEntry; - dictionary: Dictionary; - applyToAllDossiers: boolean | null; -} +import { IqserDialogComponent } from '@common-ui/dialog/iqser-dialog-component.directive'; +import { getRedactOrHintOptions, RedactOrHintOption, RedactOrHintOptions } from '../../utils/dialog-options'; +import { RedactOrHintData, RedactOrHintResult } from '../../utils/dialog-types'; @Component({ templateUrl: './redact-text-dialog.component.html', styleUrls: ['./redact-text-dialog.component.scss'], }) export class RedactTextDialogComponent - extends IqserDialogComponent + extends IqserDialogComponent implements OnInit { readonly roles = Roles; readonly iconButtonTypes = IconButtonTypes; - readonly options: DetailsRadioOption[]; - readonly type: ManualRedactionEntryType; + readonly options: DetailsRadioOption[]; dictionaryRequest = false; legalOptions: LegalBasisOption[] = []; dictionaries: Dictionary[] = []; @@ -54,10 +33,8 @@ export class RedactTextDialogComponent #manualRedactionTypeExists = true; #applyToAllDossiers: boolean; - readonly #translations = redactTextTranslations; readonly #dossier: Dossier; readonly #isRss = this._iqserPermissionsService.has(Roles.getRss); - readonly hint: boolean; constructor( private readonly _justificationsService: JustificationsService, @@ -68,19 +45,17 @@ export class RedactTextDialogComponent ) { super(); this.#dossier = _activeDossiersService.find(this.data.dossierId); - this.type = this.data.manualRedactionEntryWrapper.type; - this.hint = this.data.hint; this.#applyToAllDossiers = this.data.applyToAllDossiers ?? true; this.#manualRedactionTypeExists = this._dictionaryService.hasManualType(this.#dossier.dossierTemplateId); - this.options = this.#options(); + this.options = getRedactOrHintOptions(this.#dossier, this.#isRss, false, this.#applyToAllDossiers, this.data.isApprover); this.form = this.#getForm(); this.form .get('option') .valueChanges.pipe( - tap((option: DetailsRadioOption) => { - this.dictionaryRequest = option.value === RedactTextOptions.IN_DOSSIER; + tap((option: DetailsRadioOption) => { + this.dictionaryRequest = option.value === RedactOrHintOptions.IN_DOSSIER; this.#setDictionaries(); this.#resetValues(); }), @@ -98,7 +73,7 @@ export class RedactTextDialogComponent } get disabled() { - if (this.dictionaryRequest || this.hint || this.#isRss) { + if (this.dictionaryRequest || this.#isRss) { return !this.form.get('dictionary').value; } return !this.form.get('reason').value; @@ -115,11 +90,10 @@ export class RedactTextDialogComponent this.legalOptions.sort((a, b) => a.label.localeCompare(b.label)); this.#selectReason(); - this.#formatSelectedTextValue(); this.#resetValues(); } - extraOptionChanged(option: DetailsRadioOption): void { + extraOptionChanged(option: DetailsRadioOption): void { this.#applyToAllDossiers = option.extraOption.checked; this.#setDictionaries(); @@ -150,9 +124,8 @@ export class RedactTextDialogComponent } #setDictionaries() { - this.dictionaries = this._dictionaryService.getPossibleDictionaries( + this.dictionaries = this._dictionaryService.getRedactTextDictionaries( this.#dossier.dossierTemplateId, - this.hint, !this.#applyToAllDossiers, this.dictionaryRequest, ); @@ -164,21 +137,11 @@ export class RedactTextDialogComponent reason: [null], comment: [null], dictionary: [this.#manualRedactionTypeExists ? SuperTypes.ManualRedaction : null], - classification: ['non-readable content'], section: [null], option: [this.options[0]], }); } - #formatSelectedTextValue(): void { - this.data.manualRedactionEntryWrapper.manualRedactionEntry.value = - this.data.manualRedactionEntryWrapper.manualRedactionEntry.value.replace( - // eslint-disable-next-line no-control-regex,max-len - /([^\s\d-]{2,})[-\u00AD]\u000D\u000A|[\u000A\u000B\u000C\u000D\u0085\u2028\u2029]/gi, - '$1', - ); - } - #selectReason() { if (this.legalOptions.length === 1) { this.form.get('reason').setValue(this.legalOptions[0]); @@ -186,8 +149,11 @@ export class RedactTextDialogComponent } #enhanceManualRedaction(addRedactionRequest: IAddRedactionRequest) { - const legalOption: LegalBasisOption = this.form.get('reason').value; addRedactionRequest.type = this.form.get('dictionary').value; + addRedactionRequest.section = this.form.get('section').value; + addRedactionRequest.value = this.form.get('selectedText').value; + + const legalOption: LegalBasisOption = this.form.get('reason').value; if (legalOption) { addRedactionRequest.reason = legalOption.description; addRedactionRequest.legalBasis = legalOption.legalBasis; @@ -206,45 +172,15 @@ export class RedactTextDialogComponent } const commentValue = this.form.get('comment').value; addRedactionRequest.comment = commentValue ? { text: commentValue } : null; - addRedactionRequest.section = this.form.get('section').value; - addRedactionRequest.value = addRedactionRequest.rectangle - ? this.form.get('classification').value - : this.form.get('selectedText').value; addRedactionRequest.addToAllDossiers = this.data.isApprover && this.dictionaryRequest && this.#applyToAllDossiers; } - #options() { - const options: DetailsRadioOption[] = [ - { - label: this.#translations[this.type].onlyHere.label, - description: this.#translations[this.type].onlyHere.description, - icon: PIN_ICON, - value: RedactTextOptions.ONLY_HERE, - }, - ]; - if (!this.#isRss) { - options.push({ - label: this.#translations[this.type].inDossier.label, - description: this.#translations[this.type].inDossier.description, - descriptionParams: { dossierName: this.#dossier.dossierName }, - icon: FOLDER_ICON, - value: RedactTextOptions.IN_DOSSIER, - extraOption: { - label: this.#translations[this.type].inDossier.extraOptionLabel, - checked: this.data.applyToAllDossiers ?? true, - hidden: !this.data.isApprover, - }, - }); - } - return options; - } - #resetValues() { this.#applyToAllDossiers = this.data.applyToAllDossiers ?? true; if (!this.#isRss) { this.options[1].extraOption.checked = this.#applyToAllDossiers; } - if (this.dictionaryRequest || this.hint) { + if (this.dictionaryRequest) { this.form.get('reason').setValue(null); this.form.get('dictionary').setValue(null); return; diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-options.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-options.ts deleted file mode 100644 index 05a42de28..000000000 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/redact-text-dialog/redact-text-options.ts +++ /dev/null @@ -1,6 +0,0 @@ -export const RedactTextOptions = { - ONLY_HERE: 'ONLY_HERE', - IN_DOSSIER: 'IN_DOSSIER', -} as const; - -export type RedactTextOption = keyof typeof RedactTextOptions; diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.html b/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.html similarity index 100% rename from apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.html rename to apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.html diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.ts index 4c133e169..da89aaad9 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-dialog.component.ts @@ -1,43 +1,15 @@ import { Component } from '@angular/core'; import { DetailsRadioOption, IconButtonTypes } from '@iqser/common-ui'; -import { RemoveRedactionOption, RemoveRedactionOptions } from './remove-redaction-options'; import { FormBuilder, UntypedFormGroup } from '@angular/forms'; -import { removeRedactionTranslations } from '@translations/remove-redaction-translations'; -import { AnnotationWrapper } from '@models/file/annotation.wrapper'; -import { Dossier } from '@red/domain'; -import { IqserDialogComponent } from '../../../../../../../../libs/common-ui/src/lib/dialog/iqser-dialog-component.directive'; +import { IqserDialogComponent } from '@common-ui/dialog/iqser-dialog-component.directive'; import { PermissionsService } from '@services/permissions.service'; import { tap } from 'rxjs/operators'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; -import { RedactTextOption } from '../redact-text-dialog/redact-text-options'; - -const PIN_ICON = 'red:push-pin'; -const FOLDER_ICON = 'red:folder'; -const REMOVE_FROM_DICT_ICON = 'red:remove-from-dict'; - -export interface RemoveRedactionPermissions { - canRemoveOnlyHere: boolean; - canRemoveFromDictionary: boolean; - canMarkAsFalsePositive: boolean; -} - -export interface RemoveRedactionData { - redaction: AnnotationWrapper; - dossier: Dossier; - falsePositiveContext: string; - permissions: RemoveRedactionPermissions; - applyToAllDossiers: boolean; - isApprover: boolean; -} - -export interface RemoveRedactionResult { - comment: string; - option: DetailsRadioOption; - applyToAllDossiers: boolean | null; -} +import { RemoveRedactionData, RemoveRedactionResult } from '../../utils/dialog-types'; +import { getRemoveRedactionOptions, RemoveRedactionOption } from '../../utils/dialog-options'; @Component({ - templateUrl: './remove-redaction-dialog.html', + templateUrl: './remove-redaction-dialog.component.html', styleUrls: ['./remove-redaction-dialog.component.scss'], }) export class RemoveRedactionDialogComponent extends IqserDialogComponent< @@ -51,17 +23,12 @@ export class RemoveRedactionDialogComponent extends IqserDialogComponent< form!: UntypedFormGroup; hint: boolean; - readonly #redaction: AnnotationWrapper; - readonly #permissions: RemoveRedactionPermissions; - readonly #translations = removeRedactionTranslations; #applyToAllDossiers: boolean; constructor(private readonly _formBuilder: FormBuilder, private readonly _permissionsService: PermissionsService) { super(); - this.#redaction = this.data.redaction; - this.hint = this.#redaction.hint; - this.#permissions = this.data.permissions; - this.options = this.#options(); + this.hint = this.data.redaction.hint; + this.options = getRemoveRedactionOptions(this.data); this.form = this.#getForm(); this.#applyToAllDossiers = this.data.applyToAllDossiers ?? true; @@ -90,46 +57,4 @@ export class RemoveRedactionDialogComponent extends IqserDialogComponent< option: [this.options[0]], }); } - - #options() { - const options: DetailsRadioOption[] = []; - if (this.#permissions.canRemoveOnlyHere) { - options.push({ - label: this.#translations.ONLY_HERE.label, - description: this.#translations.ONLY_HERE.description, - descriptionParams: { type: this.hint ? 'hint' : 'redact', value: this.#redaction.value }, - icon: PIN_ICON, - value: RemoveRedactionOptions.ONLY_HERE, - }); - } - if (this.#permissions.canRemoveFromDictionary) { - options.push({ - label: this.#translations.IN_DOSSIER.label, - description: this.#translations.IN_DOSSIER.description, - descriptionParams: { type: this.hint ? 'hint' : 'redact', value: this.#redaction.value }, - icon: FOLDER_ICON, - value: RemoveRedactionOptions.IN_DOSSIER, - extraOption: { - label: this.#translations.IN_DOSSIER.extraOptionLabel, - checked: this.data.applyToAllDossiers ?? true, - hidden: !this.data.isApprover, - }, - }); - } - if (this.#permissions.canMarkAsFalsePositive) { - options.push({ - label: this.#translations.FALSE_POSITIVE.label, - description: this.#translations.FALSE_POSITIVE.description, - descriptionParams: { value: this.#redaction.value, type: this.#redaction.type, context: this.data.falsePositiveContext }, - icon: REMOVE_FROM_DICT_ICON, - value: RemoveRedactionOptions.FALSE_POSITIVE, - extraOption: { - label: this.#translations.FALSE_POSITIVE.extraOptionLabel, - checked: this.data.applyToAllDossiers ?? true, - hidden: !this.data.isApprover, - }, - }); - } - return options; - } } diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-options.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-options.ts deleted file mode 100644 index 56a0bde4e..000000000 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-options.ts +++ /dev/null @@ -1,7 +0,0 @@ -export const RemoveRedactionOptions = { - ONLY_HERE: 'ONLY_HERE', - IN_DOSSIER: 'IN_DOSSIER', - FALSE_POSITIVE: 'FALSE_POSITIVE', -} as const; - -export type RemoveRedactionOption = keyof typeof RemoveRedactionOptions; diff --git a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts index 64844499f..838eeaa2b 100644 --- a/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/file-preview-screen.component.ts @@ -19,6 +19,7 @@ import { ConfirmOptions, CustomError, ErrorService, + getConfig, HelpModeService, IConfirmationDialogData, IqserDialog, @@ -71,6 +72,8 @@ import { DossierTemplatesService } from '@services/dossier-templates/dossier-tem import { copyLocalStorageFiltersValues, FilterService, NestedFilter, processFilters } from '@iqser/common-ui/lib/filtering'; import { AutoUnsubscribe, Bind, bool, Debounce, List, OnAttach, OnDetach } from '@iqser/common-ui/lib/utils'; import { TenantsService } from '@iqser/common-ui/lib/tenants'; +import { AddHintDialogComponent } from './dialogs/add-hint-dialog/add-hint-dialog.component'; +import { RedactOrHintData } from './utils/dialog-types'; const textActions = [TextPopups.REDACT_TEXT, TextPopups.ADD_HINT, TextPopups.ADD_FALSE_POSITIVE]; @@ -95,6 +98,7 @@ export class FilePreviewScreenComponent readonly fileId = this.state.fileId; readonly dossierId = this.state.dossierId; readonly lastAssignee = computed(() => this.getLastAssignee()); + readonly #isDocumine; width: number; constructor( @@ -169,6 +173,7 @@ export class FilePreviewScreenComponent this._stampService.stampPDF().then(); } }); + this.#isDocumine = getConfig().IS_DOCUMINE; } get changed() { @@ -365,20 +370,12 @@ export class FilePreviewScreenComponent async openRedactTextDialog(manualRedactionEntryWrapper: ManualRedactionEntryWrapper) { const file = this.state.file(); - const dossierTemplate = this._dossierTemplatesService.find(this.state.dossierTemplateId); - const isApprover = this.permissionsService.isApprover(this.state.dossier()); - const applyDictionaryUpdatesToAllDossiersByDefault = dossierTemplate.applyDictionaryUpdatesToAllDossiersByDefault; const hint = manualRedactionEntryWrapper.type === ManualRedactionEntryTypes.HINT; - const ref = this._iqserDialog.openDefault(RedactTextDialogComponent, { - data: { - manualRedactionEntryWrapper, - dossierId: this.dossierId, - file, - applyToAllDossiers: isApprover ? applyDictionaryUpdatesToAllDossiersByDefault : false, - isApprover, - hint, - }, - }); + + const data = this.#getRedactTextDialogData(manualRedactionEntryWrapper, file); + const ref = hint + ? this._iqserDialog.openDefault(AddHintDialogComponent, { data: data as RedactOrHintData }) + : this._iqserDialog.openDefault(RedactTextDialogComponent, { data: data as RedactOrHintData }); const result = await ref.result(); if (!result) { @@ -852,4 +849,25 @@ export class FilePreviewScreenComponent this.openRSSView(); } } + + #getRedactTextDialogData(manualRedactionEntryWrapper: ManualRedactionEntryWrapper, file: File) { + const dossierTemplate = this._dossierTemplatesService.find(this.state.dossierTemplateId); + + const data = { + manualRedactionEntryWrapper, + dossierId: this.dossierId, + file, + }; + if (this.#isDocumine) { + return data; + } + + const isApprover = this.permissionsService.isApprover(this.state.dossier()); + const applyDictionaryUpdatesToAllDossiersByDefault = dossierTemplate.applyDictionaryUpdatesToAllDossiersByDefault; + return { + ...data, + applyToAllDossiers: isApprover ? applyDictionaryUpdatesToAllDossiersByDefault : false, + isApprover, + }; + } } diff --git a/apps/red-ui/src/app/modules/file-preview/file-preview.module.ts b/apps/red-ui/src/app/modules/file-preview/file-preview.module.ts index 82cbd9fb1..508e2c0f0 100644 --- a/apps/red-ui/src/app/modules/file-preview/file-preview.module.ts +++ b/apps/red-ui/src/app/modules/file-preview/file-preview.module.ts @@ -66,6 +66,7 @@ import { IqserUsersModule } from '@iqser/common-ui/lib/users'; import { IqserFiltersModule } from '@iqser/common-ui/lib/filtering'; import { StatusBarComponent } from '@iqser/common-ui/lib/shared'; import { TenantPipe } from '@iqser/common-ui/lib/tenants'; +import { AddHintDialogComponent } from './dialogs/add-hint-dialog/add-hint-dialog.component'; const routes: IqserRoutes = [ { @@ -88,6 +89,7 @@ const dialogs = [ ImportRedactionsDialogComponent, RssDialogComponent, RedactTextDialogComponent, + AddHintDialogComponent, RemoveRedactionDialogComponent, ]; 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 ee381b2cf..c11f728b5 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 @@ -29,16 +29,13 @@ import { PdfViewer } from '../../pdf-viewer/services/pdf-viewer.service'; import { REDAnnotationManager } from '../../pdf-viewer/services/annotation-manager.service'; import { SkippedService } from './skipped.service'; import { REDDocumentViewer } from '../../pdf-viewer/services/document-viewer.service'; -import { - RemoveRedactionDialogComponent, - RemoveRedactionPermissions, - RemoveRedactionResult, -} from '../dialogs/remove-redaction-dialog/remove-redaction-dialog.component'; -import { RemoveRedactionOptions } from '../dialogs/remove-redaction-dialog/remove-redaction-options'; -import { IqserDialog } from '../../../../../../../libs/common-ui/src/lib/dialog/iqser-dialog.service'; +import { RemoveRedactionDialogComponent } from '../dialogs/remove-redaction-dialog/remove-redaction-dialog.component'; +import { IqserDialog } from '@common-ui/dialog/iqser-dialog.service'; import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service'; import { isJustOne, List } from '@iqser/common-ui/lib/utils'; import { PermissionsService } from '@services/permissions.service'; +import { RemoveRedactionPermissions, RemoveRedactionResult } from '../utils/dialog-types'; +import { RemoveRedactionOptions } from '../utils/dialog-options'; @Injectable() export class AnnotationActionsService { @@ -121,7 +118,7 @@ export class AnnotationActionsService { ); } - async removeOrSuggestRemoveRedaction(redaction: AnnotationWrapper, permissions) { + async removeRedaction(redaction: AnnotationWrapper, permissions) { const removePermissions: RemoveRedactionPermissions = { canRemoveOnlyHere: permissions.canRemoveOnlyHere, canRemoveFromDictionary: permissions.canRemoveFromDictionary, diff --git a/apps/red-ui/src/app/modules/file-preview/services/pdf-annotation-actions.service.ts b/apps/red-ui/src/app/modules/file-preview/services/pdf-annotation-actions.service.ts index fe2ee792d..1a2082fc2 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/pdf-annotation-actions.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/pdf-annotation-actions.service.ts @@ -86,7 +86,7 @@ export class PdfAnnotationActionsService { if (permissions.canRemoveRedaction) { const removeRedactionButton = this.#getButton('trash', _('annotation-actions.remove-annotation.remove-redaction'), () => - this.#annotationActionsService.removeOrSuggestRemoveRedaction(annotations[0], permissions), + this.#annotationActionsService.removeRedaction(annotations[0], permissions), ); availableActions.push(removeRedactionButton); } diff --git a/apps/red-ui/src/app/modules/file-preview/services/pdf-proxy.service.ts b/apps/red-ui/src/app/modules/file-preview/services/pdf-proxy.service.ts index 2d15c7a65..4acbe0a7b 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/pdf-proxy.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/pdf-proxy.service.ts @@ -262,11 +262,20 @@ export class PdfProxyService { } } - entry.value = text; + entry.value = this.#formatSelectedText(text); entry.rectangle = !text; return entry; } + #formatSelectedText(text: string): string { + text = text.replace( + // eslint-disable-next-line no-control-regex,max-len + /([^\s\d-]{2,})[-\u00AD]\u000D\u000A|[\u000A\u000B\u000C\u000D\u0085\u2028\u2029]/gi, + '$1', + ); + return text; + } + #deactivateMultiSelect() { this._logger.info('[PDF] Deactivating multi-select'); this._multiSelectService.deactivate(); 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 new file mode 100644 index 000000000..7b7980053 --- /dev/null +++ b/apps/red-ui/src/app/modules/file-preview/utils/dialog-options.ts @@ -0,0 +1,103 @@ +import { DetailsRadioOption } from '@iqser/common-ui'; +import { addHintTranslations } from '@translations/add-hint-translations'; +import { redactTextTranslations } from '@translations/redact-text-translations'; +import { Dossier } from '@red/domain'; +import { removeRedactionTranslations } from '@translations/remove-redaction-translations'; +import { RemoveRedactionData } from './dialog-types'; + +const PIN_ICON = 'red:push-pin'; +const FOLDER_ICON = 'red:folder'; +const REMOVE_FROM_DICT_ICON = 'red:remove-from-dict'; + +export const RedactOrHintOptions = { + ONLY_HERE: 'ONLY_HERE', + IN_DOSSIER: 'IN_DOSSIER', +} as const; + +export type RedactOrHintOption = keyof typeof RedactOrHintOptions; + +export const RemoveRedactionOptions = { + ONLY_HERE: 'ONLY_HERE', + IN_DOSSIER: 'IN_DOSSIER', + FALSE_POSITIVE: 'FALSE_POSITIVE', +} as const; + +export type RemoveRedactionOption = keyof typeof RemoveRedactionOptions; + +export const getRedactOrHintOptions = ( + dossier: Dossier, + isRss: boolean, + hint: boolean, + applyToAllDossiers: boolean, + isApprover: boolean, +): DetailsRadioOption[] => { + const translations = hint ? addHintTranslations : redactTextTranslations; + const options: DetailsRadioOption[] = [ + { + label: translations.onlyHere.label, + description: translations.onlyHere.description, + icon: PIN_ICON, + value: RedactOrHintOptions.ONLY_HERE, + }, + ]; + if (!isRss) { + options.push({ + label: translations.inDossier.label, + description: translations.inDossier.description, + descriptionParams: { dossierName: dossier.dossierName }, + icon: FOLDER_ICON, + value: RedactOrHintOptions.IN_DOSSIER, + extraOption: { + label: translations.inDossier.extraOptionLabel, + checked: applyToAllDossiers, + hidden: !isApprover, + }, + }); + } + return options; +}; + +export const getRemoveRedactionOptions = (data: RemoveRedactionData): DetailsRadioOption[] => { + const translations = removeRedactionTranslations; + const { permissions, redaction, applyToAllDossiers, isApprover, falsePositiveContext } = data; + + const options: DetailsRadioOption[] = []; + if (permissions.canRemoveOnlyHere) { + options.push({ + label: translations.ONLY_HERE.label, + description: translations.ONLY_HERE.description, + descriptionParams: { type: redaction.hint ? 'hint' : 'redact', value: redaction.value }, + icon: PIN_ICON, + value: RemoveRedactionOptions.ONLY_HERE, + }); + } + if (permissions.canRemoveFromDictionary) { + options.push({ + label: translations.IN_DOSSIER.label, + description: translations.IN_DOSSIER.description, + descriptionParams: { type: redaction.hint ? 'hint' : 'redact', value: redaction.value }, + icon: FOLDER_ICON, + value: RemoveRedactionOptions.IN_DOSSIER, + extraOption: { + label: translations.IN_DOSSIER.extraOptionLabel, + checked: applyToAllDossiers ?? true, + hidden: !isApprover, + }, + }); + } + 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: { + label: translations.FALSE_POSITIVE.extraOptionLabel, + checked: applyToAllDossiers ?? true, + hidden: !isApprover, + }, + }); + } + return options; +}; diff --git a/apps/red-ui/src/app/modules/file-preview/utils/dialog-types.ts b/apps/red-ui/src/app/modules/file-preview/utils/dialog-types.ts new file mode 100644 index 000000000..7423a8716 --- /dev/null +++ b/apps/red-ui/src/app/modules/file-preview/utils/dialog-types.ts @@ -0,0 +1,39 @@ +import { ManualRedactionEntryWrapper } from '@models/file/manual-redaction-entry.wrapper'; +import { Dictionary, Dossier, File, IManualRedactionEntry } from '@red/domain'; +import { AnnotationWrapper } from '@models/file/annotation.wrapper'; +import { DetailsRadioOption } from '@iqser/common-ui'; +import { RemoveRedactionOption } from './dialog-options'; + +export interface RedactOrHintData { + manualRedactionEntryWrapper: ManualRedactionEntryWrapper; + dossierId: string; + file: File; + applyToAllDossiers: boolean; + isApprover: boolean; +} + +export interface RedactOrHintResult { + redaction: IManualRedactionEntry; + dictionary: Dictionary; +} + +export interface RemoveRedactionPermissions { + canRemoveOnlyHere: boolean; + canRemoveFromDictionary: boolean; + canMarkAsFalsePositive: boolean; +} + +export interface RemoveRedactionData { + redaction: AnnotationWrapper; + dossier: Dossier; + falsePositiveContext: string; + permissions: RemoveRedactionPermissions; + applyToAllDossiers: boolean; + isApprover: boolean; +} + +export interface RemoveRedactionResult { + comment: string; + option: DetailsRadioOption; + applyToAllDossiers: boolean | null; +} diff --git a/apps/red-ui/src/app/services/entity-services/dictionary.service.ts b/apps/red-ui/src/app/services/entity-services/dictionary.service.ts index 6402c0485..32e33795f 100644 --- a/apps/red-ui/src/app/services/entity-services/dictionary.service.ts +++ b/apps/red-ui/src/app/services/entity-services/dictionary.service.ts @@ -147,6 +147,42 @@ export class DictionaryService extends EntitiesService return !!this._dictionariesMapService.get(dossierTemplateId).find(e => e.type === SuperTypes.ManualRedaction && !e.virtual); } + getRedactTextDictionaries(dossierTemplateId: string, dossierDictionaryOnly: boolean, dictionaryRequest: boolean): Dictionary[] { + const dictionaries: Dictionary[] = []; + + this._dictionariesMapService.get(dossierTemplateId).forEach((d: Dictionary) => { + if ( + (!d.virtual && !d.hint && !d.systemManaged && d.hasDictionary && d.addToDictionaryAction) || + (dossierDictionaryOnly && d.dossierDictionaryOnly) + ) { + dictionaries.push(d); + } + }); + + return dictionaries.sort((a, b) => a.label.localeCompare(b.label)); + } + + getAddHintDictionaries(dossierTemplateId: string, dossierDictionaryOnly: boolean, dictionaryRequest: boolean): Dictionary[] { + const dictionaries: Dictionary[] = []; + + this._dictionariesMapService.get(dossierTemplateId).forEach((d: Dictionary) => { + if ( + (d.hint && d.hasDictionary && d.addToDictionaryAction && d.type) || + (dictionaryRequest && dossierDictionaryOnly && d.dossierDictionaryOnly) + ) { + if (!dictionaryRequest) { + if (!IMAGE_TYPES.includes(d.type)) { + dictionaries.push(d); + } + } else { + dictionaries.push(d); + } + } + }); + + return dictionaries.sort((a, b) => a.label.localeCompare(b.label)); + } + getPossibleDictionaries( dossierTemplateId: string, hintTypes: boolean, diff --git a/apps/red-ui/src/app/translations/add-hint-translations.ts b/apps/red-ui/src/app/translations/add-hint-translations.ts new file mode 100644 index 000000000..4ed66d469 --- /dev/null +++ b/apps/red-ui/src/app/translations/add-hint-translations.ts @@ -0,0 +1,14 @@ +import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; +import { RedactOrHintOption } from '@translations/redact-text-translations'; + +export const addHintTranslations: Record<'onlyHere' | 'inDossier', RedactOrHintOption> = { + onlyHere: { + label: _('add-hint.dialog.content.options.only-here.label'), + description: _('add-hint.dialog.content.options.only-here.description'), + }, + inDossier: { + label: _('add-hint.dialog.content.options.in-dossier.label'), + description: _('add-hint.dialog.content.options.in-dossier.description'), + extraOptionLabel: _('add-hint.dialog.content.options.in-dossier.extraOptionLabel'), + }, +} as const; 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 966406528..cae038523 100644 --- a/apps/red-ui/src/app/translations/redact-text-translations.ts +++ b/apps/red-ui/src/app/translations/redact-text-translations.ts @@ -1,32 +1,19 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; -interface Option { +export interface RedactOrHintOption { label: string; description: string; extraOptionLabel?: string; } -export const redactTextTranslations: Record<'REDACT' | 'HINT', Record<'onlyHere' | 'inDossier', Option>> = { - REDACT: { - onlyHere: { - label: _('redact-text.dialog.content.options.redact.only-here.label'), - description: _('redact-text.dialog.content.options.redact.only-here.description'), - }, - inDossier: { - label: _('redact-text.dialog.content.options.redact.in-dossier.label'), - description: _('redact-text.dialog.content.options.redact.in-dossier.description'), - extraOptionLabel: _('redact-text.dialog.content.options.redact.in-dossier.extraOptionLabel'), - }, +export const redactTextTranslations: Record<'onlyHere' | 'inDossier', RedactOrHintOption> = { + onlyHere: { + label: _('redact-text.dialog.content.options.only-here.label'), + description: _('redact-text.dialog.content.options.only-here.description'), }, - HINT: { - onlyHere: { - label: _('redact-text.dialog.content.options.hint.only-here.label'), - description: _('redact-text.dialog.content.options.hint.only-here.description'), - }, - inDossier: { - label: _('redact-text.dialog.content.options.hint.in-dossier.label'), - description: _('redact-text.dialog.content.options.hint.in-dossier.description'), - extraOptionLabel: _('redact-text.dialog.content.options.hint.in-dossier.extraOptionLabel'), - }, + inDossier: { + label: _('redact-text.dialog.content.options.in-dossier.label'), + description: _('redact-text.dialog.content.options.in-dossier.description'), + extraOptionLabel: _('redact-text.dialog.content.options.in-dossier.extraOptionLabel'), }, } as const; 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 93d939562..53a88f21b 100644 --- a/apps/red-ui/src/app/translations/remove-redaction-translations.ts +++ b/apps/red-ui/src/app/translations/remove-redaction-translations.ts @@ -1,5 +1,5 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; -import { RemoveRedactionOption } from '../modules/file-preview/dialogs/remove-redaction-dialog/remove-redaction-options'; +import { RemoveRedactionOption } from '../modules/file-preview/utils/dialog-options'; interface Option { label: string; @@ -15,11 +15,11 @@ export const removeRedactionTranslations: { [key in RemoveRedactionOption]: Opti IN_DOSSIER: { label: _('remove-redaction.dialog.content.options.in-dossier.label'), description: _('remove-redaction.dialog.content.options.in-dossier.description'), - extraOptionLabel: _('remove-redaction.dialog.content.options.redact.in-dossier.extraOptionLabel'), + extraOptionLabel: _('remove-redaction.dialog.content.options.in-dossier.extraOptionLabel'), }, FALSE_POSITIVE: { label: _('remove-redaction.dialog.content.options.false-positive.label'), description: _('remove-redaction.dialog.content.options.false-positive.description'), - extraOptionLabel: _('remove-redaction.dialog.content.options.redact.false-positive.extraOptionLabel'), + extraOptionLabel: _('remove-redaction.dialog.content.options.false-positive.extraOptionLabel'), }, }; diff --git a/apps/red-ui/src/assets/i18n/redact/de.json b/apps/red-ui/src/assets/i18n/redact/de.json index 7c8549c24..59672f7ec 100644 --- a/apps/red-ui/src/assets/i18n/redact/de.json +++ b/apps/red-ui/src/assets/i18n/redact/de.json @@ -181,6 +181,33 @@ "save": "Wörterbuch speichern", "title": "Wörterbuch erstellen" }, + "add-hint": { + "dialog": { + "actions": { + "cancel": "", + "save": "" + }, + "content": { + "comment": "", + "comment-placeholder": "", + "options": { + "in-dossier": { + "description": "", + "extraOptionLabel": "", + "label": "" + }, + "only-here": { + "description": "", + "label": "" + } + }, + "selected-text": "", + "type": "", + "type-placeholder": "" + }, + "title": "" + } + }, "admin-side-nav": { "audit": "", "configurations": "", @@ -1916,27 +1943,14 @@ "comment-placeholder": "", "legal-basis": "", "options": { - "hint": { - "in-dossier": { - "description": "", - "extraOptionLabel": "", - "label": "" - }, - "only-here": { - "description": "", - "label": "" - } + "in-dossier": { + "description": "", + "extraOptionLabel": "", + "label": "" }, - "redact": { - "in-dossier": { - "description": "", - "extraOptionLabel": "", - "label": "" - }, - "only-here": { - "description": "", - "label": "" - } + "only-here": { + "description": "", + "label": "" } }, "reason": "", @@ -1945,7 +1959,6 @@ "type": "", "type-placeholder": "" }, - "hint-title": "", "title": "" } }, @@ -1963,23 +1976,17 @@ "options": { "false-positive": { "description": "", + "extraOptionLabel": "", "label": "" }, "in-dossier": { "description": "", + "extraOptionLabel": "", "label": "" }, "only-here": { "description": "", "label": "" - }, - "redact": { - "false-positive": { - "extraOptionLabel": "" - }, - "in-dossier": { - "extraOptionLabel": "" - } } } }, diff --git a/apps/red-ui/src/assets/i18n/redact/en.json b/apps/red-ui/src/assets/i18n/redact/en.json index 5ad6ae7d5..bb452bc83 100644 --- a/apps/red-ui/src/assets/i18n/redact/en.json +++ b/apps/red-ui/src/assets/i18n/redact/en.json @@ -181,6 +181,33 @@ "save": "Save Entity", "title": "Create Entity" }, + "add-hint": { + "dialog": { + "actions": { + "cancel": "Cancel", + "save": "Save" + }, + "content": { + "comment": "Comment", + "comment-placeholder": "Add remarks or mentions ...", + "options": { + "in-dossier": { + "description": "Add hint in every document in {dossierName}.", + "extraOptionLabel": "Apply to all dossiers", + "label": "Add hint in dossier" + }, + "only-here": { + "description": "Add hint only at this position in this document.", + "label": "Add hint only here" + } + }, + "selected-text": "Selected text:", + "type": "Type", + "type-placeholder": "Select type ..." + }, + "title": "Add hint" + } + }, "admin-side-nav": { "audit": "Audit", "configurations": "Configurations", @@ -1916,27 +1943,14 @@ "comment-placeholder": "Add remarks or mentions ...", "legal-basis": "Legal Basis", "options": { - "hint": { - "in-dossier": { - "description": "Add hint in every document in {dossierName}.", - "extraOptionLabel": "Apply to all dossiers", - "label": "Add hint in dossier" - }, - "only-here": { - "description": "Add hint only at this position in this document.", - "label": "Add hint only here" - } + "in-dossier": { + "description": "Add redaction in every document in {dossierName}.", + "extraOptionLabel": "Apply to all dossiers", + "label": "Redact in dossier" }, - "redact": { - "in-dossier": { - "description": "Add redaction in every document in {dossierName}.", - "extraOptionLabel": "Apply to all dossiers", - "label": "Redact in dossier" - }, - "only-here": { - "description": "Add redaction only at this position in this document.", - "label": "Redact only here" - } + "only-here": { + "description": "Add redaction only at this position in this document.", + "label": "Redact only here" } }, "reason": "Reason", @@ -1945,7 +1959,6 @@ "type": "Type", "type-placeholder": "Select type ..." }, - "hint-title": "Add Hint", "title": "Redact text" } }, @@ -1963,23 +1976,17 @@ "options": { "false-positive": { "description": "\"{value}\" is not a {type} in this context: \"{context}\".", + "extraOptionLabel": "Apply to all dossiers", "label": "False positive" }, "in-dossier": { "description": "Do not {type} \"{value}\" in any document of the current dossier.", + "extraOptionLabel": "Apply to all dossiers", "label": "Remove from dossier" }, "only-here": { "description": "Do not {type} \"{value}\" at this position in the current document.", "label": "Remove here" - }, - "redact": { - "false-positive": { - "extraOptionLabel": "Apply to all dossiers" - }, - "in-dossier": { - "extraOptionLabel": "Apply to all dossiers" - } } } }, diff --git a/apps/red-ui/src/assets/i18n/scm/de.json b/apps/red-ui/src/assets/i18n/scm/de.json index 26c56448b..5fdee6d83 100644 --- a/apps/red-ui/src/assets/i18n/scm/de.json +++ b/apps/red-ui/src/assets/i18n/scm/de.json @@ -181,6 +181,33 @@ "save": "Wörterbuch speichern", "title": "Wörterbuch erstellen" }, + "add-hint": { + "dialog": { + "actions": { + "cancel": "", + "save": "" + }, + "content": { + "comment": "", + "comment-placeholder": "", + "options": { + "in-dossier": { + "description": "", + "extraOptionLabel": "", + "label": "" + }, + "only-here": { + "description": "", + "label": "" + } + }, + "selected-text": "", + "type": "", + "type-placeholder": "" + }, + "title": "" + } + }, "admin-side-nav": { "audit": "", "configurations": "", @@ -1916,27 +1943,14 @@ "comment-placeholder": "", "legal-basis": "", "options": { - "hint": { - "in-dossier": { - "description": "", - "extraOptionLabel": "", - "label": "" - }, - "only-here": { - "description": "", - "label": "" - } + "in-dossier": { + "description": "", + "extraOptionLabel": "", + "label": "" }, - "redact": { - "in-dossier": { - "description": "", - "extraOptionLabel": "", - "label": "" - }, - "only-here": { - "description": "", - "label": "" - } + "only-here": { + "description": "", + "label": "" } }, "reason": "", @@ -1945,7 +1959,6 @@ "type": "", "type-placeholder": "" }, - "hint-title": "", "title": "" } }, @@ -1963,23 +1976,17 @@ "options": { "false-positive": { "description": "", + "extraOptionLabel": "", "label": "" }, "in-dossier": { "description": "", + "extraOptionLabel": "", "label": "" }, "only-here": { "description": "", "label": "" - }, - "redact": { - "false-positive": { - "extraOptionLabel": "" - }, - "in-dossier": { - "extraOptionLabel": "" - } } } }, diff --git a/apps/red-ui/src/assets/i18n/scm/en.json b/apps/red-ui/src/assets/i18n/scm/en.json index f382a2b4e..291a00631 100644 --- a/apps/red-ui/src/assets/i18n/scm/en.json +++ b/apps/red-ui/src/assets/i18n/scm/en.json @@ -181,6 +181,33 @@ "save": "Save Entity", "title": "Create Entity" }, + "add-hint": { + "dialog": { + "actions": { + "cancel": "Cancel", + "save": "Save" + }, + "content": { + "comment": "Comment", + "comment-placeholder": "Add remarks or mentions ...", + "options": { + "in-dossier": { + "description": "Add hint in every document in {dossierName}.", + "extraOptionLabel": "Apply to all dossiers", + "label": "Add hint in dossier" + }, + "only-here": { + "description": "Add hint only at this position in this document.", + "label": "Add hint only here" + } + }, + "selected-text": "Selected text:", + "type": "Type", + "type-placeholder": "Select type ..." + }, + "title": "Add hint" + } + }, "admin-side-nav": { "audit": "Audit", "configurations": "Configurations", @@ -1916,27 +1943,14 @@ "comment-placeholder": "Add remarks or mentions ...", "legal-basis": "Legal Basis", "options": { - "hint": { - "in-dossier": { - "description": "Add hint in every document in {dossierName}.", - "extraOptionLabel": "Apply to all dossiers", - "label": "Add hint in dossier" - }, - "only-here": { - "description": "Add hint only at this position in this document.", - "label": "Add hint only here" - } + "in-dossier": { + "description": "Add redaction in every document in {dossierName}.", + "extraOptionLabel": "Apply to all dossiers", + "label": "Redact in dossier" }, - "redact": { - "in-dossier": { - "description": "Add redaction in every document in {dossierName}.", - "extraOptionLabel": "Apply to all dossiers", - "label": "Redact in dossier" - }, - "only-here": { - "description": "Add redaction only at this position in this document.", - "label": "Redact only here" - } + "only-here": { + "description": "Add redaction only at this position in this document.", + "label": "Redact only here" } }, "reason": "Reason", @@ -1945,7 +1959,6 @@ "type": "Type", "type-placeholder": "Select type ..." }, - "hint-title": "Add Hint", "title": "Redact text" } }, @@ -1963,23 +1976,17 @@ "options": { "false-positive": { "description": "\"{value}\" is not a {type} in this context: \"{context}\".", + "extraOptionLabel": "Apply to all dossiers", "label": "False positive" }, "in-dossier": { "description": "Do not {type} \"{value}\" in any document of the current dossier.", + "extraOptionLabel": "Apply to all dossiers", "label": "Remove from dossier" }, "only-here": { "description": "Do not {type} \"{value}\" at this position in the current document.", "label": "Remove here" - }, - "redact": { - "false-positive": { - "extraOptionLabel": "Apply to all dossiers" - }, - "in-dossier": { - "extraOptionLabel": "Apply to all dossiers" - } } } },