From 3de863edd924c0ed54c728c49cffe78cf8a0e1b5 Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Fri, 7 Jun 2019 10:30:53 -0400 Subject: [PATCH] lp1811710: minor tweaks to the eg2 holds grid column label fixes and let some actions work with multiple rows fix for item barcode link prevent certain actions from spawning broken interfaces disable Title Hold Transfer if non-title holds are selected render hold status return the sms carrier name instead of the id in the wide_holds API (we may want to back this one out and do it differently) show time component for timestamp columns fixed live summaries for various hold actions intended for large batches remove mvr.* from eg2 holds grid; not doing anything Signed-off-by: Jason Etheridge Signed-off-by: Galen Charlton Signed-off-by: Terran McCanna Signed-off-by: Chris Sharp --- .../holdings/mark-missing-dialog.component.ts | 9 ++- .../staff/share/holds/cancel-dialog.component.ts | 3 + .../src/app/staff/share/holds/grid.component.html | 69 +++++++++++++--------- .../src/app/staff/share/holds/grid.component.ts | 26 +++++--- .../staff/share/holds/retarget-dialog.component.ts | 2 + .../staff/share/holds/transfer-dialog.component.ts | 2 + .../Application/Storage/Publisher/action.pm | 3 +- 7 files changed, 77 insertions(+), 37 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/share/holdings/mark-missing-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/share/holdings/mark-missing-dialog.component.ts index f68d31fd3a..079298e948 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holdings/mark-missing-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/holdings/mark-missing-dialog.component.ts @@ -1,10 +1,11 @@ import {Component, OnInit, Input, ViewChild} from '@angular/core'; +import {Observable, throwError} from 'rxjs'; import {NetService} from '@eg/core/net.service'; import {EventService} from '@eg/core/event.service'; import {ToastService} from '@eg/share/toast/toast.service'; import {AuthService} from '@eg/core/auth.service'; import {DialogComponent} from '@eg/share/dialog/dialog.component'; -import {NgbModal} from '@ng-bootstrap/ng-bootstrap'; +import {NgbModal, NgbModalOptions} from '@ng-bootstrap/ng-bootstrap'; import {StringComponent} from '@eg/share/string/string.component'; @@ -42,6 +43,12 @@ export class MarkMissingDialogComponent ngOnInit() {} + open(args: NgbModalOptions): Observable { + this.numSucceeded = 0; + this.numFailed = 0; + return super.open(args); + } + async markOneItemMissing(ids: number[]): Promise { if (ids.length === 0) { return Promise.resolve(); diff --git a/Open-ILS/src/eg2/src/app/staff/share/holds/cancel-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/share/holds/cancel-dialog.component.ts index 23200810e3..2d6d790292 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holds/cancel-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/holds/cancel-dialog.component.ts @@ -51,6 +51,9 @@ export class HoldCancelDialogComponent open(args: NgbModalOptions): Observable { + this.numSucceeded = 0; + this.numFailed = 0; + if (this.cancelReasons.length === 0) { this.pcrud.retrieveAll('ahrcc', {}, {atomic: true}).toPromise() .then(reasons => { diff --git a/Open-ILS/src/eg2/src/app/staff/share/holds/grid.component.html b/Open-ILS/src/eg2/src/app/staff/share/holds/grid.component.html index 850f097f27..ded8dcd90c 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holds/grid.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/holds/grid.component.html @@ -9,6 +9,21 @@ + + +
Unknown Error
+
Waiting for Item
+
Waiting for Capture
+
In Transit
+
Ready for Pickup
+
Hold Shelf Delay
+
Canceled
+
Suspended
+
Wrong Shelf
+
Fulfilled
+
+
+
@@ -61,6 +76,7 @@ @@ -121,12 +137,11 @@ - + path='request_time' datatype="timestamp" [datePlusTime]="true"> + datatype="timestamp" [datePlusTime]="true"> + datatype="timestamp" [datePlusTime]="true"> @@ -141,7 +156,7 @@ [hidden]="true"> - + @@ -157,14 +172,13 @@ - - - - - - - - + + + + + + + @@ -181,14 +195,13 @@ - + - + - - + @@ -199,14 +212,14 @@ - - + + - + @@ -229,8 +242,8 @@ - - + + @@ -238,16 +251,16 @@ - + - - + + - + - + @@ -266,7 +279,7 @@ - + diff --git a/Open-ILS/src/eg2/src/app/staff/share/holds/grid.component.ts b/Open-ILS/src/eg2/src/app/staff/share/holds/grid.component.ts index 5828243bcf..c2e5b104ce 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holds/grid.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/holds/grid.component.ts @@ -330,6 +330,16 @@ export class HoldsGridComponent implements OnInit { return found; } + nonTitleHoldsSelected(rows: IdlObject[]) { + var found = false; + rows.forEach( row => { + if (row.hold_type != 'T') { + found = true; + } + }); + return found; + } + showDetails(rows: any[]) { this.showDetail(rows[0]); } @@ -360,19 +370,21 @@ export class HoldsGridComponent implements OnInit { showRecentCircs(rows: any[]) { - if (rows.length) { + const copyIds = Array.from(new Set( rows.map(r => r.cp_id).filter( cp_id => Boolean(cp_id)) )); + copyIds.forEach( copyId => { const url = - '/eg/staff/cat/item/' + rows[0].cp_id + '/circ_list'; + '/eg/staff/cat/item/' + copyId + '/circ_list'; window.open(url, '_blank'); - } + }); } showPatron(rows: any[]) { - if (rows.length) { + const usrIds = Array.from(new Set( rows.map(r => r.usr_id).filter( usr_id => Boolean(usr_id)) )); + usrIds.forEach( usrId => { const url = - '/eg/staff/circ/patron/' + rows[0].usr_id + '/checkout'; + '/eg/staff/circ/patron/' + usrId + '/checkout'; window.open(url, '_blank'); - } + }); } showOrder(rows: any[]) { @@ -419,7 +431,7 @@ export class HoldsGridComponent implements OnInit { } showTransferDialog(rows: any[]) { - const holdIds = rows.map(r => r.id).filter(id => Boolean(id)); + const holdIds = rows.filter(r => r.hold_type=='T').map(r => r.id).filter(id => Boolean(id)); if (holdIds.length > 0) { this.transferDialog.holdIds = holdIds; this.transferDialog.open({}).subscribe( diff --git a/Open-ILS/src/eg2/src/app/staff/share/holds/retarget-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/share/holds/retarget-dialog.component.ts index 25ff656f70..48a3df0c13 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holds/retarget-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/holds/retarget-dialog.component.ts @@ -41,6 +41,8 @@ export class HoldRetargetDialogComponent ngOnInit() {} open(args: NgbModalOptions): Observable { + this.numSucceeded = 0; + this.numFailed = 0; this.holdIds = [].concat(this.holdIds); // array-ify ints return super.open(args); } diff --git a/Open-ILS/src/eg2/src/app/staff/share/holds/transfer-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/share/holds/transfer-dialog.component.ts index 163aaadade..855c5eaf9b 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/holds/transfer-dialog.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/holds/transfer-dialog.component.ts @@ -46,6 +46,8 @@ export class HoldTransferDialogComponent ngOnInit() {} open(args: NgbModalOptions): Observable { + this.numSucceeded = 0; + this.numFailed = 0; this.holdIds = [].concat(this.holdIds); // array-ify ints this.transferTarget = diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm index c72a55ec55..5762f848fd 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm @@ -2175,7 +2175,8 @@ SELECT h.id, h.request_time, h.capture_time, h.fulfillment_time, h.checkin_time h.cancel_note, h.target, h.current_copy, h.fulfillment_staff, h.fulfillment_lib, h.request_lib, h.requestor, h.usr, h.selection_ou, h.selection_depth, h.pickup_lib, h.hold_type, h.holdable_formats, h.phone_notify, h.email_notify, h.sms_notify, - h.sms_carrier, h.frozen, h.thaw_date, h.shelf_time, h.cut_in_line, h.mint_condition, + (SELECT name FROM config.sms_carrier WHERE id = h.sms_carrier) AS "sms_carrier", + h.frozen, h.thaw_date, h.shelf_time, h.cut_in_line, h.mint_condition, h.shelf_expire_time, h.current_shelf_lib, h.behind_desk, h.hopeless_date, CASE WHEN h.cancel_time IS NOT NULL THEN 6 -- 2.11.0