From f9752ebea0258cf7690a2451b527575b9ea104af 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 --- .../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 14e8ceb7a7..267d9397ee 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 d9c9295486..486f25add7 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 7eca972514..3bc99c94e6 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 @@ @@ -116,11 +132,11 @@ + path='request_time' datatype="timestamp" [datePlusTime]="true"> + datatype="timestamp" [datePlusTime]="true"> + datatype="timestamp" [datePlusTime]="true"> @@ -135,7 +151,7 @@ [hidden]="true"> - + @@ -151,14 +167,13 @@ - - - - - - - - + + + + + + + @@ -175,14 +190,13 @@ - + - + - - + @@ -193,14 +207,14 @@ - - + + - + @@ -223,8 +237,8 @@ - - + + @@ -232,16 +246,16 @@ - + - - + + - + - + @@ -260,7 +274,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 c66869dd5b..ef2da19b37 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 @@ -307,6 +307,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]); } @@ -337,19 +347,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[]) { @@ -396,7 +408,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 bb31a48602..fcd9f4024b 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 796aa107a6..b404074b2a 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 c9a35d12d4..ae00397350 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 @@ -2170,7 +2170,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