[open-ils-commits] [GIT] Evergreen ILS branch rel_3_1 updated. 2aa37737001b4e5050db5ce7f9ff7eeb832a40fb

Evergreen Git git at git.evergreen-ils.org
Mon Nov 5 16:44:34 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, rel_3_1 has been updated
       via  2aa37737001b4e5050db5ce7f9ff7eeb832a40fb (commit)
       via  5c44f0809e68dda82fb9a8d19049c97e3c121ba2 (commit)
       via  79a3ca19e58072a421c4a51a39c2ca7991a6adde (commit)
      from  52d9c71bbbd06912127dbfad91e03d4ae81a5ebe (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 2aa37737001b4e5050db5ce7f9ff7eeb832a40fb
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Mon Nov 5 16:40:34 2018 -0500

    LP#1789747: tweak disabling the offline circulation link
    
    This patch ensures that the menu link can be fully disabled by
    giving the "disabled" CSS class to the anchor as well as the
    li that contains it. It also adds a CSS rule to the disabled
    class to force the cursor to not-allowed; due to a quirk, an
    anchor with "pointer-events: none" will not respect "cursor: not-allowed",
    but the containing element can have that cursor rule.
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/templates/staff/css/style.css.tt2 b/Open-ILS/src/templates/staff/css/style.css.tt2
index 063da5f..ec81b31 100644
--- a/Open-ILS/src/templates/staff/css/style.css.tt2
+++ b/Open-ILS/src/templates/staff/css/style.css.tt2
@@ -112,6 +112,9 @@ a.disabled {
   cursor: default;
   color: #888 !important;
 }
+.disabled {
+  cursor: not-allowed;
+}
 
 #splash-nav .panel-body div {
     padding-bottom: 10px;
diff --git a/Open-ILS/src/templates/staff/navbar.tt2 b/Open-ILS/src/templates/staff/navbar.tt2
index 8756e6c..6564a78 100644
--- a/Open-ILS/src/templates/staff/navbar.tt2
+++ b/Open-ILS/src/templates/staff/navbar.tt2
@@ -232,7 +232,7 @@
           </li>
           <li class="divider"></li>
           <li ng-class="{disabled : offlineDisabled()}">
-            <a href="./offline-interface" target="_self">
+            <a href="./offline-interface" target="_self" ng-class="{disabled : offlineDisabled()}">
               <span class="glyphicon glyphicon-alert"></span>
               <span>[% l('Offline Circulation') %]</span>
             </a>

commit 5c44f0809e68dda82fb9a8d19049c97e3c121ba2
Author: Bill Erickson <berickxx at gmail.com>
Date:   Tue Sep 4 15:09:31 2018 -0400

    LP#1789747 More SharedWorker sanity checks for egLovefield
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Rogan Hamby <rhamby at equinoxinitiative.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/web/js/ui/default/staff/services/lovefield.js b/Open-ILS/web/js/ui/default/staff/services/lovefield.js
index 707f41a..e7ec496 100644
--- a/Open-ILS/web/js/ui/default/staff/services/lovefield.js
+++ b/Open-ILS/web/js/ui/default/staff/services/lovefield.js
@@ -240,8 +240,10 @@ angular.module('egCoreMod')
     }
 
     service.setStatCatsCache = function (statcats) {
-        if (lf.isOffline || !statcats || statcats.length === 0) 
+        if (lf.isOffline || !statcats || 
+            statcats.length === 0 || service.cannotConnect) {
             return $q.when();
+        }
 
         var rows = statcats.map(function(cat) {
             return {id: cat.id(), value: egCore.idl.toHash(cat)}
@@ -290,7 +292,7 @@ angular.module('egCoreMod')
     }
 
     service.setSettingsCache = function (settings) {
-        if (lf.isOffline) return $q.when();
+        if (lf.isOffline || service.cannotConnect) return $q.when();
 
         var rows = [];
         angular.forEach(settings, function (val, key) {
@@ -334,7 +336,7 @@ angular.module('egCoreMod')
     }
 
     service.setListInOfflineCache = function (type, list) {
-        if (lf.isOffline) return $q.when();
+        if (lf.isOffline || service.cannotConnect) return $q.when();
 
         return service.isCacheGood(type).then(function(good) {
             if (good) { return };  // already cached

commit 79a3ca19e58072a421c4a51a39c2ca7991a6adde
Author: Bill Erickson <berickxx at gmail.com>
Date:   Thu Aug 30 13:19:03 2018 -0400

    LP#1789747 SharedWorker sanity checks
    
    Avoid page load failures when SharedWorkers (for offline mode) are
    not supported.  Additionally, disable the Offline Circulation menu
    option when SharedWorkers are not supported.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/Open-ILS/src/templates/staff/navbar.tt2 b/Open-ILS/src/templates/staff/navbar.tt2
index a6a65ad..8756e6c 100644
--- a/Open-ILS/src/templates/staff/navbar.tt2
+++ b/Open-ILS/src/templates/staff/navbar.tt2
@@ -231,7 +231,7 @@
             </a>
           </li>
           <li class="divider"></li>
-          <li>
+          <li ng-class="{disabled : offlineDisabled()}">
             <a href="./offline-interface" target="_self">
               <span class="glyphicon glyphicon-alert"></span>
               <span>[% l('Offline Circulation') %]</span>
diff --git a/Open-ILS/web/js/ui/default/staff/app.js b/Open-ILS/web/js/ui/default/staff/app.js
index 167e238..053f401 100644
--- a/Open-ILS/web/js/ui/default/staff/app.js
+++ b/Open-ILS/web/js/ui/default/staff/app.js
@@ -48,9 +48,10 @@ function($routeProvider , $locationProvider) {
      * even if the code has been minified */
            ['$scope','$location','$window','egCore','egLovefield',
     function($scope , $location , $window , egCore , egLovefield) {
-        egLovefield.havePendingOfflineXacts() .then(function(eh){
-            $scope.pendingXacts = eh;
-        });
+        egLovefield.havePendingOfflineXacts() .then(
+            function(eh){ $scope.pendingXacts = eh; },
+            function() {} // SharedWorker not supported
+        );
 
         $scope.focusMe = true;
         $scope.args = {};
diff --git a/Open-ILS/web/js/ui/default/staff/services/env.js b/Open-ILS/web/js/ui/default/staff/services/env.js
index 1406a19..cf768b1 100644
--- a/Open-ILS/web/js/ui/default/staff/services/env.js
+++ b/Open-ILS/web/js/ui/default/staff/services/env.js
@@ -135,9 +135,14 @@ function($q,  $window , $injector , egAuth,  egPCRUD,  egIDL) {
                 egLovefield = $injector.get('egLovefield');
             }
             //console.debug('About to cache a list of ' + class_ + ' objects...');
-            egLovefield.isCacheGood(class_).then(function(good) {
-                if (!good) egLovefield.setListInOfflineCache(class_, blob.list);
-            });
+            egLovefield.isCacheGood(class_).then(
+                function(good) {
+                    if (!good) {
+                        egLovefield.setListInOfflineCache(class_, blob.list); 
+                    }
+                },
+                function() {} // Not Supported
+            );
         }
 
         angular.forEach(list, function(item) {blob.map[item[pkey]()] = item});
@@ -198,7 +203,9 @@ function($q,  $window , $injector , egAuth,  egPCRUD,  egIDL) {
                         return $q.when();
                     }
                 );
-            });
+            },
+            function() {return $q.when()} // Not Supported, exit gracefully
+            );
         },
     };
 
diff --git a/Open-ILS/web/js/ui/default/staff/services/lovefield.js b/Open-ILS/web/js/ui/default/staff/services/lovefield.js
index 561f900..707f41a 100644
--- a/Open-ILS/web/js/ui/default/staff/services/lovefield.js
+++ b/Open-ILS/web/js/ui/default/staff/services/lovefield.js
@@ -27,7 +27,7 @@ angular.module('egCoreMod')
             // relative path would be better...
             service.worker = new SharedWorker(service.workerUrl);
         } catch (E) {
-            console.error('SharedWorker() not supported', E);
+            console.warn('SharedWorker() not supported', E);
             service.cannotConnect = true;
             return;
         }
@@ -65,12 +65,12 @@ angular.module('egCoreMod')
 
     service.connectToSchemas = function() {
 
+        service.connectToWorker(); // no-op if already connected
+
         if (service.cannotConnect) { 
             // This can happen in certain environments
             return $q.reject();
         }
-        
-        service.connectToWorker(); // no-op if already connected
 
         var promises = [];
 
diff --git a/Open-ILS/web/js/ui/default/staff/services/navbar.js b/Open-ILS/web/js/ui/default/staff/services/navbar.js
index 52c916f..dcc72de 100644
--- a/Open-ILS/web/js/ui/default/staff/services/navbar.js
+++ b/Open-ILS/web/js/ui/default/staff/services/navbar.js
@@ -6,9 +6,9 @@ angular.module('egCoreMod')
         transclude : true,
         templateUrl : 'eg-navbar-template',
         controller:['$scope','$window','$location','$timeout','hotkeys','$rootScope',
-                    'egCore','$uibModal','ngToast','egOpChange','$element',
+                    'egCore','$uibModal','ngToast','egOpChange','$element','egLovefield',
             function($scope , $window , $location , $timeout , hotkeys , $rootScope ,
-                     egCore , $uibModal , ngToast , egOpChange , $element) {
+                     egCore , $uibModal , ngToast , egOpChange , $element , egLovefield) {
 
                 $scope.rs = $rootScope;
 
@@ -102,6 +102,10 @@ angular.module('egCoreMod')
                     return true;
                 };
 
+                $scope.offlineDisabled = function() {
+                    return egLovefield.cannotConnect;
+                }
+
                 egCore.startup.go().then(
                     function() {
                         if (egCore.auth.user()) {
diff --git a/Open-ILS/web/js/ui/default/staff/services/org.js b/Open-ILS/web/js/ui/default/staff/services/org.js
index 17879ef..697a836 100644
--- a/Open-ILS/web/js/ui/default/staff/services/org.js
+++ b/Open-ILS/web/js/ui/default/staff/services/org.js
@@ -111,14 +111,16 @@ function($q,  egEnv,  egAuth,  egNet , $injector) {
         if (!angular.isArray(names)) names = [names];
 
         if (lf.isOffline) {
-            return egLovefield.getSettingsCache(names)
-                .then(function(settings) {
+            return egLovefield.getSettingsCache(names).then(
+                function(settings) {
                     var hash = {};
                     angular.forEach(settings, function (s) {
                         hash[s.name] = s.value;
                     });
                     return $q.when(hash);
-                });
+                },
+                function() {return $q.when({})} // Not Supported
+            );
         }
 
         var deferred = $q.defer();
@@ -153,11 +155,16 @@ function($q,  egEnv,  egAuth,  egNet , $injector) {
                 if (here) service.cachedSettings[key] = settings[key];
             });
 
-            return egLovefield.setSettingsCache(settings).then(function() {
-                // resolve with cached settings if 'here', since 'settings'
-                // will only contain settings we had to retrieve
-                deferred.resolve(here ? service.cachedSettings : settings);
-            });
+            return egLovefield.setSettingsCache(settings).then(
+                function() {
+                    // resolve with cached settings if 'here', since 'settings'
+                    // will only contain settings we had to retrieve
+                    deferred.resolve(here ? service.cachedSettings : settings);
+                },
+                function() {
+                    deferred.resolve(here ? service.cachedSettings : settings);
+                }
+            );
         });
         return deferred.promise;
     }
diff --git a/Open-ILS/web/js/ui/default/staff/services/ui.js b/Open-ILS/web/js/ui/default/staff/services/ui.js
index a2d6b3f..85b21ee 100644
--- a/Open-ILS/web/js/ui/default/staff/services/ui.js
+++ b/Open-ILS/web/js/ui/default/staff/services/ui.js
@@ -1099,8 +1099,8 @@ function($uibModal , $interpolate , egCore) {
            + '</ul>'
           + '</div>',
 
-        controller : ['$scope','$timeout','egCore','egStartup','egLovefield','$q',
-              function($scope , $timeout , egCore , egStartup , egLovefield , $q) {
+        controller : ['$scope','$timeout','egCore','egStartup','$q',
+              function($scope , $timeout , egCore , egStartup , $q) {
 
             if ($scope.alldisabled) {
                 $scope.disable_button = $scope.alldisabled == 'true' ? true : false;

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

Summary of changes:
 Open-ILS/src/templates/staff/css/style.css.tt2     |    3 ++
 Open-ILS/src/templates/staff/navbar.tt2            |    4 +-
 Open-ILS/web/js/ui/default/staff/app.js            |    7 +++--
 Open-ILS/web/js/ui/default/staff/services/env.js   |   15 +++++++++---
 .../web/js/ui/default/staff/services/lovefield.js  |   14 +++++++-----
 .../web/js/ui/default/staff/services/navbar.js     |    8 +++++-
 Open-ILS/web/js/ui/default/staff/services/org.js   |   23 +++++++++++++-------
 Open-ILS/web/js/ui/default/staff/services/ui.js    |    4 +-
 8 files changed, 51 insertions(+), 27 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list