From d53b2f94120c85e1653818f2b0fdcfac2d5cdae3 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 --- .../holdings/mark-missing-dialog.component.ts | 9 ++- .../staff/share/holds/cancel-dialog.component.ts | 3 + .../src/app/staff/share/holds/grid.component.html | 68 +++++++++++++--------- .../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(+), 36 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 5c00dbe975..aab7d07b3f 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
+
+
+
@@ -60,6 +75,7 @@ @@ -120,11 +136,11 @@ + path='request_time' datatype="timestamp" [datePlusTime]="true"> + datatype="timestamp" [datePlusTime]="true"> + datatype="timestamp" [datePlusTime]="true"> @@ -139,7 +155,7 @@ [hidden]="true"> - + @@ -155,14 +171,13 @@ - - - - - - - - + + + + + + + @@ -179,14 +194,13 @@ - + - + - - + @@ -197,14 +211,14 @@ - - + + - + @@ -227,8 +241,8 @@ - - + + @@ -236,16 +250,16 @@ - + - - + + - + - + @@ -264,7 +278,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 a6f1d87802..8ae18a565c 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 @@ -312,6 +312,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]); } @@ -342,19 +352,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[]) { @@ -401,7 +413,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 ea74832dc5..7c81db8ecc 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 @@ -2171,7 +2171,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