From: Jason Etheridge Date: Fri, 7 Jun 2019 14:30:53 +0000 (-0400) Subject: lp1811710: minor tweaks to the eg2 holds grid X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d376be83eccd622401d42f61b42719f85801f6d4;p=evergreen%2Fpines.git 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 --- 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 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 330a487f8f..9307bf5af2 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 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 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