From ddfcdf08d276c16805e3fc267653cb593195df36 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Tue, 19 Mar 2019 12:19:35 -0400 Subject: [PATCH] lpxxx Angular holdings maintenance wip Signed-off-by: Bill Erickson --- .../staff/catalog/record/holdings.component.html | 13 +++++++++ .../app/staff/catalog/record/holdings.component.ts | 31 +++++++++------------- .../app/staff/catalog/record/record.component.html | 3 +-- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/record/holdings.component.html b/Open-ILS/src/eg2/src/app/staff/catalog/record/holdings.component.html index bf52735ced..263704cfc9 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/record/holdings.component.html +++ b/Open-ILS/src/eg2/src/app/staff/catalog/record/holdings.component.html @@ -1,5 +1,18 @@ +
+
+
+
+
Holdings Maintenance
+
+ + +
+
+
+ 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 2ced83bbd3..ac675004c4 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 @@ -13,9 +13,9 @@ import {GridComponent} from '@eg/share/grid/grid.component'; import {GridToolbarCheckboxComponent} from '@eg/share/grid/grid-toolbar-checkbox.component'; import {ServerStoreService} from '@eg/core/server-store.service'; import {MarkDamagedDialogComponent -} from '@eg/staff/share/holdings/mark-damaged-dialog.component'; + } from '@eg/staff/share/holdings/mark-damaged-dialog.component'; import {MarkMissingDialogComponent -} from '@eg/staff/share/holdings/mark-missing-dialog.component'; + } from '@eg/staff/share/holdings/mark-missing-dialog.component'; // The holdings grid models a single HoldingsTree, composed of HoldingsTreeNodes @@ -80,7 +80,6 @@ export class HoldingsMaintenanceComponent implements OnInit { @ViewChild('markMissingDialog') private markMissingDialog: MarkMissingDialogComponent; - holdingsTree: HoldingsTree; // nodeType => id => tree node cache @@ -116,17 +115,7 @@ export class HoldingsMaintenanceComponent implements OnInit { return this._recId; } - // Allows the caller to update the context org unit - private _co: IdlObject; - @Input() set contextOrg(org: IdlObject) { - this._co = org; - if (this.initDone) { - this.hardRefresh(); - } - } - get contextOrg(): IdlObject { - return this._co; - } + contextOrg: IdlObject; constructor( private net: NetService, @@ -141,6 +130,9 @@ export class HoldingsMaintenanceComponent implements OnInit { this.refreshHoldings = true; this.renderFromPrefs = true; + // TODO: need a separate setting for this? + this.contextOrg = this.staffCat.searchContext.searchOrg; + this.rowClassCallback = (row: any): string => { if (row.volume && !row.copy) { return 'bg-info'; @@ -175,11 +167,7 @@ export class HoldingsMaintenanceComponent implements OnInit { ngOnInit() { this.initDone = true; - if (!this.contextOrg) { - this.contextOrg = this.org.get(this.auth.user().ws_ou()); - } - - // These are pre-cached via the resolver. + // These are pre-cached via the catalog resolver. const settings = this.store.getItemBatchCached([ 'cat.holdings_show_empty_org', 'cat.holdings_show_empty', @@ -198,6 +186,11 @@ export class HoldingsMaintenanceComponent implements OnInit { }; } + contextOrgChanged(org: IdlObject) { + this.contextOrg = org; + this.hardRefresh(); + } + hardRefresh() { this.renderFromPrefs = true; this.refreshHoldings = true; diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/record/record.component.html b/Open-ILS/src/eg2/src/app/staff/catalog/record/record.component.html index d43a8bbf89..b583cf7e71 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/record/record.component.html +++ b/Open-ILS/src/eg2/src/app/staff/catalog/record/record.component.html @@ -66,8 +66,7 @@ - + -- 2.11.0