1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-16 00:00:03 +01:00

extract ICs that are used by the scenario

This commit is contained in:
Sonja Happ 2020-04-27 12:53:10 +02:00
parent a2869d3256
commit 1745a0bd68

View file

@ -68,15 +68,28 @@ class Scenario extends React.Component {
let signals = SignalStore.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 {
scenario,
sessionToken,
configs: configs,
configs,
dashboards,
signals,
files,
ics: ICStore.getState(),
icsUsed,
deleteConfigModal: false,
importConfigModal: false,
@ -118,7 +131,7 @@ class Scenario extends React.Component {
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({
type: 'ics/start-load',
token: this.state.sessionToken,