LP#1942220: improvements to cancel dialog
authorGalen Charlton <gmc@equinoxOLI.org>
Tue, 30 Nov 2021 22:36:26 +0000 (17:36 -0500)
committerBill Erickson <berickxx@gmail.com>
Wed, 21 Sep 2022 15:29:34 +0000 (11:29 -0400)
- add recordType parameter so that wording can be adjusted
  based on what is to be cancelled
- expand the wording to make it (hopefully) crystal clear
  what to do
- show all cancel reasons upon combobox click

TODO: pluralization for the more-than-one-LI case

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/cancel-dialog.component.html
Open-ILS/src/eg2/src/app/staff/acq/lineitem/cancel-dialog.component.ts
Open-ILS/src/eg2/src/app/staff/acq/lineitem/lineitem-list.component.html
Open-ILS/src/eg2/src/app/staff/acq/po/summary.component.html

index 8a5bb4d..7f062e8 100644 (file)
@@ -4,7 +4,7 @@
   dialogTitle="Confirm Alert" dialogBody="{{alertText ? alertText.code() : ''}}">
 </eg-confirm-dialog>
 
-<eg-acq-cancel-dialog #cancelDialog></eg-acq-cancel-dialog>
+<eg-acq-cancel-dialog recordType="lid" #cancelDialog></eg-acq-cancel-dialog>
 
 <!-- Note the flex values are set so they also match the layout
      of the list of copies in the copies component. -->
index 23ae488..114bea6 100644 (file)
@@ -1,15 +1,23 @@
 <ng-template #dialogContent>
   <form class="form-validated">
     <div class="modal-header bg-info">
-      <h3 class="modal-title" i18n>Cancel</h3>
+      <h3 class="modal-title" *ngIf="recordType === 'po'" i18n>Confirm Order Cancellation</h3>
+      <h3 class="modal-title" *ngIf="recordType === 'li'" i18n>Confirm Lineitem Cancellation</h3>
+      <h3 class="modal-title" *ngIf="recordType === 'lid'" i18n>Confirm Item Cancellation</h3>
       <button type="button" class="close"
         i18n-aria-label aria-label="Close" (click)="close()">
         <span aria-hidden="true">&times;</span>
       </button>
     </div>
     <div class="modal-body">
-      <h4 i18n>Select a cancel reason:</h4>
+      <h4 *ngIf="recordType === 'po'" i18n>Please select a cancel reason and click "Apply" to cancel the order,
+        or "Exit Dialog" to exit without cancelling the order.</h4>
+      <h4 *ngIf="recordType === 'li'" i18n>Please select a cancel reason and click "Apply" to cancel the lineitem,
+        or "Exit Dialog" to exit without cancelling the lineitem.</h4>
+      <h4 *ngIf="recordType === 'lid'" i18n>Please select a cancel reason and click "Apply" to cancel the item,
+        or "Exit Dialog" to exit without cancelling the item.</h4>
       <eg-combobox domId="acq-cancel-dialog" name="acq-cancel-dialog" 
+        [asyncSupportsEmptyTermClick]="true"
         idlClass="acqcr" [(ngModel)]="cancelReason"></eg-combobox>
     </div>
     <div class="modal-footer">
index 630f57d..98b0448 100644 (file)
@@ -10,6 +10,7 @@ import {ComboboxEntry} from '@eg/share/combobox/combobox.component';
 })
 
 export class CancelDialogComponent extends DialogComponent {
+    @Input() recordType = 'po';
     cancelReason: number;
     constructor(private modal: NgbModal) { super(modal); }
 }
index 3942049..4c3be4c 100644 (file)
@@ -1,6 +1,6 @@
 
 <!-- BATCH ACTIONS -->
-<eg-acq-cancel-dialog #cancelDialog></eg-acq-cancel-dialog>
+<eg-acq-cancel-dialog recordType="li" #cancelDialog></eg-acq-cancel-dialog>
 <eg-acq-claim-policy-dialog #claimPolicyDialog></eg-acq-claim-policy-dialog>
 
 <div class="row mt-3" *ngIf="poId || picklistId">
index 262b020..a4b3be1 100644 (file)
@@ -1,5 +1,5 @@
 
-<eg-acq-cancel-dialog #cancelDialog></eg-acq-cancel-dialog>
+<eg-acq-cancel-dialog recordType="po" #cancelDialog></eg-acq-cancel-dialog>
 <eg-progress-dialog #progressDialog></eg-progress-dialog>
 <eg-confirm-dialog #confirmFinalize
   i18n-dialogTitle i18n-dialogBody