X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fframework%2Fwidgets%2Fskyquake_container%2FskyquakeContainer.jsx;h=8b61f4b6caf0cf835b20e5432094ba91e8ce4d86;hp=b8d768c2af5de12849dcf65f5a59a0238741a717;hb=2da8b7a246ba17396c5bc218a0b7f1685fb8d304;hpb=abf00ef39ee93f2a7ff05a4432eb3a50a88a487e diff --git a/skyquake/framework/widgets/skyquake_container/skyquakeContainer.jsx b/skyquake/framework/widgets/skyquake_container/skyquakeContainer.jsx index b8d768c2a..8b61f4b6c 100644 --- a/skyquake/framework/widgets/skyquake_container/skyquakeContainer.jsx +++ b/skyquake/framework/widgets/skyquake_container/skyquakeContainer.jsx @@ -24,7 +24,6 @@ import SkyquakeContainerActions from './skyquakeContainerActions.js' import SkyquakeContainerStore from './skyquakeContainerStore.js'; // import Breadcrumbs from 'react-breadcrumbs'; import Utils from 'utils/utils.js'; -import _ from 'lodash'; import Crouton from 'react-crouton'; import ScreenLoader from 'widgets/screen-loader/screenLoader.jsx'; import './skyquakeApp.scss'; @@ -40,13 +39,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 +92,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 = ( @@ -107,10 +114,13 @@ export default class skyquakeContainer extends React.Component { type={notificationType} hidden={!(displayNotification && notificationMessage)} onDismiss={SkyquakeContainerActions.hideNotification} + timeout= {5000} /> -
@@ -131,6 +141,9 @@ export default class skyquakeContainer extends React.Component { return html; } } +skyquakeContainer.childContextTypes = { + userProfile: React.PropTypes.object +}; skyquakeContainer.contextTypes = { router: React.PropTypes.object };