Merge branch 'RED-7762' into 'master'

RED-7762: changed type display value based on new requirements.

See merge request redactmanager/red-ui!205
This commit is contained in:
Valentin-Gabriel Mihai 2023-11-28 11:31:02 +01:00
commit 718e70f08c
2 changed files with 7 additions and 9 deletions

View File

@ -43,7 +43,7 @@
</div>
<ng-container *ngIf="showExtras">
<div class="iqser-input-group required w-450">
<div class="iqser-input-group w-450" [class.required]="!someSkipped">
<label [translate]="'edit-redaction.dialog.content.reason'"></label>
<mat-form-field>
<mat-select

View File

@ -71,14 +71,14 @@ export class EditRedactionDialogComponent
);
}
get allRedacted() {
return this.data.annotations.every(annotation => 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<LegalBasisOption>({ value: null, disabled: this.allSkipped }),
reason: new FormControl<LegalBasisOption>({ value: null, disabled: this.someSkipped }),
comment: new FormControl<string>(null),
type: new FormControl<string>(sameType ? this.data.annotations[0].type : null),
section: new FormControl<string>(sameSection ? this.data.annotations[0].section : null),