From: Galen Charlton Date: Mon, 2 Mar 2020 17:30:47 +0000 (-0500) Subject: org-select: allow applyOrg[Id] to clear the org unit X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3ae13ce35e0ab3e4e719a94c72d3587aa748518f;p=working%2FEvergreen.git org-select: allow applyOrg[Id] to clear the org unit Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts b/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts index 16f1cbd753..d1f1ffca75 100644 --- a/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts +++ b/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts @@ -78,9 +78,7 @@ export class OrgSelectComponent implements OnInit { // Modify the selected org unit via data binding. // This WILL result in an onChange event firing. @Input() set applyOrg(org: IdlObject) { - if (org) { - this.selected = this.formatForDisplay(org); - } + this.selected = org ? this.formatForDisplay(org) : null; } permLimitOrgs: number[]; @@ -91,9 +89,7 @@ export class OrgSelectComponent implements OnInit { // Modify the selected org unit by ID via data binding. // This WILL result in an onChange event firing. @Input() set applyOrgId(id: number) { - if (id) { - this.selected = this.formatForDisplay(this.org.get(id)); - } + this.selected = id ? this.formatForDisplay(this.org.get(id)) : null; } // Emitted when the org unit value is changed via the selector.