diff --git a/src/scenario/scenario.js b/src/scenario/scenario.js index 76fead2..85fee67 100644 --- a/src/scenario/scenario.js +++ b/src/scenario/scenario.js @@ -30,7 +30,6 @@ import SimulatorStore from '../simulator/simulator-store'; import DashboardStore from '../dashboard/dashboard-store'; import SimulationModelStore from '../simulationmodel/simulation-model-store'; import UserStore from '../user/user-store'; -import UsersStore from '../user/users-store'; import AppDispatcher from '../common/app-dispatcher'; import Icon from '../common/icon'; @@ -45,7 +44,7 @@ import DeleteDialog from '../common/dialogs/delete-dialog'; class Scenario extends React.Component { static getStores() { - return [ ScenarioStore, SimulationModelStore, UsersStore, DashboardStore, SimulatorStore]; + return [ ScenarioStore, SimulationModelStore, DashboardStore, SimulatorStore]; } static calculateState(prevState, props) { @@ -61,12 +60,17 @@ class Scenario extends React.Component { }); } + // obtain all dashboards of a scenario + let dashboards = DashboardStore.getState().filter(dashb => dashb.scenarioID === parseInt(props.match.params.scenario, 10)); + + // obtain all simulation models of a scenario + let simulationmodels = SimulationModelStore.getState().filter(simmodel => simmodel.scenarioID === parseInt(props.match.params.scenario, 10)); + return { scenario, sessionToken, - simulationModels: SimulationModelStore.getState(), - users: UsersStore.getState(), - dashboards: DashboardStore.getState(), + simulationModels: simulationmodels, + dashboards: dashboards, simulators: SimulatorStore.getState(), deleteSimulationModelModal: false, @@ -97,14 +101,6 @@ class Scenario extends React.Component { param: '?scenarioID='+this.state.scenario.id, }); - // load users of selected scenario - AppDispatcher.dispatch({ - type: 'scenarios/start-load', - token: this.state.sessionToken, - data: this.state.scenario.id, - param: '/users' - }); - // load dashboards of selected scenario AppDispatcher.dispatch({ type: 'dashboards/start-load', @@ -321,9 +317,9 @@ class Scenario extends React.Component { this.onSimulationModelChecked(index, event)} width='30' /> - this.getSimulatorName(simulator)} /> - - + this.getSimulatorName(simulatorID)} /> + + Dashboards
- + this.closeDeleteDashboardModal(e)}/> - {/*Users table*/} -

Users

-
- - - -
- ; }