LP1919465 Fix default holds pull list sorting
authorBill Erickson <berickxx@gmail.com>
Fri, 13 Aug 2021 16:02:01 +0000 (12:02 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Fri, 24 Sep 2021 19:20:54 +0000 (15:20 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jennifer Weston <jennifer.weston@equinoxOLI.org>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Open-ILS/src/eg2/src/app/staff/share/holds/grid.component.ts

index 06247c1..ffd9371 100644 (file)
@@ -167,7 +167,17 @@ export class HoldsGridComponent implements OnInit {
         }
 
         if (!this.defaultSort) {
-            this.defaultSort = [{name: 'request_time', dir: 'asc'}];
+            if (this.pullListOrg) {
+
+                this.defaultSort = [
+                    {name: 'copy_location_order_position', dir: 'asc'},
+                    {name: 'acpl_name', dir: 'asc'},
+                    {name: 'cn_label_sortkey', dir: 'asc'}
+                ];
+
+            } else {
+                this.defaultSort = [{name: 'request_time', dir: 'asc'}];
+            }
         }
 
         this.gridDataSource.getRows = (pager: Pager, sort: any[]) => {
@@ -303,12 +313,6 @@ export class HoldsGridComponent implements OnInit {
                 subObj[obj.name] = {dir: obj.dir, nulls: 'last'};
                 orderBy.push(subObj);
             });
-        } else if (this.pullListOrg) {
-            orderBy.push(
-                {copy_location_order_position: {dir: 'asc', nulls: 'last'}},
-                {acpl_name: {dir: 'asc', nulls: 'last'}},
-                {cn_label_sortkey: {dir: 'asc'}}
-            );
         }
 
         const limit = this.enablePreFetch ? null : pager.limit;