diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html index fee0300fa..683014683 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.html @@ -4,10 +4,27 @@
-
+
+
+ {{ data.manualRedactionEntryWrapper.manualRedactionEntry.value }} + +
+
- {{ format(data.manualRedactionEntryWrapper.manualRedactionEntry.value) }} diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts index 007009825..47cd39ad5 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts @@ -8,7 +8,7 @@ import { JustificationsService } from '@services/entity-services/justifications. import { Dictionary, Dossier, IAddRedactionRequest } from '@red/domain'; import { DossiersService } from '@services/entity-services/dossiers.service'; import { DictionaryService } from '@shared/services/dictionary.service'; -import { BaseDialogComponent } from '@iqser/common-ui'; +import { BaseDialogComponent, CircleButtonTypes } from '@iqser/common-ui'; import { firstValueFrom } from 'rxjs'; export interface LegalBasisOption { @@ -22,9 +22,11 @@ export interface LegalBasisOption { styleUrls: ['./manual-annotation-dialog.component.scss'], }) export class ManualAnnotationDialogComponent extends BaseDialogComponent implements OnInit { + readonly circleButtonTypes = CircleButtonTypes; isDocumentAdmin: boolean; isDictionaryRequest: boolean; isFalsePositiveRequest: boolean; + isEditingSelectedText: boolean = false; possibleDictionaries: Dictionary[] = []; legalOptions: LegalBasisOption[] = []; @@ -66,7 +68,7 @@ export class ManualAnnotationDialogComponent extends BaseDialogComponent impleme } get disabled() { - return this.form.invalid; + return this.form.invalid || this.isEditingSelectedText; } get commentIsMandatory() { @@ -87,6 +89,9 @@ export class ManualAnnotationDialogComponent extends BaseDialogComponent impleme })); this.legalOptions.sort((a, b) => a.label.localeCompare(b.label)); + if (!this.data.manualRedactionEntryWrapper.manualRedactionEntry.rectangle) { + this._formatSelectedTextValue(); + } } save() { @@ -94,12 +99,13 @@ export class ManualAnnotationDialogComponent extends BaseDialogComponent impleme this._dialogRef.close(this.data.manualRedactionEntryWrapper); } - format(value: string) { - return 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', - ); + private _formatSelectedTextValue() { + 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', + ); } private _getForm(): FormGroup { diff --git a/apps/red-ui/src/assets/i18n/de.json b/apps/red-ui/src/assets/i18n/de.json index 744ec25c2..13d247c4f 100644 --- a/apps/red-ui/src/assets/i18n/de.json +++ b/apps/red-ui/src/assets/i18n/de.json @@ -1472,11 +1472,13 @@ "classification": "Wert / Klassifizierung", "comment": "Kommentar", "dictionary": "Wörterbuch", + "edit-selected-text": "", "legalBasis": "Rechtsgrundlage", "reason": "Begründung", "reason-placeholder": "Wählen Sie eine Begründung aus ...", "rectangle": "Benutzerdefinierter Bereich", "section": "Absatz / Ort", + "selected-text": "", "text": "Ausgewählter Text:" }, "header": { diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 165a2dc29..64b9b6b74 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -1472,11 +1472,13 @@ "classification": "Value / Classification", "comment": "Comment", "dictionary": "Dictionary", + "edit-selected-text": "Edit selected text", "legalBasis": "Legal Basis", "reason": "Reason", "reason-placeholder": "Select a reason ...", "rectangle": "Custom Rectangle", "section": "Paragraph / Location", + "selected-text": "Selected text", "text": "Selected text:" }, "header": {