[open-ils-commits] [GIT] Evergreen ILS branch master updated. b35f0c0b92ca94a0fc151144d38ecaa40707ff70

Evergreen Git git at git.evergreen-ils.org
Mon Feb 12 15:42:15 EST 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  b35f0c0b92ca94a0fc151144d38ecaa40707ff70 (commit)
       via  4cdc7cd6e32942331e4403349fdd13ff1c88ec03 (commit)
      from  1f630f2189842cec8949596edd3c2fada4a9c8fc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b35f0c0b92ca94a0fc151144d38ecaa40707ff70
Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
Date:   Mon Jan 8 16:55:56 2018 -0500

    LP#1739648 - fix grid nextPage button by setting grid.totalCount
    
    This wires up the grid.totalCount in the implemented DataProvider's
    get method, which allows us to properly disable the next page button
    for when we know there's no more data.
    
    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
    
    Signed-off-by: Jason Etheridge <jason at EquinoxInitiative.org>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/templates/staff/share/t_autogrid.tt2 b/Open-ILS/src/templates/staff/share/t_autogrid.tt2
index 941aa63..c6b45d9 100644
--- a/Open-ILS/src/templates/staff/share/t_autogrid.tt2
+++ b/Open-ILS/src/templates/staff/share/t_autogrid.tt2
@@ -84,6 +84,7 @@
     <button type="button" class="btn btn-default" 
       ng-show="showPagination"
       ng-class="{disabled : !hasNextPage()}"
+      ng-disabled="!hasNextPage()"
       ng-click="incrementPage()"
       title="[% l('Next Page') %]">
         <span class="glyphicon glyphicon-forward"></span>
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js b/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js
index 6d017d4..c3ce75b 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js
@@ -90,7 +90,14 @@ function($scope,  $q,  $routeParams,  egCore,  egUser,  patronSvc,
             egCore.auth.token(), $scope.patron_id
 
         ).then(function(hold_ids) {
-            if (!hold_ids.length || hold_ids.length < offset + 1) { deferred.resolve(); return; }
+            
+            if (!hold_ids.length || hold_ids.length < offset + 1)
+            {
+                deferred.resolve();
+                return;
+            }
+
+            $scope.gridDataProvider.grid.totalCount = hold_ids.length;
 
             patronSvc.hold_ids = hold_ids;
             fetchHolds(offset, count)
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
index daf0041..777900a 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
@@ -261,7 +261,7 @@ function($scope,  $q,  $routeParams,  $timeout,  egCore , egUser,  patronSvc , $
         get_circ_ids().then(function() {
 
             id_list = $scope[$scope.items_out_display + '_list'];
-
+            $scope.gridDataProvider.grid.totalCount = id_list.length;
             // relay the notified circs back to the grid through our promise
             fetch_circs(id_list, offset, count).then(
                 deferred.resolve, null, deferred.notify);
diff --git a/Open-ILS/web/js/ui/default/staff/services/grid.js b/Open-ILS/web/js/ui/default/staff/services/grid.js
index 266a972..7144970 100644
--- a/Open-ILS/web/js/ui/default/staff/services/grid.js
+++ b/Open-ILS/web/js/ui/default/staff/services/grid.js
@@ -178,6 +178,9 @@ angular.module('egGridMod',
                 delete $scope.idField;
 
                 grid.dataProvider = $scope.itemsProvider;
+                // make grid ref available in get() to set totalCount, if known.
+                // this allows us disable the 'next' paging button correctly
+                grid.dataProvider.grid = grid;
 
                 if (!grid.indexField && grid.idlClass)
                     grid.indexField = egCore.idl.classes[grid.idlClass].pkey;

commit 4cdc7cd6e32942331e4403349fdd13ff1c88ec03
Author: Cesar Velez <cesar.velez at equinoxinitiative.org>
Date:   Thu Jan 4 17:36:02 2018 -0500

    LP#1739648 - fix item duplication in itemsout and holds grids
    
    Since these grids have caching, if the offset was greater
    the cached data length, the grid would try to fetch data again, even if
    it's already there, pushing duplicate items into the cache. This should
    prevent that.
    
    Signed-off by: Cesar Velez <cesar.velez at equinoxinitiative.org>
    
    Signed-off-by: Jason Etheridge <jason at EquinoxInitiative.org>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js b/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js
index 41e0223..6d017d4 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/holds.js
@@ -90,7 +90,7 @@ function($scope,  $q,  $routeParams,  egCore,  egUser,  patronSvc,
             egCore.auth.token(), $scope.patron_id
 
         ).then(function(hold_ids) {
-            if (!hold_ids.length) { deferred.resolve(); return; }
+            if (!hold_ids.length || hold_ids.length < offset + 1) { deferred.resolve(); return; }
 
             patronSvc.hold_ids = hold_ids;
             fetchHolds(offset, count)
diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
index 6679af6..daf0041 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js
@@ -96,7 +96,7 @@ function($scope,  $q,  $routeParams,  $timeout,  egCore , egUser,  patronSvc , $
     $scope.gridDataProvider = provider;
 
     function fetch_circs(id_list, offset, count) {
-        if (!id_list.length) return $q.when();
+        if (!id_list.length || id_list.length < offset + 1) return $q.when();
 
         var deferred = $q.defer();
         var rendered = 0;

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/src/templates/staff/share/t_autogrid.tt2  |    1 +
 .../web/js/ui/default/staff/circ/patron/holds.js   |    9 ++++++++-
 .../js/ui/default/staff/circ/patron/items_out.js   |    4 ++--
 Open-ILS/web/js/ui/default/staff/services/grid.js  |    3 +++
 4 files changed, 14 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list