From fe6e22f7c75cbf3cfe4793007704f38828617aa8 Mon Sep 17 00:00:00 2001 From: Dan Briem Date: Mon, 10 May 2021 20:08:42 -0400 Subject: [PATCH] LP#1927527 Catalog: Root OU shelving locations do not display When the top level org unit is selected in the staff catalog you only have the option to search all shelving locations. This allows you to filter on the root org unit's shelving locations, which is the same behavior as the OPAC. To test: 1. Make sure the top level org unit has shelving locations (Local Administration->Shelving Locations Editor) 2. In the staff catalog, select the top level org unit 3. Click the three dot icon next to the query text input 4. The root org unit's shelving location options display Signed-off-by: Dan Briem Signed-off-by: Garry Collum Signed-off-by: Galen Charlton --- .../src/eg2/src/app/share/catalog/catalog.service.ts | 7 ++++++- .../eg2/src/app/staff/catalog/search-form.component.ts | 9 +-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts b/Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts index 36c3ead829..64ff132d94 100644 --- a/Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts +++ b/Open-ILS/src/eg2/src/app/share/catalog/catalog.service.ts @@ -414,7 +414,12 @@ export class CatalogService { } fetchCopyLocations(contextOrg: number | IdlObject): Promise { - const orgIds = this.org.fullPath(contextOrg, true); + const contextOrgId: any = this.org.get(contextOrg).id(); + + const orgIds: any[] = contextOrgId === this.org.root().id() + ? [contextOrgId] + : this.org.fullPath(contextOrg, true); + this.copyLocations = []; return this.pcrud.search('acpl', diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.ts index 4e37e5a269..6b0e37cb88 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.ts @@ -201,14 +201,7 @@ export class SearchFormComponent implements OnInit, AfterViewInit { refreshCopyLocations() { if (!this.showFilters()) { return; } - // TODO: is this how we avoid displaying too many locations? - const org = this.context.searchOrg; - if (org.id() === this.org.root().id()) { - this.copyLocations = []; - return; - } - - this.cat.fetchCopyLocations(org).then(() => + this.cat.fetchCopyLocations(this.context.searchOrg).then(() => this.copyLocations = this.cat.copyLocations ); } -- 2.43.2