blob: 13aed74d2e0b5cd8e1e2612b2d547bdba5f0ec87 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
import {connect} from "react-redux";
import {addExperiment} from "../../actions/experiments";
import {closeNewExperimentModal} from "../../actions/modals/experiments";
import NewExperimentModalComponent from "../../components/modals/custom-components/NewExperimentModalComponent";
const mapStateToProps = state => {
return {
show: state.modals.newExperimentModalVisible,
paths: Object.values(state.objects.path).filter(path => path.simulationId === state.currentSimulationId),
traces: Object.values(state.objects.trace),
schedulers: Object.values(state.objects.scheduler),
};
};
const mapDispatchToProps = dispatch => {
return {
callback: (name, pathId, traceId, schedulerName) => {
if (name) {
dispatch(addExperiment({
name,
pathId,
traceId,
schedulerName
}));
}
dispatch(closeNewExperimentModal());
}
};
};
const NewExperimentModal = connect(
mapStateToProps,
mapDispatchToProps
)(NewExperimentModalComponent);
export default NewExperimentModal;
|