LP#1929749: flesh out the LI receiving alert confirmation dialog
authorGalen Charlton <gmc@equinoxOLI.org>
Sat, 5 Feb 2022 18:30:20 +0000 (13:30 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Sat, 5 Feb 2022 18:30:20 +0000 (13:30 -0500)
Add LI ID, LI title, alert text description, alert comment, and
some help text.

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/staff/acq/lineitem/batch-copies.component.html
Open-ILS/src/eg2/src/app/staff/acq/lineitem/batch-copies.component.ts

index 69381de..ed73ab0 100644 (file)
@@ -1,8 +1,15 @@
 
 <eg-confirm-dialog #confirmAlertsDialog
   i18n-dialogTitle i18n-dialogBody
-  dialogTitle="Confirm Alert" dialogBody="{{alertText ? alertText.code() : ''}}">
+  dialogTitle="Confirm Alert" [dialogBodyTemplate]="confirmAlertsMsg">
 </eg-confirm-dialog>
+<ng-template #confirmAlertsMsg>
+  <div i18n>An alert has been placed on line item {{liId}} ({{liTitle}})</div>
+  <div class="mt-2">{{alertText.code()}}</div>
+  <div>{{alertText.description()}}</div>
+  <div>{{alertComment}}</div>
+  <div class="mt-2" i18n>Choose "Confirm" to acknowledge this alert and continue with receiving. Otherwise, choose "Cancel".</div>
+</ng-template>
 
 <eg-acq-cancel-dialog recordType="lid" #cancelDialog></eg-acq-cancel-dialog>
 
index 90cbf9d..3af7bf2 100644 (file)
@@ -35,6 +35,9 @@ export class LineitemBatchCopiesComponent implements OnInit {
 
     // Current alert that needs confirming
     alertText: IdlObject;
+    liId: number;
+    liTitle: string;
+    alertComment: string;
 
     constructor(
         private evt: EventService,
@@ -128,9 +131,13 @@ export class LineitemBatchCopiesComponent implements OnInit {
 
         if (notes.length === 0) { return promise; }
 
+        this.liId = this.lineitem.id();
+        this.liTitle = this.liService.getFirstAttributeValue(this.lineitem, 'title');
+
         notes.forEach(n => {
             promise = promise.then(_ => {
                 this.alertText = n.alert_text();
+                this.alertComment = n.value();
                 return this.confirmAlertsDialog.open().toPromise().then(ok => {
                     if (!ok) { return Promise.reject(); }
                     this.liService.alertAcks[n.id()] = true;