var BindStore, BookLink, EcosystemsActions, EcosystemsStore, LoadableItem, QADashboard, React, RouteHandler, ref;
React = require('react');
RouteHandler = require('react-router').RouteHandler;
ref = require('../../flux/ecosystems'), EcosystemsStore = ref.EcosystemsStore, EcosystemsActions = ref.EcosystemsActions;
LoadableItem = require('../loadable-item');
BindStore = require('../bind-store-mixin');
BookLink = require('./book-link');
QADashboard = React.createClass({displayName: "QADashboard",
mixins: [BindStore],
bindStore: EcosystemsStore,
bindEvent: 'loaded',
componentWillMount: function() {
if (!EcosystemsStore.isLoading()) {
return EcosystemsActions.load();
}
},
contextTypes: {
router: React.PropTypes.func
},
render: function() {
var params;
if (EcosystemsStore.isLoaded()) {
params = _.clone(this.context.router.getCurrentParams());
if (params.ecosystemId == null) {
params.ecosystemId = "" + (EcosystemsStore.first().id);
}
return React.createElement(RouteHandler, React.__spread({}, params));
} else {
return React.createElement("h3", null, "Loading ...");
}
}
});
module.exports = QADashboard;
|