Angular holdings maintenance wip
authorBill Erickson <berickxx@gmail.com>
Mon, 18 Mar 2019 14:26:47 +0000 (10:26 -0400)
committerBill Erickson <berickxx@gmail.com>
Mon, 18 Mar 2019 14:28:42 +0000 (10:28 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/staff/catalog/record/holdings.component.ts
Open-ILS/src/eg2/src/app/staff/catalog/resolver.service.ts

index fa65a52..804ad04 100644 (file)
@@ -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);
         };
index 7dde4b4..f4f5d97 100644 (file)
@@ -40,7 +40,14 @@ export class CatalogResolver implements Resolve<Promise<any[]>> {
 
         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']);