Debug, logging, about added to ADMIN dropdown
authorLaurence Maultsby <laurence.maultsby@riftio.com>
Fri, 7 Apr 2017 13:17:58 +0000 (09:17 -0400)
committerLaurence Maultsby <laurence.maultsby@riftio.com>
Fri, 7 Apr 2017 13:17:58 +0000 (09:17 -0400)
Signed-off-by: Laurence Maultsby <laurence.maultsby@riftio.com>
skyquake/framework/core/modules/navigation_manager.js
skyquake/framework/widgets/skyquake_nav/skyquakeNav.jsx
skyquake/framework/widgets/skyquake_nav/skyquakeNav.scss
skyquake/plugins/about/config.json
skyquake/plugins/debug/config.json
skyquake/plugins/logging/config.json

index f690359..7d22394 100644 (file)
@@ -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() {
index a752bf6..1aaaf4d 100644 (file)
@@ -113,7 +113,7 @@ class UserNav extends React.Component {
         return (
             <div className="app">
                 <h2>
-                    {userProfileLink}
+                    USER: {userProfileLink}
                     <span className="oi" data-glyph="caret-bottom"></span>
                 </h2>
                 <ul className="menu">
@@ -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 = (
         <div className="secondaryNav" key="secondaryNav">
             {secondaryNav}
+            <div className="app admin">
+                <h2>
+                    <a>
+                        ADMIN <span className="oi" data-glyph="caret-bottom"></span>
+                    </a>
+                </h2>
+                <ul className="menu">
+                    {
+                        adminNav
+                    }
+                </ul>
+            </div>
             <SelectProject
                 onSelectProject={props.store.selectActiveProject}
                 projects={props.projects}
@@ -298,7 +311,14 @@ export function buildNav(nav, currentPlugin, props) {
             NavList = nav[k].routes.map(buildNavListItem.bind(self, k));
             navItem.priority = nav[k].priority;
             navItem.order = nav[k].order;
-            navItem.html = (
+            if(nav[k].admin_link) {
+                adminNav.push((
+                    <li key={nav[k].name}>
+                        {dashboardLink}
+                    </li>
+                ))
+            } else {
+                            navItem.html = (
                 <SkyquakeRBAC allow={nav[k].allow || ['*']} key={k} className={navClass}>
                     <h2>{dashboardLink} {self.hasSubNav[k] ? <span className="oi" data-glyph="caret-bottom"></span> : ''}</h2>
                     <ul className="menu">
@@ -309,6 +329,8 @@ export function buildNav(nav, currentPlugin, props) {
                 </SkyquakeRBAC>
             );
             navList.push(navItem)
+            }
+
         }
     }
     //Sorts nav items by order and returns only the markup
index 5269be9..c31dd7a 100644 (file)
@@ -23,7 +23,7 @@
         }
         .app {
             position:relative;
-            margin:auto;
+            margin: auto 0.5rem;
             h2 {
                 font-size:0.75rem;
                 border-right: 1px solid black;
index 1100c71..1885a9c 100644 (file)
@@ -4,6 +4,7 @@
     "dashboard": "./about.jsx",
     "order": 99,
     "priority":2,
+    "admin_link": true,
      "routes" : [{
         "label": "Dashboard",
         "route": "/",
index 6643aca..b27dd6b 100644 (file)
@@ -4,6 +4,7 @@
     "dashboard": "./crash.jsx",
     "order": 100,
     "priority":2,
+    "admin_link": true,
     "routes" : [{
         "label": "Debug",
         "route": "/",
index f68358d..7c43dc0 100644 (file)
@@ -4,6 +4,7 @@
     "dashboard": "./loggingGeneral.jsx",
     "order": 101,
     "priority":2,
+    "admin_link": true,
     "routes": [
         {
             "label": "Logging",