From: Bill Erickson Date: Tue, 19 Feb 2019 17:57:45 +0000 (-0500) Subject: LP1806087 Catalog holds display WIP (detail page) X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=026bb007c3a1ec33a3a392d383d4b04b7d2eb142;p=working%2FEvergreen.git LP1806087 Catalog holds display WIP (detail page) Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/eg2/src/app/staff/share/holds-grid/hold-detail.component.html b/Open-ILS/src/eg2/src/app/staff/share/holds-grid/hold-detail.component.html new file mode 100644 index 0000000000..1bee0eb9b5 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/share/holds-grid/hold-detail.component.html @@ -0,0 +1,75 @@ + + + + +
+
Request Date
+
{{hold.request_time | formatValue:'timestamp'}}
+
Capture Date
+
{{hold.capture_time | formatValue:'timestamp'}}
+
Available On
+
{{hold.shelf_time | formatValue:'timestamp'}}
+
+
+
hold Type
+
+ {{hold.hold_type}} + +
+
Current Item
+ +
Call Number
+
{{hold.cn_full_label}}
+
+
+
Pickup Lib
+
{{getOrgName(hold.pickup_lib)}}
+
Status
+
+ +
Unknown Error
+
Waiting for Item
+
Waiting for Capture
+
In Transit
+
Ready for Pickup
+
Hold Shelf Delay
+
Canceled
+
Suspended
+
Wrong Shelf
+
Fulfilled
+
+
+
Behind Desk
+
{{hold.behind_desk == '1'}}
+
+ + diff --git a/Open-ILS/src/eg2/src/app/staff/share/holds-grid/hold-detail.component.ts b/Open-ILS/src/eg2/src/app/staff/share/holds-grid/hold-detail.component.ts new file mode 100644 index 0000000000..0bb25a9c69 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/share/holds-grid/hold-detail.component.ts @@ -0,0 +1,61 @@ +import {Component, OnInit, Input, ViewChild} from '@angular/core'; +import {Observable, Observer, of} from 'rxjs'; +import {map, filter} from 'rxjs/operators'; +import {IdlObject} from '@eg/core/idl.service'; +import {NetService} from '@eg/core/net.service'; +import {OrgService} from '@eg/core/org.service'; +import {AuthService} from '@eg/core/auth.service'; +import {ProgressDialogComponent} from '@eg/share/dialog/progress.component'; + +@Component({ + selector: 'eg-hold-detail', + templateUrl: 'hold-detail.component.html' +}) +export class HoldDetailComponent implements OnInit { + + _holdId: number; + @Input() set holdId(id: number) { + this._holdId = id; + if (this.initDone) { + this.fetchHold(); + } + } + + hold: any; // wide hold reference + @Input() set wideHold(wh: any) { + this.hold = wh; + } + + initDone: boolean; + + constructor( + private net: NetService, + private org: OrgService, + private auth: AuthService, + ) {} + + ngOnInit() { + this.initDone = true; + this.fetchHold(); + } + + fetchHold() { + if (!this._holdId) { return; } + + this.net.request( + 'open-ils.circ', + 'open-ils.circ.hold.wide_hash.stream', + this.auth.token(), {id: this._holdId} + ).subscribe(wideHold => { + this.hold = wideHold; + }); + } + + getOrgName(id: number) { + if (id) { + return this.org.get(id).shortname(); + } + } +} + + diff --git a/Open-ILS/src/eg2/src/app/staff/share/holds-grid/holds-grid.component.html b/Open-ILS/src/eg2/src/app/staff/share/holds-grid/holds-grid.component.html index 59867a052c..79d2b015ec 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holds-grid/holds-grid.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/holds-grid/holds-grid.component.html @@ -4,223 +4,230 @@
-
-
-
-
-
Pickup Library
+ + + + + + +
+
+
+
+
Pickup Library
+
+ +
- -
-
- - - - - - - - - - - {{cp_barcode}} - - - - - - - - - - - - - - - - {{hold.title}} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + {{cp_barcode}} + + + + + + + + + + + + + + + + {{hold.title}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/Open-ILS/src/eg2/src/app/staff/share/holds-grid/holds-grid.component.ts b/Open-ILS/src/eg2/src/app/staff/share/holds-grid/holds-grid.component.ts index 1b840e8e7d..d72018f5bf 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holds-grid/holds-grid.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/holds-grid/holds-grid.component.ts @@ -18,16 +18,20 @@ export class HoldsGridComponent implements OnInit { // If either are set/true, the pickup lib selector will display @Input() initialPickupLib: number | IdlObject; + @Input() hidePickupLibFilter: boolean; // How to sort when no sort parameters have been applied // via grid controls. This uses the eg-grid sort format: // [{name: fname, dir: 'asc'}, {name: fname2, dir: 'desc'}] @Input() defaultSort: any[]; + mode: 'list' | 'detail' = 'list'; initDone = false; - pickupLib: IdlObject; holdsCount: number; + pickupLib: IdlObject; gridDataSource: GridDataSource; + detailHold: any; + @ViewChild('holdsGrid') private holdsGrid: GridComponent; @ViewChild('progressDialog') private progressDialog: ProgressDialogComponent; @@ -69,12 +73,21 @@ export class HoldsGridComponent implements OnInit { } } + showDetails: (rows: any[]) => void; + constructor( private net: NetService, private org: OrgService, private auth: AuthService, ) { this.gridDataSource = new GridDataSource(); + + this.showDetails = (rows: any[]) => { + if (rows.length) { + this.mode = 'detail'; + this.detailHold = rows[0]; + } + } } ngOnInit() { @@ -172,6 +185,7 @@ export class HoldsGridComponent implements OnInit { return observable; } + } diff --git a/Open-ILS/src/eg2/src/app/staff/share/holds-grid/holds-grid.module.ts b/Open-ILS/src/eg2/src/app/staff/share/holds-grid/holds-grid.module.ts index 13647291f2..a003f39b51 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holds-grid/holds-grid.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/holds-grid/holds-grid.module.ts @@ -1,10 +1,12 @@ import {NgModule} from '@angular/core'; import {StaffCommonModule} from '@eg/staff/common.module'; import {HoldsGridComponent} from './holds-grid.component'; +import {HoldDetailComponent} from './hold-detail.component'; @NgModule({ declarations: [ - HoldsGridComponent + HoldsGridComponent, + HoldDetailComponent ], imports: [ StaffCommonModule