Merge branch 'VM/RED-7761' into 'master'

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

Closes RED-7761

See merge request redactmanager/red-ui!231
This commit is contained in:
Dan Percic 2023-12-14 17:54:16 +01:00
commit 2d9efbeeb6

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,15 @@ 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) {
setTimeout(() => {
this.form.controls.reason.setValue(this.initialFormValue.reason);
});
}
} else {
this.form.controls.reason.disable();
}