LP1904036 Items out grid sorts by next due by default
authorBill Erickson <berickxx@gmail.com>
Fri, 28 Jan 2022 21:48:18 +0000 (16:48 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Fri, 28 Oct 2022 00:13:40 +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>

Open-ILS/src/eg2/src/app/staff/circ/patron/items.component.html
Open-ILS/src/eg2/src/app/staff/share/circ/grid.component.ts

index e1abe90..58a5e3f 100644 (file)
@@ -15,7 +15,7 @@
         <ng-container *ngIf="loading">
           <ng-container *ngTemplateOutlet="progress"></ng-container>
         </ng-container>
-        <eg-circ-grid #checkoutsGrid 
+        <eg-circ-grid #checkoutsGrid [pageSize]="25" sortField="due_date"
           persistKey="circ.patron.items_out" (reloadRequested)="load()">
         </eg-circ-grid>
       </ng-template>
@@ -28,7 +28,7 @@
             <ng-container *ngIf="loading">
               <ng-container *ngTemplateOutlet="progress"></ng-container>
             </ng-container>
-            <eg-circ-grid #otherGrid 
+            <eg-circ-grid #otherGrid [pageSize]="25" sortField="due_date"
               persistKey="circ.patron.items_out.other" (reloadRequested)="load()">
             </eg-circ-grid>
           </ng-container>
@@ -48,7 +48,8 @@
               <ng-container *ngTemplateOutlet="progress"></ng-container>
             </ng-container>
             <eg-circ-grid #nonCatGrid persistKey="circ.patron.items_out.noncat"
-              menuStyle="none" (reloadRequested)="load()">
+              sortField="due_date" menuStyle="none" (reloadRequested)="load()" 
+              [pageSize]="25">
             </eg-circ-grid>
           </ng-container>
         </ng-container>
index b6d831b..aaebf80 100644 (file)
@@ -75,6 +75,11 @@ export class CircGridComponent implements OnInit {
     @Input() printTemplate: string; // defaults to items_out
     @Input() menuStyle: 'full' | 'slim' | 'none' = 'full';
 
+    @Input() sortField: string; // e.g. "due_date", "due_date DESC"
+
+    // Override default grid page size
+    @Input() pageSize: number = null;
+
     // Emitted when a grid action modified data in a way that could
     // affect which cirulcations should appear in the grid.  Caller
     // should then refresh their data and call the load() or
@@ -194,7 +199,7 @@ export class CircGridComponent implements OnInit {
         return this.pcrud.search('circ', {id: circIds}, {
             flesh: CIRC_FLESH_DEPTH,
             flesh_fields: CIRC_FLESH_FIELDS,
-            order_by : {circ : ['xact_start']},
+            order_by : {circ: this.sortField ? this.sortField : 'xact_start'},
 
             // Avoid fetching the MARC blob by specifying which
             // fields on the bre to select.  More may be needed.