LP1904036 Grid persist keys; misc fixes
authorBill Erickson <berickxx@gmail.com>
Fri, 16 Apr 2021 15:06:29 +0000 (11:06 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:31 +0000 (20:13 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
12 files changed:
Open-ILS/src/eg2/src/app/staff/circ/checkin/checkin.component.ts
Open-ILS/src/eg2/src/app/staff/circ/patron/bill-statement.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/bills.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/checkout.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/group.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/holds.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/items.component.html
Open-ILS/src/eg2/src/app/staff/circ/patron/items.component.ts
Open-ILS/src/eg2/src/app/staff/circ/patron/messages.component.html
Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts
Open-ILS/src/eg2/src/app/staff/share/holdings/copy-alert-manager.component.ts
Open-ILS/src/sql/Pg/upgrade/XXXX.data.angular-patron.sql

index af8ef2e..68f2a9f 100644 (file)
@@ -45,7 +45,7 @@ const CHECKIN_MODIFIERS = [
 
 const SETTINGS = [
     'circ.checkin.strict_barcode'
-]
+];
 
 @Component({
   templateUrl: 'checkin.component.html',
@@ -271,7 +271,7 @@ export class CheckinComponent implements OnInit, AfterViewInit {
         if (copyIds.length === 0) { return; }
 
         this.copyAlertsDialog.copyIds = copyIds;
-        this.copyAlertsDialog.mode = 'create'
+        this.copyAlertsDialog.mode = 'create';
         this.copyAlertsDialog.open({size: 'lg'}).subscribe();
     }
 
index 9d92f3b..f2fc980 100644 (file)
     <ng-template ngbNavContent>
       <div class="mt-3">
         <eg-grid idlClass="mb" #billingGrid toolbarLabel="Bills" 
+          persistKey="circ.patron.xact_details_details_bills"
           i18n-toolbarLabel [dataSource]="billingDataSource" [sortable]="true">
           <eg-grid-toolbar-action label="Edit Note" i18n-label
             (onClick)="openNoteDialog($event)">
       </div>
       <div class="mt-3">
         <eg-grid idlClass="mp" [dataSource]="paymentDataSource" 
+          persistKey="circ.patron.xact_details_details_payments"
           i18n-toolbarLabel toolbarLabel="Payments" [sortable]="true">
           <eg-grid-toolbar-action label="Edit Note" i18n-label
             (onClick)="openNoteDialog($event)">
index 0087916..9b4b07d 100644 (file)
 </ng-template>
 
 <eg-grid #billGrid [dataSource]="gridDataSource"
-  [sortable]="true" [useLocalSort]="true" (onRowActivate)="showStatement($event)"
+  persistKey="circ.patron.bills" [sortable]="true" 
+  [useLocalSort]="true" (onRowActivate)="showStatement($event)"
   [cellTextGenerator]="cellTextGenerator">
 
   <eg-grid-toolbar-button i18n-label label="Add Billing"
index 3e99c33..e9a1e88 100644 (file)
@@ -87,6 +87,7 @@
 <div class="row">
   <div class="col-lg-12">
     <eg-grid #checkoutsGrid [dataSource]="gridDataSource" [sortable]="true"
+      persistKey="circ.patron.checkout"
       [useLocalSort]="true" [cellTextGenerator]="cellTextGenerator"
       [disablePaging]="true" persistKey="circ.patron.checkout">
 
index 9c36780..93afb83 100644 (file)
   </ng-template>
 
   <eg-grid idlClass="au" #groupGrid 
-    [cellTextGenerator]="cellTextGenerator"
-    [dataSource]="dataSource" 
-    [sortable]="true" 
-    [useLocalSort]="true"
+    persistKey="circ.patron.group_members" [cellTextGenerator]="cellTextGenerator"
+    [dataSource]="dataSource" [sortable]="true" [useLocalSort]="true"
     (onRowActivate)="onRowActivate($event)" 
     showFields="active,barred,dob,family_name,first_given_name,barcode,
       master_account,second_given_name,balance_owed,total_out,overdue">
index ecccbac..bd3f245 100644 (file)
@@ -22,7 +22,7 @@
     <ng-template ngbNavContent>
       <eg-holds-grid 
         printTemplate="holds_for_patron"
-        persistKey="circ.patron.holds.canceled"
+        persistKey="circ.patron.holds"
         [noLoadProgress]="true"
         [hidePickupLibFilter]="true"
         [showRecentlyCanceled]="true"
index 2dc6907..e1abe90 100644 (file)
@@ -15,7 +15,8 @@
         <ng-container *ngIf="loading">
           <ng-container *ngTemplateOutlet="progress"></ng-container>
         </ng-container>
-        <eg-circ-grid #checkoutsGrid [persistKey]="persistKey" (reloadRequested)="load()">
+        <eg-circ-grid #checkoutsGrid 
+          persistKey="circ.patron.items_out" (reloadRequested)="load()">
         </eg-circ-grid>
       </ng-template>
     </li>
@@ -27,7 +28,8 @@
             <ng-container *ngIf="loading">
               <ng-container *ngTemplateOutlet="progress"></ng-container>
             </ng-container>
-            <eg-circ-grid #otherGrid [persistKey]="persistKey" (reloadRequested)="load()">
+            <eg-circ-grid #otherGrid 
+              persistKey="circ.patron.items_out.other" (reloadRequested)="load()">
             </eg-circ-grid>
           </ng-container>
         </ng-template>
@@ -45,7 +47,7 @@
             <ng-container *ngIf="loading">
               <ng-container *ngTemplateOutlet="progress"></ng-container>
             </ng-container>
-            <eg-circ-grid #nonCatGrid [persistKey]="persistKey" 
+            <eg-circ-grid #nonCatGrid persistKey="circ.patron.items_out.noncat"
               menuStyle="none" (reloadRequested)="load()">
             </eg-circ-grid>
           </ng-container>
index a97e5c3..41f43fe 100644 (file)
@@ -42,7 +42,6 @@ export class ItemsComponent implements OnInit, AfterViewInit {
     displayClaimsReturned: number = null;
     fetchCheckedIn = true;
     displayAltList = true;
-    persistKey: string;
 
     @ViewChild('checkoutsGrid') private checkoutsGrid: CircGridComponent;
     @ViewChild('otherGrid') private otherGrid: CircGridComponent;
@@ -96,8 +95,6 @@ export class ItemsComponent implements OnInit, AfterViewInit {
             promise = this.loadNonCatGrid();
         }
 
-        this.persistKey = `circ.patron.items.${name}`;
-
         return promise.then(_ => this.loading = false);
     }
 
index 4ba910d..508eba7 100644 (file)
@@ -9,7 +9,7 @@
 </div>
 
 <eg-grid #mainGrid idlClass="ausp" [dataSource]="mainDataSource"
-  hideFields="id,usr,stop_date">
+  hideFields="id,usr,stop_date" persistKey="circ.patron.staff_messages">
   <eg-grid-toolbar-button i18n-label label="Apply Penalty / Message"
     (onClick)="applyPenalty()">
   <eg-grid-toolbar-action (onClick)="archive($event)"
@@ -42,7 +42,7 @@
 </div>
 
 <eg-grid #archiveGrid idlClass="ausp" [dataSource]="archiveDataSource"
-  hideFields="id,usr,stop_date">
+  hideFields="id,usr,stop_date" persistKey="circ.patron.archived_messages">
   <eg-grid-column path="standing_penalty.label">
   </eg-grid-column>
   <eg-grid-column path="standing_penalty.staff_alert">
index ae558ef..da1706c 100644 (file)
@@ -938,7 +938,7 @@ export class CircService {
     handleOverridableCheckinEvents(result: CheckinResult): Promise<CheckinResult> {
         const params = result.params;
         const events = result.allEvents;
-        const firstEvent = result.firstEvent
+        const firstEvent = result.firstEvent;
 
         if (params._override) {
             // Should never get here.  Just being safe.
index f6a4740..5288753 100644 (file)
@@ -92,7 +92,7 @@ export class CopyAlertManagerDialogComponent
                 nextStatuses.forEach(statId => {
                     const wanted = statMap[statId];
                     if (wanted) { this.nextStatuses.push(wanted); }
-                })
+                });
 
                 if (this.nextStatuses.length > 0) {
                     this.nextStatus = this.nextStatuses[0].id();
index af05cdc..04ff243 100644 (file)
@@ -4,22 +4,6 @@ BEGIN;
 -- SELECT evergreen.upgrade_deps_block_check('TODO', :eg_version); 
 
 /*
-INSERT INTO config.workstation_setting_type (name, grp, datatype, label)
-VALUES (
-    'eg.catalog.results.count', 'gui', 'integer',
-    oils_i18n_gettext(
-        'eg.catalog.results.count',
-        'Catalog Results Page Size',
-        'cwst', 'label'
-    )
-);
-
-eg.circ.patron.holds.prefetch
-
-eg.grid.circ.patron.holds
-
-holds_for_patron print template
-
 
 -- insert then update for easier iterative development tweaks
 INSERT INTO config.print_template 
@@ -444,8 +428,6 @@ INSERT INTO config.print_template
     (name, label, owner, active, locale, content_type, template)
 VALUES ('checkin', 'Checkin', 1, TRUE, 'en-US', 'text/html', '');
 
-*/
-
 UPDATE config.print_template SET template = $TEMPLATE$
 [% 
   USE date;
@@ -482,6 +464,37 @@ UPDATE config.print_template SET template = $TEMPLATE$
 $TEMPLATE$ WHERE name = 'checkin';
 
 
+INSERT INTO config.print_template 
+    (name, label, owner, active, locale, content_type, template)
+VALUES ('holds_for_patron', 'Holds For Patron', 1, TRUE, 'en-US', 'text/html', '');
+
+*/
+
+UPDATE config.print_template SET template = $TEMPLATE$
+[% 
+  USE date;
+  USE money = format('$%.2f');
+  SET holds = template_data;
+%] 
+
+<div>
+  <div>Welcome to [% staff_org.name %]</div>
+  <div>You have the following items on hold:</div>
+  <hr/>
+  <ol>
+       [% FOR hold IN holds %]
+    <li>
+      <div>[% hold.title %]</div>
+    </li>
+  [% END %]
+  </ol>
+  <hr/>
+  <div>Slip Date: [% date.format(date.now, '%x %r') %]</div>
+  <div>Printed by [% staff.first_given_name %] at [% staff_org.shortname %]</div>
+</div>
+
+$TEMPLATE$ WHERE name = 'holds_for_patron';
+
 COMMIT;