From: Bill Erickson Date: Thu, 17 Nov 2016 20:33:02 +0000 (-0500) Subject: LP#1564508 Hatch status in hamburger, remove statusbar X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7814064a1a4c21094017f4b553e91c879c5e100d;p=evergreen%2Ftadl.git LP#1564508 Hatch status in hamburger, remove statusbar * Move the Hatch connectivity status indicator into the upper-right hamburger menu. * Removes the long-hidden hatch/websockets statusbar. * Since the Hamburger forces a re-digest of the interface when opened, the code no longer attempts to force the page to re-$apply() when the Hatch connection opens or closes. It's no longer necesssary (and was buggy). * The WebSockets connectivity status is not added to the hamburger. The websockets connection will go up and down regularly as connections expire and reset. Having the indicator flash could lead to unneccesary panic. Plus, if websockets are down, staff can't log in anyway. Signed-off-by: Bill Erickson Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/templates/staff/base.tt2 b/Open-ILS/src/templates/staff/base.tt2 index 445b1aded8..f279759969 100644 --- a/Open-ILS/src/templates/staff/base.tt2 +++ b/Open-ILS/src/templates/staff/base.tt2 @@ -42,9 +42,6 @@
[% content %]
[% - # status bar along bottom of page - INCLUDE "staff/statusbar.tt2"; - # script imports INCLUDE "staff/base_js.tt2"; diff --git a/Open-ILS/src/templates/staff/base_js.tt2 b/Open-ILS/src/templates/staff/base_js.tt2 index 06f8bc4a80..82b662e432 100644 --- a/Open-ILS/src/templates/staff/base_js.tt2 +++ b/Open-ILS/src/templates/staff/base_js.tt2 @@ -42,7 +42,6 @@ - diff --git a/Open-ILS/src/templates/staff/css/style.css.tt2 b/Open-ILS/src/templates/staff/css/style.css.tt2 index bdfd64dd5a..eff1037b0d 100644 --- a/Open-ILS/src/templates/staff/css/style.css.tt2 +++ b/Open-ILS/src/templates/staff/css/style.css.tt2 @@ -27,31 +27,8 @@ border-bottom-color: #ddd; } -/* status bar along the bottom of the page ------------------------ */ -/* decrease padding to decrease overall height */ - -/** TODO:move status bar items into navbar config entry (top-right) - * to avoid body padding weirdness. Or if we want a permenently - * visible status bar, maybe put it just below the navbar.. */ - -/* bottom padding ensures no body content is hidden behind the status - * bar. When content reaches the status bar a scroll bar appears */ -/*body { padding-bottom: 26px; }*/ - -#status-bar { - min-height:1.8em !important; -} -#status-bar > ul { - margin-right:6px; -} -#status-bar li { - padding-left: 10px; -} -#status-bar > li > a { - padding-top:5px !important; - padding-bottom:5px !important; -} -.status-bar-connected { +/* Hatch / WebSockets / Etc. connectivity status indicator */ +.connect-status-ok { color: rgb(92, 184, 92); /* success */ } diff --git a/Open-ILS/src/templates/staff/navbar.tt2 b/Open-ILS/src/templates/staff/navbar.tt2 index 8d593b912f..65bef579ee 100644 --- a/Open-ILS/src/templates/staff/navbar.tt2 +++ b/Open-ILS/src/templates/staff/navbar.tt2 @@ -491,6 +491,17 @@ [% l('Log Out') %] +
  • +
  • + + + + [% l('Hatch') %] + +
  • diff --git a/Open-ILS/src/templates/staff/statusbar.tt2 b/Open-ILS/src/templates/staff/statusbar.tt2 deleted file mode 100644 index 1153223ee8..0000000000 --- a/Open-ILS/src/templates/staff/statusbar.tt2 +++ /dev/null @@ -1,41 +0,0 @@ - - - diff --git a/Open-ILS/web/js/ui/default/staff/Gruntfile.js b/Open-ILS/web/js/ui/default/staff/Gruntfile.js index b35584a1af..e5941960fa 100644 --- a/Open-ILS/web/js/ui/default/staff/Gruntfile.js +++ b/Open-ILS/web/js/ui/default/staff/Gruntfile.js @@ -165,7 +165,6 @@ module.exports = function(grunt) { 'services/audio.js', 'services/coresvc.js', 'services/navbar.js', - 'services/statusbar.js', 'services/ui.js', 'services/date.js', 'services/op_change.js', 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 c7bb4edfa9..713d9f39ec 100644 --- a/Open-ILS/web/js/ui/default/staff/services/navbar.js +++ b/Open-ILS/web/js/ui/default/staff/services/navbar.js @@ -99,6 +99,11 @@ angular.module('egCoreMod') return egCore.auth.token(); } + // Returns true if the browser is connected to Hatch + $scope.hatchConnected = function() { + return egCore.hatch.hatchAvailable; + } + // tied to logout link $scope.logout = function() { egCore.auth.logout(); diff --git a/Open-ILS/web/js/ui/default/staff/services/statusbar.js b/Open-ILS/web/js/ui/default/staff/services/statusbar.js deleted file mode 100644 index 8c7d1162fa..0000000000 --- a/Open-ILS/web/js/ui/default/staff/services/statusbar.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - * egStatusBar - * - * Displays key information and messages to the user. - * - * Currently displays network connection status, egHatch connection - * status, and messages delivered via - * $scope.$emit('egStatusBarMessage', msg) - */ - -angular.module('egCoreMod') - -.directive('egStatusBar', function() { - return { - restrict : 'AE', - replace : true, - templateUrl : 'eg-status-bar-template', - scope : { }, - controller : [ - '$scope','$rootScope','egHatch', - function($scope , $rootScope , egHatch) { - $scope.messages = []; // keep a log of recent messages - - $scope.netConnected = function() { - // TODO: should should be abstracted through egNet - return OpenSRF.websocketConnected(); - } - - // update the UI whenever we lose connection - OpenSRF.onWebSocketClosed = function() { - $scope.$apply(); - } - - $scope.hatchConnected = function() { - return egHatch.hatchAvailable; - } - - // update the UI whenever we lose connection - egHatch.onHatchClose = function() { - $scope.$apply(); - } - - // update the UI whenever we lose connection - egHatch.onHatchOpen = function() { - $scope.$apply(); - } - - $scope.hatchConnect = function() { - egHatch.hatchConnect(); - } - - $rootScope.$on('egStatusBarMessage', function(evt, args) { - $scope.messages.unshift(args); - - // ensure the list does not exceed 10 messages - // TODO: configurable? - $scope.messages.splice(10, 1); - }); - }] - } -}); diff --git a/Open-ILS/web/js/ui/default/staff/test/karma.conf.js b/Open-ILS/web/js/ui/default/staff/test/karma.conf.js index 4da4e66f30..87d673130d 100644 --- a/Open-ILS/web/js/ui/default/staff/test/karma.conf.js +++ b/Open-ILS/web/js/ui/default/staff/test/karma.conf.js @@ -42,7 +42,6 @@ module.exports = function(config){ 'services/user.js', 'services/startup.js', 'services/ui.js', - 'services/statusbar.js', 'services/grid.js', 'services/op_change.js', 'services/navbar.js', 'services/date.js',