From: Bill Erickson Date: Wed, 18 Apr 2018 16:41:27 +0000 (-0400) Subject: LP#1626157 more or select repairs X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e935b8f6353a37eeb9608f52784a146821cc0dd3;p=working%2FEvergreen.git LP#1626157 more or select repairs Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts index cb4b587d84..3ab2ceb5ff 100644 --- a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts +++ b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.ts @@ -150,7 +150,7 @@ export class FmRecordEditorComponent } } else if (field.datatype == 'org_unit') { let org = rec[field.name](); - if (org != null && typeof org == 'object') { + if (org && typeof org == 'object') { rec[field.name](org.id()); } } diff --git a/Open-ILS/src/eg2/src/app/share/org-select.component.ts b/Open-ILS/src/eg2/src/app/share/org-select.component.ts index 7ee2ba52e5..627dd4e803 100644 --- a/Open-ILS/src/eg2/src/app/share/org-select.component.ts +++ b/Open-ILS/src/eg2/src/app/share/org-select.component.ts @@ -42,9 +42,9 @@ export class EgOrgSelectComponent implements OnInit { // Apply a default org unit value when none is set. // First tries workstation org unit, then user home org unit. + // An onChange event WILL be generated when a default is applied. @Input() applyDefault: boolean = false; - // List of org unit IDs to exclude from the selector @Input() set hideOrgs(ids: number[]) { if (ids) this.hidden = ids; @@ -99,6 +99,9 @@ export class EgOrgSelectComponent implements OnInit { this.selected = this.formatForDisplay( this.org.get(this.auth.user().ws_ou()) ); + + // avoid notifying mid-digest + setTimeout(() => this.onChange.emit(this.startOrg), 0); } if (this.startOrg) {