LP#1792188: Record -> View Holds fails to refresh on Next/Prev record
authorMike Rylander <mrylander@gmail.com>
Fri, 14 Sep 2018 13:52:03 +0000 (09:52 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Tue, 7 May 2019 15:06:14 +0000 (11:06 -0400)
Here we clean up and add back a call to refresh the holds list when navigating
between records in a result set.

To test
-------
[1] In the web staff client, perform a catalog search, bring up a record,
    and change to the View Holds tab.
[2] Click the "Next" button to navigate to the next hold. Note that
    the list of holds doesn't change.
[3] Apply the patch, refresh, and repeat steps #1 and #2. This time,
    the list of holds should get updated as you navigate between
    records in the results list.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: John Yorio <jyorio@equinoxinitiative.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>

Open-ILS/web/js/ui/default/staff/cat/catalog/app.js

index 7d525c5..8d3ed24 100644 (file)
@@ -591,6 +591,7 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
                 $scope.conjoinedGridDataProvider.refresh();
             });
             init_parts_url();
+            $scope.grid_actions.refresh();
             $location.update_path('/cat/catalog/record/' + $scope.record_id);
             // update_path() bypasses the controller for path 
             // /cat/catalog/record/:record_id. Manually set title here too.
@@ -1734,13 +1735,14 @@ function($scope , $routeParams , $location , $window , $q , egCore , egHolds , e
     // ------------------------------------------------------------------
     // Holds 
     var provider = egGridDataProvider.instance({});
+    var holds = []; // current list of holds
+    var hold_count = 0;
+
     $scope.hold_grid_data_provider = provider;
     $scope.grid_actions = egHoldGridActions;
     $scope.grid_actions.refresh = function () { holds = []; hold_count = 0; provider.refresh() };
     $scope.hold_grid_controls = {};
 
-    var holds = []; // current list of holds
-    var hold_count = 0;
     provider.get = function(offset, count) {
         if ($scope.record_tab != 'holds') return $q.when();