From: Galen Charlton Date: Tue, 20 Apr 2021 21:00:26 +0000 (-0400) Subject: item-location-select: when using permFilter, include locations at ancestors of permit... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a1c572227b69aa988acc0b612518133b35849ea6;p=working%2FEvergreen.git item-location-select: when using permFilter, include locations at ancestors of permitted OUs LH#41 Signed-off-by: Galen Charlton --- 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();