From dad4b5e12cd76a828ecbefa44bed61e65d90697b Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 20 Apr 2021 17:00:26 -0400 Subject: [PATCH] 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 --- .../share/item-location-select/item-location-select.component.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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(); -- 2.11.0