X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fframework%2Fwidgets%2Fskyquake_container%2FskyquakeContainer.jsx;h=05a42db63cbd4e95b6cd97a7a98bc2c9745c368d;hb=83ebeec87b6e614f2b870e37326015a9ed468346;hp=d53d85f20aa5cef975b3ad946dbbc1d163d7babe;hpb=4ef8c40c2c013c21f5487330daeab2561ba25fb3;p=osm%2FUI.git diff --git a/skyquake/framework/widgets/skyquake_container/skyquakeContainer.jsx b/skyquake/framework/widgets/skyquake_container/skyquakeContainer.jsx index d53d85f20..05a42db63 100644 --- a/skyquake/framework/widgets/skyquake_container/skyquakeContainer.jsx +++ b/skyquake/framework/widgets/skyquake_container/skyquakeContainer.jsx @@ -18,7 +18,8 @@ import React from 'react'; import AltContainer from 'alt-container'; import Alt from './skyquakeAltInstance.js'; -import SkyquakeNav from './skyquakeNav.jsx'; + import _cloneDeep from 'lodash/cloneDeep'; +import SkyquakeNav from '../skyquake_nav/skyquakeNav.jsx'; import EventCenter from './eventCenter.jsx'; import SkyquakeContainerActions from './skyquakeContainerActions.js' import SkyquakeContainerStore from './skyquakeContainerStore.js'; @@ -39,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(); }); @@ -84,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 = ( @@ -106,13 +115,17 @@ export default class skyquakeContainer extends React.Component { type={notificationType} hidden={!(displayNotification && notificationMessage)} onDismiss={SkyquakeContainerActions.hideNotification} + timeout= {5000} /> - +
-

{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} @@ -129,6 +142,9 @@ export default class skyquakeContainer extends React.Component { return html; } } +skyquakeContainer.childContextTypes = { + userProfile: React.PropTypes.object +}; skyquakeContainer.contextTypes = { router: React.PropTypes.object };