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:
commit
718e70f08c
@ -43,7 +43,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ng-container *ngIf="showExtras">
|
<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>
|
<label [translate]="'edit-redaction.dialog.content.reason'"></label>
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
<mat-select
|
<mat-select
|
||||||
|
|||||||
@ -71,14 +71,14 @@ export class EditRedactionDialogComponent
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
get allRedacted() {
|
|
||||||
return this.data.annotations.every(annotation => annotation.isRedacted);
|
|
||||||
}
|
|
||||||
|
|
||||||
get allSkipped() {
|
get allSkipped() {
|
||||||
return this.data.annotations.every(annotation => annotation.isSkipped);
|
return this.data.annotations.every(annotation => annotation.isSkipped);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get someSkipped() {
|
||||||
|
return this.data.annotations.some(annotation => annotation.isSkipped);
|
||||||
|
}
|
||||||
|
|
||||||
get redactBasedTypes() {
|
get redactBasedTypes() {
|
||||||
return this._dictionaryService
|
return this._dictionaryService
|
||||||
.getRedactTextDictionaries(this.#dossier.dossierTemplateId, !this.#applyToAllDossiers)
|
.getRedactTextDictionaries(this.#dossier.dossierTemplateId, !this.#applyToAllDossiers)
|
||||||
@ -166,12 +166,10 @@ export class EditRedactionDialogComponent
|
|||||||
}
|
}
|
||||||
|
|
||||||
#getForm() {
|
#getForm() {
|
||||||
const sameType =
|
const sameType = this.data.annotations.every(annotation => annotation.type === this.data.annotations[0].type);
|
||||||
this.data.annotations.every(annotation => annotation.type === this.data.annotations[0].type) &&
|
|
||||||
(this.allRedacted || this.allSkipped);
|
|
||||||
const sameSection = this.data.annotations.every(annotation => annotation.section === this.data.annotations[0].section);
|
const sameSection = this.data.annotations.every(annotation => annotation.section === this.data.annotations[0].section);
|
||||||
return new FormGroup({
|
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),
|
comment: new FormControl<string>(null),
|
||||||
type: new FormControl<string>(sameType ? this.data.annotations[0].type : null),
|
type: new FormControl<string>(sameType ? this.data.annotations[0].type : null),
|
||||||
section: new FormControl<string>(sameSection ? this.data.annotations[0].section : null),
|
section: new FormControl<string>(sameSection ? this.data.annotations[0].section : null),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user