diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/docu-mine/add-annotation-dialog/add-annotation-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/docu-mine/add-annotation-dialog/add-annotation-dialog.component.html index 4993b949f..b00923b5d 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/docu-mine/add-annotation-dialog/add-annotation-dialog.component.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/docu-mine/add-annotation-dialog/add-annotation-dialog.component.html @@ -5,7 +5,7 @@
- {{ form.get('selectedText').value }} +
diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/docu-mine/add-annotation-dialog/add-annotation-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/docu-mine/add-annotation-dialog/add-annotation-dialog.component.ts index f58b626b4..f2e596777 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/docu-mine/add-annotation-dialog/add-annotation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/docu-mine/add-annotation-dialog/add-annotation-dialog.component.ts @@ -1,10 +1,9 @@ import { Component, inject, OnInit } from '@angular/core'; import { FormBuilder } from '@angular/forms'; -import { IconButtonTypes, IqserDialogComponent, IqserPermissionsService } from '@iqser/common-ui'; +import { IconButtonTypes, IqserDialogComponent } from '@iqser/common-ui'; import { Dictionary, IAddRedactionRequest } from '@red/domain'; import { ActiveDossiersService } from '@services/dossiers/active-dossiers.service'; import { DictionaryService } from '@services/entity-services/dictionary.service'; -import { Roles } from '@users/roles'; import { AddAnnotationData, AddAnnotationResult } from '../../../utils/dialog-types'; @Component({ @@ -15,17 +14,19 @@ export class AddAnnotationDialogComponent implements OnInit { readonly #dossier = inject(ActiveDossiersService).find(this.data.dossierId); - readonly #isRss = inject(IqserPermissionsService).has(Roles.getRss); readonly iconButtonTypes = IconButtonTypes; dictionaries: Dictionary[] = []; readonly form = this.#getForm(); - constructor(private readonly _dictionaryService: DictionaryService, private readonly _formBuilder: FormBuilder) { + constructor( + private readonly _dictionaryService: DictionaryService, + private readonly _formBuilder: FormBuilder, + ) { super(); } get displayedDictionaryLabel() { - const dictType = this.form.get('dictionary').value; + const dictType = this.form.controls.dictionary.value; if (dictType) { return this.dictionaries.find(d => d.type === dictType)?.label ?? null; } @@ -33,7 +34,7 @@ export class AddAnnotationDialogComponent } get disabled() { - return !this.#isRss || !this.form.get('dictionary').value; + return !this.form.controls.dictionary.value; } ngOnInit() { @@ -45,7 +46,7 @@ export class AddAnnotationDialogComponent const redaction = this.data.manualRedactionEntryWrapper.manualRedactionEntry; this.close({ redaction, - dictionary: this.dictionaries.find(d => d.type === this.form.get('dictionary').value), + dictionary: this.dictionaries.find(d => d.type === this.form.controls.dictionary.value), }); } @@ -58,16 +59,16 @@ export class AddAnnotationDialogComponent } #enhanceManualRedaction(addRedactionRequest: IAddRedactionRequest) { - addRedactionRequest.type = this.form.get('dictionary').value; + addRedactionRequest.type = this.form.controls.dictionary.value; const selectedType = this.dictionaries.find(d => d.type === addRedactionRequest.type); addRedactionRequest.addToDictionary = !!selectedType?.hasDictionary; addRedactionRequest.reason ??= 'Dictionary Request'; - const commentValue = this.form.get('comment').value; + const commentValue = this.form.controls.comment.value; addRedactionRequest.comment = commentValue ? { text: commentValue } : null; addRedactionRequest.section = null; - addRedactionRequest.value = this.form.get('selectedText').value; + addRedactionRequest.value = this.form.controls.selectedText.value; addRedactionRequest.addToAllDossiers = addRedactionRequest.addToDictionary || !!this.data.applyToAllDossiers; } } diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts b/apps/red-ui/src/app/modules/file-preview/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts index 829047265..53595cb9b 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts @@ -9,6 +9,7 @@ import { ActiveDossiersService } from '@services/dossiers/active-dossiers.servic import { DictionaryService } from '@services/entity-services/dictionary.service'; import { JustificationsService } from '@services/entity-services/justifications.service'; import { Roles } from '@users/roles'; +import { removeHyphensAndSpecialChars } from '@utils/functions'; import { firstValueFrom } from 'rxjs'; import { ManualRedactionService } from '../../services/manual-redaction.service'; @@ -185,6 +186,7 @@ export class ManualAnnotationDialogComponent extends BaseDialogComponent impleme addRedactionRequest.value = addRedactionRequest.rectangle ? this.form.get('classification').value : this.form.get('selectedText').value; + addRedactionRequest.value = removeHyphensAndSpecialChars(addRedactionRequest.value); } #selectReason() { 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 71f903cf8..048b49c85 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 @@ -14,7 +14,7 @@ >
- +