[open-ils-commits] [GIT] Evergreen ILS branch rel_3_2 updated. 14a6b09d55c975b3854cfd0720898e0308f39813
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_2 has been updated
via 14a6b09d55c975b3854cfd0720898e0308f39813 (commit)
via aa99255b39d8122054bc0646951c3212e44be506 (commit)
via 8f23343b76ebf8f556a5426b478c331698a3a2a6 (commit)
from b3fc4d63034434e31726ded935b80009d8c3e432 (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 14a6b09d55c975b3854cfd0720898e0308f39813
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 4a2cdd1..fbbbbb1 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 9914816..d82ca1f 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 aa99255b39d8122054bc0646951c3212e44be506
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 8f23343b76ebf8f556a5426b478c331698a3a2a6
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 1c47eb0..9914816 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 e7467e2..36c9ed2 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
+ );
}
@@ -156,11 +158,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 ed5f84f..59ff1c8 100644
--- a/Open-ILS/web/js/ui/default/staff/services/ui.js
+++ b/Open-ILS/web/js/ui/default/staff/services/ui.js
@@ -1086,8 +1086,8 @@ function($uibModal , $interpolate , egCore) {
templateUrl : './share/t_org_select',
- 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) {
// See emptyTypeahead directive below.
var secretEmptyKey = '_INTERNAL_';
-----------------------------------------------------------------------
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