X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fframework%2Fwidgets%2Fskyquake_nav%2FskyquakeNav.jsx;h=99d14829244bd57c550c730a5ce0daab44e1ff9b;hp=a61ee541b6bf9d952af32a120bf5d13f3fbc6586;hb=9be8b4847b580cea9e28d2f2a02166753c29b58e;hpb=5fe8f677ae26b665ef8239086e520da56f675939 diff --git a/skyquake/framework/widgets/skyquake_nav/skyquakeNav.jsx b/skyquake/framework/widgets/skyquake_nav/skyquakeNav.jsx index a61ee541b..99d148292 100644 --- a/skyquake/framework/widgets/skyquake_nav/skyquakeNav.jsx +++ b/skyquake/framework/widgets/skyquake_nav/skyquakeNav.jsx @@ -25,9 +25,11 @@ import 'style/common.scss'; import './skyquakeNav.scss'; import SelectOption from '../form_controls/selectOption.jsx'; import {FormSection} from '../form_controls/formControls.jsx'; +import {isRBACValid, SkyquakeRBAC} from 'widgets/skyquake_rbac/skyquakeRBAC.jsx'; //Temporary, until api server is on same port as webserver -var rw = require('utils/rw.js'); +import rw from 'utils/rw.js'; + var API_SERVER = rw.getSearchParams(window.location).api_server; var UPLOAD_SERVER = rw.getSearchParams(window.location).upload_server; @@ -35,23 +37,6 @@ var UPLOAD_SERVER = rw.getSearchParams(window.location).upload_server; // Internal classes/functions // -class LogoutAppMenuItem extends React.Component { - handleLogout() { - Utils.clearAuthentication(); - } - render() { - return ( -
-

- - Logout - -

-
- ); - } -} - class SelectProject extends React.Component { constructor(props) { super(props); @@ -63,21 +48,28 @@ class SelectProject extends React.Component { render() { let props = this.props; let currentValue = JSON.stringify(props.currentProject); - let projects = this.props.projects.map((p,i) => { + let projects = this.props.projects && this.props.projects.map((p,i) => { return { label: p.name, value: p.name } }); + let hasProjects = (this.props.projects && (this.props.projects.length > 0)) return (
- Project: - + { + hasProjects ? 'Project:' : 'No Projects Assigned' + } + { + hasProjects ? + + : null + }
) } @@ -96,12 +88,16 @@ class UserNav extends React.Component { } render() { let props = this.props; + let userProfileLink = ''; + this.props.nav['user_management'] && this.props.nav['user_management'].routes.map((r) => { + if(r.unique) { + userProfileLink = returnLinkItem(r, props.currentUser) + } + }) return (

- - {props.currentUser} - + USER: {userProfileLink}