RED-7761 - removed reset reason method
This commit is contained in:
parent
86c83311c7
commit
fe83a9c75a
@ -90,8 +90,14 @@ export class EditRedactionDialogComponent
|
|||||||
description: lbm.description,
|
description: lbm.description,
|
||||||
label: lbm.name,
|
label: lbm.name,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const reason = this.legalOptions.find(o => o.legalBasis === this.data.annotations[0].legalBasis);
|
||||||
|
const sameLegalBasis = this.data.annotations.every(annotation => annotation.legalBasis === reason?.legalBasis);
|
||||||
|
this.form.patchValue({
|
||||||
|
reason: sameLegalBasis ? reason : null,
|
||||||
|
});
|
||||||
|
|
||||||
this.legalOptions.sort((a, b) => a.label.localeCompare(b.label));
|
this.legalOptions.sort((a, b) => a.label.localeCompare(b.label));
|
||||||
this.#resetReason();
|
|
||||||
this.initialFormValue = this.form.getRawValue();
|
this.initialFormValue = this.form.getRawValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,14 +128,6 @@ export class EditRedactionDialogComponent
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#resetReason() {
|
|
||||||
const reason = this.legalOptions.find(o => o.legalBasis === this.data.annotations[0].legalBasis);
|
|
||||||
const sameLegalBasis = this.data.annotations.every(annotation => annotation.legalBasis === reason?.legalBasis);
|
|
||||||
this.form.patchValue({
|
|
||||||
reason: sameLegalBasis ? reason : null,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
#setTypes() {
|
#setTypes() {
|
||||||
this.dictionaries = this._dictionaryService.getEditableRedactionTypes(
|
this.dictionaries = this._dictionaryService.getEditableRedactionTypes(
|
||||||
this.#dossier.dossierTemplateId,
|
this.#dossier.dossierTemplateId,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user