From e8d8531304315a3ab4d63f2f3a2882f2909348a8 Mon Sep 17 00:00:00 2001 From: Nicoleta Panaghiu Date: Tue, 28 Nov 2023 12:28:51 +0200 Subject: [PATCH] RED-7762: changed type display value based on new requirements. --- .../edit-redaction-dialog.component.html | 2 +- .../edit-redaction-dialog.component.ts | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.html b/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.html index b682425b5..de2afe834 100644 --- a/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.html +++ b/apps/red-ui/src/app/modules/file-preview/dialogs/edit-redaction-dialog/edit-redaction-dialog.component.html @@ -43,7 +43,7 @@ -
+
annotation.isRedacted); - } - get allSkipped() { return this.data.annotations.every(annotation => annotation.isSkipped); } + get someSkipped() { + return this.data.annotations.some(annotation => annotation.isSkipped); + } + get redactBasedTypes() { return this._dictionaryService .getRedactTextDictionaries(this.#dossier.dossierTemplateId, !this.#applyToAllDossiers) @@ -166,12 +166,10 @@ export class EditRedactionDialogComponent } #getForm() { - const sameType = - this.data.annotations.every(annotation => annotation.type === this.data.annotations[0].type) && - (this.allRedacted || this.allSkipped); + const sameType = this.data.annotations.every(annotation => annotation.type === this.data.annotations[0].type); const sameSection = this.data.annotations.every(annotation => annotation.section === this.data.annotations[0].section); return new FormGroup({ - reason: new FormControl({ value: null, disabled: this.allSkipped }), + reason: new FormControl({ value: null, disabled: this.someSkipped }), comment: new FormControl(null), type: new FormControl(sameType ? this.data.annotations[0].type : null), section: new FormControl(sameSection ? this.data.annotations[0].section : null),