From a81c177c80a2428371b00015fbc9e3837f33fea8 Mon Sep 17 00:00:00 2001 From: Laurence Maultsby Date: Fri, 7 Apr 2017 09:17:58 -0400 Subject: [PATCH] Debug, logging, about added to ADMIN dropdown Signed-off-by: Laurence Maultsby --- .../core/modules/navigation_manager.js | 8 ++++++ .../widgets/skyquake_nav/skyquakeNav.jsx | 26 +++++++++++++++++-- .../widgets/skyquake_nav/skyquakeNav.scss | 2 +- skyquake/plugins/about/config.json | 1 + skyquake/plugins/debug/config.json | 1 + skyquake/plugins/logging/config.json | 1 + 6 files changed, 36 insertions(+), 3 deletions(-) diff --git a/skyquake/framework/core/modules/navigation_manager.js b/skyquake/framework/core/modules/navigation_manager.js index f6903591c..7d2239459 100644 --- a/skyquake/framework/core/modules/navigation_manager.js +++ b/skyquake/framework/core/modules/navigation_manager.js @@ -75,6 +75,13 @@ function addAllow(plugin_name, allow) { NAVIGATION[plugin_name].allow = allow || '*'; } +function addAdminFlag(plugin_name, admin_link) { + if (!NAVIGATION[plugin_name]) { + NAVIGATION[plugin_name] = {}; + } + NAVIGATION[plugin_name].admin_link = admin_link || false; +} + function getNavigation() { return NAVIGATION; } @@ -89,6 +96,7 @@ function onNavigationDiscovered(plugin_name, plugin) { addPriority(plugin_name, plugin.priority); addLabel(plugin_name, plugin.name); addAllow(plugin_name, plugin.allow); + addAdminFlag(plugin_name, plugin.admin_link); } function init() { diff --git a/skyquake/framework/widgets/skyquake_nav/skyquakeNav.jsx b/skyquake/framework/widgets/skyquake_nav/skyquakeNav.jsx index a752bf665..1aaaf4d45 100644 --- a/skyquake/framework/widgets/skyquake_nav/skyquakeNav.jsx +++ b/skyquake/framework/widgets/skyquake_nav/skyquakeNav.jsx @@ -113,7 +113,7 @@ class UserNav extends React.Component { return (

- {userProfileLink} + USER: {userProfileLink}

    @@ -257,11 +257,24 @@ export function buildNav(nav, currentPlugin, props) { let navList = []; let navListHTML = []; let secondaryNav = []; + let adminNav = []; let self = this; self.hasSubNav = {}; let secondaryNavHTML = (
    {secondaryNav} +
    +

    + + ADMIN + +

    +
      + { + adminNav + } +
    +
    + {dashboardLink} + + )) + } else { + navItem.html = (

    {dashboardLink} {self.hasSubNav[k] ? : ''}

      @@ -309,6 +329,8 @@ export function buildNav(nav, currentPlugin, props) { ); navList.push(navItem) + } + } } //Sorts nav items by order and returns only the markup diff --git a/skyquake/framework/widgets/skyquake_nav/skyquakeNav.scss b/skyquake/framework/widgets/skyquake_nav/skyquakeNav.scss index 5269be9e0..c31dd7abb 100644 --- a/skyquake/framework/widgets/skyquake_nav/skyquakeNav.scss +++ b/skyquake/framework/widgets/skyquake_nav/skyquakeNav.scss @@ -23,7 +23,7 @@ } .app { position:relative; - margin:auto; + margin: auto 0.5rem; h2 { font-size:0.75rem; border-right: 1px solid black; diff --git a/skyquake/plugins/about/config.json b/skyquake/plugins/about/config.json index 1100c714d..1885a9c1c 100644 --- a/skyquake/plugins/about/config.json +++ b/skyquake/plugins/about/config.json @@ -4,6 +4,7 @@ "dashboard": "./about.jsx", "order": 99, "priority":2, + "admin_link": true, "routes" : [{ "label": "Dashboard", "route": "/", diff --git a/skyquake/plugins/debug/config.json b/skyquake/plugins/debug/config.json index 6643acab3..b27dd6b07 100644 --- a/skyquake/plugins/debug/config.json +++ b/skyquake/plugins/debug/config.json @@ -4,6 +4,7 @@ "dashboard": "./crash.jsx", "order": 100, "priority":2, + "admin_link": true, "routes" : [{ "label": "Debug", "route": "/", diff --git a/skyquake/plugins/logging/config.json b/skyquake/plugins/logging/config.json index f68358d66..7c43dc0a0 100644 --- a/skyquake/plugins/logging/config.json +++ b/skyquake/plugins/logging/config.json @@ -4,6 +4,7 @@ "dashboard": "./loggingGeneral.jsx", "order": 101, "priority":2, + "admin_link": true, "routes": [ { "label": "Logging", -- 2.25.1