From 9d4f120d50093a6b99ae96bcfd316714f094b5de Mon Sep 17 00:00:00 2001 From: Jane Sandberg Date: Mon, 24 Aug 2020 04:56:25 -0700 Subject: [PATCH] LP1891960: Angular patron search org is sticky Also removes some unused dependencies and adds a new org setting to the database: eg.orgselect.patron.search To test: 1) Find a title in the staff catalog. 2) Click Place Hold. 3) Search for a Patron. 4) Notice that the search org is initially your root org (Consortium-level). 5) Select a different value. 6) Leave and come back to this screen. Note that the value you selected remains. 7) Perform a search to make sure that the search is limited to the org you selected. 8) Click the Clear button. Note that the value you selected still remains. 9) Perform anoter search to make sure that the search is limited to the org you selected. Signed-off-by: Jane Sandberg Signed-off-by: Bill Erickson --- .../src/app/staff/share/patron/search.component.html | 3 ++- .../eg2/src/app/staff/share/patron/search.component.ts | 10 ++-------- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 7 +++++++ .../Pg/upgrade/XXXX.data.patron-search-org-select.sql | 17 +++++++++++++++++ 4 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.patron-search-org-select.sql diff --git a/Open-ILS/src/eg2/src/app/staff/share/patron/search.component.html b/Open-ILS/src/eg2/src/app/staff/share/patron/search.component.html index f2e363217e..3636b31a01 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/patron/search.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/patron/search.component.html @@ -123,7 +123,8 @@
diff --git a/Open-ILS/src/eg2/src/app/staff/share/patron/search.component.ts b/Open-ILS/src/eg2/src/app/staff/share/patron/search.component.ts index 43f4fe18db..004f68437c 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/patron/search.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/patron/search.component.ts @@ -2,16 +2,11 @@ import {Component, Input, Output, OnInit, AfterViewInit, EventEmitter, ViewChild, Renderer2} from '@angular/core'; import {Observable, of} from 'rxjs'; import {map} from 'rxjs/operators'; -import {IdlService, IdlObject} from '@eg/core/idl.service'; -import {EventService} from '@eg/core/event.service'; +import {IdlObject} from '@eg/core/idl.service'; import {NetService} from '@eg/core/net.service'; import {AuthService} from '@eg/core/auth.service'; import {OrgService} from '@eg/core/org.service'; -import {PcrudService} from '@eg/core/pcrud.service'; import {ServerStoreService} from '@eg/core/server-store.service'; -import {ToastService} from '@eg/share/toast/toast.service'; -import {StringComponent} from '@eg/share/string/string.component'; -import {ComboboxEntry, ComboboxComponent} from '@eg/share/combobox/combobox.component'; import {GridComponent} from '@eg/share/grid/grid.component'; import {GridDataSource} from '@eg/share/grid/grid'; import {Pager} from '@eg/share/util/pager'; @@ -53,7 +48,7 @@ export class PatronSearchComponent implements OnInit, AfterViewInit { constructor( private renderer: Renderer2, private net: NetService, - private org: OrgService, + public org: OrgService, private auth: AuthService, private store: ServerStoreService ) { @@ -109,7 +104,6 @@ export class PatronSearchComponent implements OnInit, AfterViewInit { clear() { this.search = {profile: null}; - this.searchOrg = this.org.root(); } getRows(pager: Pager, sort: any[]): Observable { diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 19398d4328..36e655d460 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -20447,5 +20447,12 @@ VALUES ( 'Default org unit for catalog holds org unit selector', 'cwst', 'label' ) +), ( + 'eg.orgselect.patron.search', 'gui', 'integer', + oils_i18n_gettext( + 'eg.orgselect.patron.search', + 'Default org unit for patron search', + 'cwst', 'label' + ) ); diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.patron-search-org-select.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.patron-search-org-select.sql new file mode 100644 index 0000000000..2e6e3a95c8 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.patron-search-org-select.sql @@ -0,0 +1,17 @@ +BEGIN; + +SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + +INSERT INTO config.workstation_setting_type (name, grp, datatype, label) +VALUES ( + 'eg.orgselect.patron.search', 'gui', 'integer', + oils_i18n_gettext( + 'eg.orgselect.patron.search', + 'Default org unit for patron search', + 'cwst', 'label' + ) +); + +COMMIT; + + -- 2.11.0