RED-7761 - Missing fields in Edit Dialog for Signature (redacted images)

This commit is contained in:
Valentin Mihai 2023-12-12 23:00:12 +02:00
parent 549f791d3c
commit 73408135be

View File

@ -33,6 +33,7 @@ export class EditRedactionDialogComponent
dictionaries: Dictionary[] = [];
readonly form = this.#getForm();
hasTypeChanged = false;
initialReasonDisabled = this.someSkipped;
constructor(
private readonly _justificationsService: JustificationsService,
@ -120,9 +121,13 @@ export class EditRedactionDialogComponent
const selectedDictionaryType = this.form.controls.type.value;
this.#setOptions(selectedDictionaryType);
if (this.redactBasedTypes.includes(selectedDictionaryType)) {
const initialReason = this.form.get('type').value === this.initialFormValue.type && !this.initialReasonDisabled;
if (this.redactBasedTypes.includes(selectedDictionaryType) || initialReason) {
this.form.controls.reason.enable();
this.hasTypeChanged = true;
if (initialReason) {
this.form.controls.reason.setValue(this.initialFormValue.reason);
}
} else {
this.form.controls.reason.disable();
}