RED-7762: fixed comment and empty field placeholders.
This commit is contained in:
parent
3497b89fec
commit
60664a56f2
@ -47,7 +47,7 @@
|
||||
<mat-form-field>
|
||||
<mat-select
|
||||
[placeholder]="
|
||||
isBulkEdit || !hideReasonPlaceholder ? ('edit-redaction.dialog.content.unchanged' | translate) : ''
|
||||
isBulkEdit && !hideReasonPlaceholder ? ('edit-redaction.dialog.content.unchanged' | translate) : ''
|
||||
"
|
||||
class="full-width"
|
||||
formControlName="reason"
|
||||
@ -67,7 +67,7 @@
|
||||
<div class="iqser-input-group w-450">
|
||||
<label [translate]="'edit-redaction.dialog.content.legal-basis'"></label>
|
||||
<input
|
||||
[placeholder]="isBulkEdit || !hideReasonPlaceholder ? ('edit-redaction.dialog.content.unchanged' | translate) : ''"
|
||||
[placeholder]="isBulkEdit && !hideReasonPlaceholder ? ('edit-redaction.dialog.content.unchanged' | translate) : ''"
|
||||
[value]="form.controls.reason.value?.legalBasis"
|
||||
disabled
|
||||
type="text"
|
||||
@ -100,11 +100,7 @@
|
||||
<div class="iqser-input-group w-450">
|
||||
<label [translate]="'edit-redaction.dialog.content.comment'"></label>
|
||||
<textarea
|
||||
[placeholder]="
|
||||
!isBulkEdit
|
||||
? ('edit-redaction.dialog.content.comment-placeholder' | translate)
|
||||
: ('edit-redaction.dialog.content.unchanged' | translate)
|
||||
"
|
||||
[placeholder]="'edit-redaction.dialog.content.comment-placeholder' | translate"
|
||||
formControlName="comment"
|
||||
iqserHasScrollbar
|
||||
name="comment"
|
||||
|
||||
@ -83,11 +83,11 @@ export class EditRedactionDialogComponent
|
||||
}
|
||||
|
||||
get hideReasonPlaceholder() {
|
||||
return this.hasTypeChanged && this.isRedactBasedType;
|
||||
return (this.hasTypeChanged && this.isRedactBasedType) || this.#isFieldEmpty('legalBasis');
|
||||
}
|
||||
|
||||
get hideParagraphPlaceholder() {
|
||||
return this.form.controls.section.value !== this.initialFormValue['section'];
|
||||
return this.form.controls.section.value !== this.initialFormValue['section'] || this.#isFieldEmpty('section');
|
||||
}
|
||||
|
||||
get hiddenReason() {
|
||||
@ -184,4 +184,8 @@ export class EditRedactionDialogComponent
|
||||
value: new FormControl<string>(this.allRectangles ? this.data.annotations[0].value : null),
|
||||
});
|
||||
}
|
||||
|
||||
#isFieldEmpty(field: string) {
|
||||
return this.data.annotations.every(annotation => !annotation[field].length);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user