RED-7762: fixed asterisk and invalid form conditions.

This commit is contained in:
Nicoleta Panaghiu 2023-12-06 12:36:07 +02:00
parent d363da17fc
commit 5c5f2dcc51
2 changed files with 2 additions and 6 deletions

View File

@ -40,7 +40,7 @@
<ng-container *ngIf="showExtras"> <ng-container *ngIf="showExtras">
<ng-container *ngIf="!hiddenReason"> <ng-container *ngIf="!hiddenReason">
<div [class.required]="!someSkipped" class="iqser-input-group w-450"> <div [class.required]="!form.controls.reason.disabled" class="iqser-input-group w-450">
<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

View File

@ -63,14 +63,10 @@ export class EditRedactionDialogComponent
get disabled() { get disabled() {
return ( return (
this.form.invalid || this.form.invalid ||
(!this.isImage && this.showExtras && (!this.allSkipped || this.isRedactBasedType) ? !this.form.controls.reason.value : false) (!this.isImage && this.showExtras && !this.form.controls.reason.disabled ? !this.form.controls.reason.value : false)
); );
} }
get allSkipped() {
return this.data.annotations.every(annotation => annotation.isSkipped);
}
get someSkipped() { get someSkipped() {
return this.data.annotations.some(annotation => annotation.isSkipped); return this.data.annotations.some(annotation => annotation.isSkipped);
} }