From: Bill Erickson Date: Mon, 18 Mar 2019 14:26:47 +0000 (-0400) Subject: Angular holdings maintenance wip X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=97478456f63d8c96907da318b5fa90082763cb93;p=working%2FEvergreen.git Angular holdings maintenance wip Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/record/holdings.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/record/holdings.component.ts index fa65a52698..804ad04dff 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/record/holdings.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/record/holdings.component.ts @@ -9,6 +9,7 @@ import {AuthService} from '@eg/core/auth.service'; import {PcrudService} from '@eg/core/pcrud.service'; import {GridDataSource} from '@eg/share/grid/grid'; import {GridComponent} from '@eg/share/grid/grid.component'; +import {ServerStoreService} from '@eg/core/server-store.service'; // The holdings grid models a single HoldingsTree, composed of HoldingsTreeNodes @@ -90,6 +91,7 @@ export class HoldingsMaintenanceComponent implements OnInit { private auth: AuthService, private pcrud: PcrudService, private staffCat: StaffCatalogService, + private store: ServerStoreService ) { // Set some sane defaults before settings are loaded. this.showVolumes = true; @@ -126,8 +128,8 @@ export class HoldingsMaintenanceComponent implements OnInit { // TODO XXXX The checkbox toggles will change to @Output handlers // in a pending catalog working branch. this.toggleShowVolumes = (value: boolean) => { - console.log('SHOW VOLS', value); this.showVolumes = value; + this.store.setItem('cat.holdings_show_vols', value); this.holdingsGrid.reload(); } } @@ -143,6 +145,20 @@ export class HoldingsMaintenanceComponent implements OnInit { ngOnInit() { this.initDone = true; + // These are pre-cached via the resolver. + this.store.getItemBatch([ + 'cat.holdings_show_empty_org', + 'cat.holdings_show_empty', + 'cat.holdings_show_copies', + 'cat.holdings_show_vols' + ]).then(settings => { + this.showCopies = settings['cat.holdings_show_copies']; + console.log('show copies = ', this.showCopies); + this.showVolumes = settings['cat.holdings_show_vols']; + this.showEmptyVolumes = settings['cat.holdings_show_empty']; + this.showEmptyLibs = settings['cat.holdings_show_empty_org']; + }); + this.gridDataSource.getRows = (pager: Pager, sort: any[]) => { return this.fetchHoldings(pager); }; 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 7dde4b4635..f4f5d9719b 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 @@ -40,7 +40,14 @@ export class CatalogResolver implements Resolve> { return this.store.getItemBatch([ 'eg.search.search_lib', - 'eg.search.pref_lib' + 'eg.search.pref_lib', + 'cat.holdings_show_empty_org', + 'cat.holdings_show_empty', + 'cat.marcedit.stack_subfields', + 'cat.marcedit.flateditor', + 'eg.cat.record.summary.collapse', + 'cat.holdings_show_copies', + 'cat.holdings_show_vols' ]).then(settings => { this.staffCat.defaultSearchOrg = this.org.get(settings['eg.search.search_lib']);