X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fframework%2Fwidgets%2Fskyquake_container%2FskyquakeContainer.jsx;h=6347c8f6b01ffb38671af091873efa85b572b3bf;hb=54e4cde9338a0c798477422905cdd3b194d33a42;hp=53a382febc670ce343a320440195da8c1a3f1869;hpb=d1f2a7f4631cca78b7dfc744aae1beb3123c5698;p=osm%2FUI.git diff --git a/skyquake/framework/widgets/skyquake_container/skyquakeContainer.jsx b/skyquake/framework/widgets/skyquake_container/skyquakeContainer.jsx index 53a382feb..6347c8f6b 100644 --- a/skyquake/framework/widgets/skyquake_container/skyquakeContainer.jsx +++ b/skyquake/framework/widgets/skyquake_container/skyquakeContainer.jsx @@ -18,11 +18,11 @@ import React from 'react'; import AltContainer from 'alt-container'; import Alt from './skyquakeAltInstance.js'; -import SkyquakeNav from './skyquakeNav.jsx'; +import SkyquakeNav from '../skyquake_nav/skyquakeNav.jsx'; import EventCenter from './eventCenter.jsx'; import SkyquakeContainerActions from './skyquakeContainerActions.js' import SkyquakeContainerStore from './skyquakeContainerStore.js'; -import Breadcrumbs from 'react-breadcrumbs'; +// import Breadcrumbs from 'react-breadcrumbs'; import Utils from 'utils/utils.js'; import _ from 'lodash'; import Crouton from 'react-crouton'; @@ -40,13 +40,21 @@ export default class skyquakeContainer extends React.Component { this.state.eventCenterIsOpen = false; this.state.currentPlugin = SkyquakeContainerStore.currentPlugin; } - + getChildContext() { + return { + userProfile: this.state.user + }; + } + getUserProfile() { + return this.state.user; + } componentWillMount() { let self = this; Utils.bootstrapApplication().then(function() { SkyquakeContainerStore.listen(self.listener); SkyquakeContainerStore.getNav(); + SkyquakeContainerStore.getUserProfile(); SkyquakeContainerStore.getEventStreams(); }); @@ -85,7 +93,7 @@ export default class skyquakeContainer extends React.Component { render() { const {displayNotification, notificationMessage, displayScreenLoader, notificationType, ...state} = this.state; var html; - + let nav = _.cloneDeep(this.state.nav); if (this.matchesLoginUrl()) { html = ( @@ -109,11 +117,14 @@ export default class skyquakeContainer extends React.Component { onDismiss={SkyquakeContainerActions.hideNotification} /> - +
-

{this.state.currentPlugin + tag}

+

{(this.state.nav.name ? this.state.nav.name.replace('_', ' ').replace('-', ' ') : this.state.currentPlugin && this.state.currentPlugin.replace('_', ' ').replace('-', ' ')) + tag}

{this.props.children} @@ -130,6 +141,9 @@ export default class skyquakeContainer extends React.Component { return html; } } +skyquakeContainer.childContextTypes = { + userProfile: React.PropTypes.object +}; skyquakeContainer.contextTypes = { router: React.PropTypes.object };