From 23380294cf9486c3391da72bdcbbc257ccb34adc Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 12 Apr 2021 17:30:34 -0400 Subject: [PATCH] LP1904036 checkout more events Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- .../src/app/staff/circ/patron/edit.component.html | 3 ++ .../eg2/src/app/staff/share/circ/circ.service.ts | 62 +++++++++------------- .../app/staff/share/circ/components.component.html | 23 ++++++++ .../app/staff/share/circ/components.component.ts | 1 + .../eg2/src/app/staff/share/circ/grid.component.ts | 6 --- 5 files changed, 52 insertions(+), 43 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.html b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.html index f938378800..49ae97142b 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.html +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/edit.component.html @@ -441,6 +441,9 @@ fieldName="au-expire_date-input" [noMaxWidth]="true" [required]="fieldRequired('au.expire_date')" + (onChangeAsIso)=" + fieldValueChange(null, null, 'expire_date', $event); + afterFieldChange(null, null, 'expire_date')" [(ngModel)]="expireDate"> diff --git a/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts b/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts index f0a6a9189d..ae7f817812 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts @@ -420,12 +420,11 @@ export class CircService { } processCheckoutResult(result: CheckoutResult): Promise { + const renewing = result.params._renewal; + const key = renewing ? 'renew' : 'checkout'; - let overridable; - try { - overridable = result.params._renewal ? + const overridable = renewing ? CAN_OVERRIDE_RENEW_EVENTS : CAN_OVERRIDE_CHECKOUT_EVENTS; - } catch (E) { console.error(E) } if (result.allEvents.filter( e => overridable.includes(e.textcode)).length > 0) { @@ -435,8 +434,8 @@ export class CircService { switch (result.firstEvent.textcode) { case 'SUCCESS': result.success = true; - this.audio.play('success.checkout'); - break; + this.audio.play(`success.${key}`); + return Promise.resolve(result); case 'ITEM_NOT_CATALOGED': return this.handlePrecat(result); @@ -445,48 +444,37 @@ export class CircService { return this.handleOpenCirc(result); case 'COPY_IN_TRANSIT': - this.audio.play('warning.checkout.in_transit'); + this.audio.play(`warning.${key}.in_transit`); return this.copyInTransitDialog(result); - /* - case 'PATRON_CARD_INACTIVE': - case 'PATRON_INACTIVE': - case 'PATRON_ACCOUNT_EXPIRED': - case 'CIRC_CLAIMS_RETURNED': - egCore.audio.play('warning.checkout'); - return service.exit_alert( - egCore.strings[evt[0].textcode], - {barcode : params.copy_barcode} - ); - */ - - - /* case 'PATRON_CARD_INACTIVE': case 'PATRON_INACTIVE': case 'PATRON_ACCOUNT_EXPIRED': case 'CIRC_CLAIMS_RETURNED': - egCore.audio.play('warning.checkout'); - return this.exit_alert( - egCore.strings[evt[0].textcode], - {barcode : params.copy_barcode} - ); + this.audio.play(`warning.${key}`); + return this.exitAlert({ + textcode: result.firstEvent.textcode, + barcode: result.params.copy_barcode + }); default: - egCore.audio.play('error.checkout.unknown'); - return this.exit_alert( - egCore.strings.CHECKOUT_FAILED_GENERIC, { - barcode : params.copy_barcode, - textcode : evt[0].textcode, - desc : evt[0].desc - } - ); - */ + this.audio.play(`error.${key}.unknown`); + return this.exitAlert({ + textcode: 'CHECKOUT_FAILED_GENERIC', + barcode: result.params.copy_barcode + }); } - - return Promise.resolve(result); } + exitAlert(context: any): Promise { + let key = 'staff.circ.events.' + context.textcode; + return this.strings.interpolate(key, context) + .then(str => { + this.components.circFailedDialog.dialogBody = str; + return this.components.circFailedDialog.open().toPromise(); + }) + .then(_ => Promise.reject('Bailling on event ' + context.textcode)); + } copyInTransitDialog(result: CheckoutResult): Promise { this.components.copyInTransitDialog.checkout = result; diff --git a/Open-ILS/src/eg2/src/app/staff/share/circ/components.component.html b/Open-ILS/src/eg2/src/app/staff/share/circ/components.component.html index 123acda50a..3a29fccb53 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/circ/components.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/circ/components.component.html @@ -8,6 +8,10 @@ i18n-dialogBody dialogBody="This item needs to be routed to CATALOGING"> + + + Item {{barcode}} needs to be routed to {{location}}. @@ -33,6 +37,25 @@ + + + + + + + Item "{{barcode}}" is marked as Claims Returned + + + + Unable to checkout item "{{barcode}}" : {{textcode}} + + diff --git a/Open-ILS/src/eg2/src/app/staff/share/circ/components.component.ts b/Open-ILS/src/eg2/src/app/staff/share/circ/components.component.ts index 921e591cd1..c7f82023bd 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/circ/components.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/circ/components.component.ts @@ -27,6 +27,7 @@ export class CircComponentsComponent { @ViewChild('openCircDialog') openCircDialog: OpenCircDialogComponent; @ViewChild('locationAlertDialog') locationAlertDialog: AlertDialogComponent; @ViewChild('uncatAlertDialog') uncatAlertDialog: AlertDialogComponent; + @ViewChild('circFailedDialog') circFailedDialog: AlertDialogComponent; @ViewChild('routeDialog') routeDialog: RouteDialogComponent; @ViewChild('copyInTransitDialog') copyInTransitDialog: CopyInTransitDialogComponent; diff --git a/Open-ILS/src/eg2/src/app/staff/share/circ/grid.component.ts b/Open-ILS/src/eg2/src/app/staff/share/circ/grid.component.ts index 3954c2198b..2622081736 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/circ/grid.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/circ/grid.component.ts @@ -154,12 +154,6 @@ export class CircGridComponent implements OnInit { return 'less-intense-alert'; } }; - - this.serverStore.getItemBatch(['ui.circ.suppress_checkin_popups']) - .then(sets => { - this.circ.suppressCheckinPopups = - sets['ui.circ.suppress_checkin_popups']; - }); } reportError(err: any) { -- 2.11.0