Fixed changed fn in edit dossier template; update common-ui
This commit is contained in:
parent
efb58166be
commit
b6b8763a55
@ -71,27 +71,26 @@ export class AddEditDossierTemplateDialogComponent implements OnInit {
|
||||
}
|
||||
|
||||
for (const key of Object.keys(this.dossierTemplateForm.getRawValue())) {
|
||||
const formValue = this.dossierTemplateForm.get(key).value;
|
||||
const objectValue = this.dossierTemplate[key];
|
||||
if (key === 'validFrom') {
|
||||
if (this.hasValidFrom !== !!this.dossierTemplate.validFrom) {
|
||||
return true;
|
||||
}
|
||||
if (
|
||||
this.hasValidFrom &&
|
||||
!moment(this.dossierTemplate.validFrom).isSame(moment(this.dossierTemplateForm.get('validFrom').value))
|
||||
) {
|
||||
if (this.hasValidFrom !== !!objectValue || (this.hasValidFrom && !moment(objectValue).isSame(moment(formValue)))) {
|
||||
return true;
|
||||
}
|
||||
} else if (key === 'validTo') {
|
||||
if (this.hasValidTo !== !!this.dossierTemplate.validTo) {
|
||||
if (this.hasValidTo !== !!objectValue || (this.hasValidTo && !moment(objectValue).isSame(moment(formValue)))) {
|
||||
return true;
|
||||
}
|
||||
if (
|
||||
this.hasValidTo &&
|
||||
!moment(this.dossierTemplate.validTo).isSame(moment(this.dossierTemplateForm.get('validTo').value))
|
||||
) {
|
||||
} else if (formValue instanceof Array) {
|
||||
if (objectValue.length !== formValue.length) {
|
||||
return true;
|
||||
}
|
||||
} else if (this.dossierTemplate[key] !== this.dossierTemplateForm.get(key).value) {
|
||||
for (const item of objectValue) {
|
||||
if (!formValue.includes(item)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else if (objectValue !== formValue) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit 1afafe0e28239da365d9f1e663763b210b9a9b6f
|
||||
Subproject commit 7029f2942d154e7910bb55ec7f7d44e9986f1abc
|
||||
Loading…
x
Reference in New Issue
Block a user