From: Galen Charlton Date: Tue, 20 Apr 2021 21:00:26 +0000 (-0400) Subject: LP#1904244: item-location-select: include ancestors X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=dad4b5e12cd76a828ecbefa44bed61e65d90697b;p=Evergreen.git LP#1904244: item-location-select: include ancestors Specifically, when using permFilter, include locations at ancestors of permitted OUs. Signed-off-by: Galen Charlton Signed-off-by: Ruth Frasur Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/eg2/src/app/share/item-location-select/item-location-select.component.ts b/Open-ILS/src/eg2/src/app/share/item-location-select/item-location-select.component.ts index 2f41a1080b..ceea201c44 100644 --- a/Open-ILS/src/eg2/src/app/share/item-location-select/item-location-select.component.ts +++ b/Open-ILS/src/eg2/src/app/share/item-location-select/item-location-select.component.ts @@ -157,7 +157,14 @@ export class ItemLocationSelectComponent setFilterOrgs(): Promise { if (this.permFilter) { return this.perm.hasWorkPermAt([this.permFilter], true) - .then(values => this.filterOrgs = values[this.permFilter]); + .then(values => { + this.filterOrgs = values[this.permFilter]; + // then include ancestors + this.filterOrgs.forEach(ou => { + this.org.ancestors(ou, true).forEach(anc => this.filterOrgs.push(anc)); + }); + return this.filterOrgs; + }); } const org = this.contextOrgId || this.auth.user().ws_ou();