From 258a304b94bc5bdc63f9ae3e780756e9a9d40fde Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Fri, 15 Sep 2023 13:53:31 +0300 Subject: [PATCH] use \n as line break --- .../add-annotation-dialog.component.html | 2 +- .../add-annotation-dialog.component.ts | 21 ++++++++++--------- .../redact-text-dialog.component.html | 6 +++++- .../redact-text-dialog.component.scss | 4 ---- libs/common-ui | 2 +- 5 files changed, 18 insertions(+), 17 deletions(-) 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..97a163b1a 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/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..150c83ee9 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,11 @@ >
- +