NIFI-655:
- Ensuring the logout link is rendered when appropriate.

Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/c659485e
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/c659485e
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/c659485e

Branch: refs/heads/NIFI-655
Commit: c659485ee433271ed8bdac37b5e42b32afcf0feb
Parents: 749f4e9
Author: Matt Gilman <[email protected]>
Authored: Fri Nov 13 16:35:29 2015 -0500
Committer: Matt Gilman <[email protected]>
Committed: Fri Nov 13 16:35:29 2015 -0500

----------------------------------------------------------------------
 .../nifi-web-ui/src/main/webapp/js/nf/nf-common.js | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/c659485e/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js
index a2ff680..53128b9 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js
@@ -64,9 +64,10 @@ $(document).ready(function () {
     // initialize the tooltips
     $('img.setting-icon').qtip(nf.Common.config.tooltipConfig);
     
-    // shows the logout link in the message-pane when appropriate
-    if (nf.Storage.getItem('jwt')) {
+    // shows the logout link in the message-pane when appropriate and schedule 
token refresh
+    if (nf.Storage.getItem('jwt') !== null) {
         $('#user-logout-container').show();
+        nf.Common.scheduleTokenRefresh();
     }
     
     // handle logout
@@ -74,11 +75,6 @@ $(document).ready(function () {
         nf.Storage.removeItem('jwt');
         window.location = '/nifi/login';
     });
-    
-    // schedule token refresh when a token is present
-    if (nf.Storage.getItem('jwt') !== null) {
-        nf.Common.scheduleTokenRefresh();
-    }
 });
 
 // Define a common utility class used across the entire application.
@@ -412,6 +408,13 @@ nf.Common = (function () {
                 if ($('#splash').is(':visible')) {
                     nf.Canvas.hideSplash();
                 }
+                
+                // update the log out link accordingly
+                if (nf.Storage.getItem('jwt') === null) {
+                    $('#user-logout-container').hide();
+                } else {
+                    $('#user-logout-container').show();
+                }
 
                 // hide the context menu
                 nf.ContextMenu.hide();

Reply via email to