From e3e64785234b7c0fac8903989e1a140c5e86297b Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Mon, 3 May 2021 15:21:02 -0700 Subject: [PATCH] LP#1922273: use a setting to determine which advanced search filters are displayed in staff catalog The TPAC allows admins to customize which search filters are available in advanced search. This commit adds an org unit setting, eg.staffcat.search_filters, which lets you customize search filters in the staff catalog. The setting value should be an array of filter types, e.g. ["item_lang","audience","lit_form"]. The standard set of search filters is used when the settings are not set. Signed-off-by: Jeff Davis Signed-off-by: Terran McCanna Signed-off-by: Galen Charlton --- .../eg2/src/app/staff/catalog/catalog.service.ts | 4 ++++ .../eg2/src/app/staff/catalog/resolver.service.ts | 4 ++++ .../app/staff/catalog/search-form.component.html | 14 +++++++------- .../src/app/staff/catalog/search-form.component.ts | 3 +++ Open-ILS/src/sql/Pg/950.data.seed-values.sql | 15 +++++++++++++++ .../upgrade/XXXX.data.staffcat-search-filters.sql | 22 ++++++++++++++++++++++ 6 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.staffcat-search-filters.sql diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/catalog.service.ts b/Open-ILS/src/eg2/src/app/staff/catalog/catalog.service.ts index 04eb852de5..76b75ca830 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/catalog.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/catalog.service.ts @@ -25,6 +25,10 @@ export class StaffCatalogService { // Display the Exclude Electronic checkbox showExcludeElectronic = false; + // Advanced search filters to display + searchFilters: string[]; + + // TODO: does unapi support pref-lib for result-page copy counts? prefOrg: IdlObject; // Default search tab diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/resolver.service.ts b/Open-ILS/src/eg2/src/app/staff/catalog/resolver.service.ts index 11c46ff4c2..6780c2dc8c 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/resolver.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/resolver.service.ts @@ -8,6 +8,7 @@ import {AuthService} from '@eg/core/auth.service'; import {CatalogService} from '@eg/share/catalog/catalog.service'; import {StaffCatalogService} from './catalog.service'; import {BasketService} from '@eg/share/catalog/basket.service'; +import {CATALOG_CCVM_FILTERS} from '@eg/share/catalog/search-context'; @Injectable() @@ -60,6 +61,7 @@ export class CatalogResolver implements Resolve> { 'eg.staff.catalog.results.show_more', 'circ.staff_placed_holds_fallback_to_ws_ou', 'opac.staff.jump_to_details_on_single_hit', + 'eg.staffcat.search_filters' ]).then(settings => { this.staffCat.defaultSearchOrg = this.org.get(settings['eg.search.search_lib']); @@ -76,6 +78,8 @@ export class CatalogResolver implements Resolve> { settings['eg.staffcat.exclude_electronic'] === true; this.staffCat.jumpOnSingleHit = settings['opac.staff.jump_to_details_on_single_hit'] === true; + this.staffCat.searchFilters = + settings['eg.staffcat.search_filters'] || CATALOG_CCVM_FILTERS; }); } } diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.html b/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.html index 0911b8f322..8f3ed840c3 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.html +++ b/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.html @@ -167,7 +167,7 @@
-
+
-
+
-
+
-
+
@@ -214,7 +214,7 @@
-
+
-
+