From 6268f6ff914cdeeaa05fc17d73b2798b23b25f6e Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 15 Apr 2021 12:49:52 -0400 Subject: [PATCH] LP1904036 copy alerts management (checkout) Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- .../src/eg2/src/app/staff/share/circ/circ.service.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 111122c0ea..348515288a 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 @@ -581,6 +581,24 @@ export class CircService { return params._renewal ? this.renew(params) : this.checkout(params); } + // New-style alerts are reported via COPY_ALERT_MESSAGE and + // includes the alerts in the payload as an array. + if (firstEvent.textcode === 'COPY_ALERT_MESSAGE' + && Array.isArray(firstEvent.payload)) { + this.components.copyAlertManager.alerts = firstEvent.payload; + + this.components.copyAlertManager.mode = + params._renewal ? 'renew' : 'checkout'; + + return this.components.copyAlertManager.open().toPromise() + .then(resp => { + if (resp) { + params._override = true; + return this.checkout(params); + } + }); + } + return this.showOverrideDialog(result, events); } -- 2.11.0