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';
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();
});
render() {
const {displayNotification, notificationMessage, displayScreenLoader, notificationType, ...state} = this.state;
var html;
-
+ let nav = _.cloneDeep(this.state.nav);
if (this.matchesLoginUrl()) {
html = (
<AltContainer>
type={notificationType}
hidden={!(displayNotification && notificationMessage)}
onDismiss={SkyquakeContainerActions.hideNotification}
+ timeout= {5000}
/>
<ScreenLoader show={displayScreenLoader}/>
- <SkyquakeNav nav={this.state.nav}
- currentPlugin={this.state.currentPlugin}
+ <SkyquakeNav nav={nav}
+ currentPlugin={this.state.user.currentPlugin}
+ currentUser={this.state.user.userId}
+ currentProject={this.state.user.projectId}
store={SkyquakeContainerStore}
projects={this.state.projects} />
<div className="titleBar">
return html;
}
}
+skyquakeContainer.childContextTypes = {
+ userProfile: React.PropTypes.object
+};
skyquakeContainer.contextTypes = {
router: React.PropTypes.object
};