Commit 1745a0bd authored by Sonja Happ's avatar Sonja Happ

extract ICs that are used by the scenario

parent a2869d32
...@@ -68,15 +68,28 @@ class Scenario extends React.Component { ...@@ -68,15 +68,28 @@ class Scenario extends React.Component {
let signals = SignalStore.getState(); let signals = SignalStore.getState();
let files = FileStore.getState(); let files = FileStore.getState();
// apply filter to contain only ICs that are used by configs
let icsUsed = ICStore.getState().filter(ic => {
let ICused = false;
for (let config of configs){
if (ic.id === config.icID){
ICused = true;
break;
}
}
return ICused;
});
return { return {
scenario, scenario,
sessionToken, sessionToken,
configs: configs, configs,
dashboards, dashboards,
signals, signals,
files, files,
ics: ICStore.getState(), ics: ICStore.getState(),
icsUsed,
deleteConfigModal: false, deleteConfigModal: false,
importConfigModal: false, importConfigModal: false,
...@@ -118,7 +131,7 @@ class Scenario extends React.Component { ...@@ -118,7 +131,7 @@ class Scenario extends React.Component {
param: '?scenarioID='+this.state.scenario.id, param: '?scenarioID='+this.state.scenario.id,
}); });
// load ICs to enable that component configs work with them // load ICs to enable that component configs and dashboards work with them
AppDispatcher.dispatch({ AppDispatcher.dispatch({
type: 'ics/start-load', type: 'ics/start-load',
token: this.state.sessionToken, token: this.state.sessionToken,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment