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
private auth: AuthService,
private pcrud: PcrudService,
private staffCat: StaffCatalogService,
+ private store: ServerStoreService
) {
// Set some sane defaults before settings are loaded.
this.showVolumes = true;
// 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();
}
}
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);
};
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']);