LP#1850547: eg-org-select: allow applyOrg[Id] to clear the org unit
authorGalen Charlton <gmc@equinoxinitiative.org>
Mon, 2 Mar 2020 17:30:47 +0000 (12:30 -0500)
committerBill Erickson <berickxx@gmail.com>
Thu, 3 Sep 2020 15:51:56 +0000 (11:51 -0400)
Sponsored-by: Evergreen Community Development Initiative
Sponsored-by: Georgia Public Library Service
Sponsored-by: Indiana State Library
Sponsored-by: C/W MARS
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Tiffany Little <tlittle@georgialibraries.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts

index a800ab0..1a11435 100644 (file)
@@ -97,17 +97,13 @@ export class OrgSelectComponent implements OnInit {
     // Modify the selected org unit via data binding.
     // This WILL NOT 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;
     }
 
     // Modify the selected org unit by ID via data binding.
     // This WILL NOT 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;
     }
 
     // Limit org unit display to those where the logged in user