summaryrefslogtreecommitdiff
path: root/src/sagas/experiments.js
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-15 12:53:26 +0200
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-23 10:06:03 +0200
commita1d95b3685cffb6a9344d0d1e5505dd391193f16 (patch)
tree42851ec0726881dd9f82a3ea12a7987324a68ef8 /src/sagas/experiments.js
parentf604406453f95c82c3e5e4294a51245661868bbe (diff)
Implement experiment list and add
Diffstat (limited to 'src/sagas/experiments.js')
-rw-r--r--src/sagas/experiments.js32
1 files changed, 13 insertions, 19 deletions
diff --git a/src/sagas/experiments.js b/src/sagas/experiments.js
index 0ac919f4..2c5395e8 100644
--- a/src/sagas/experiments.js
+++ b/src/sagas/experiments.js
@@ -2,13 +2,7 @@ import {call, put, select} from "redux-saga/effects";
import {addPropToStoreObject, addToStore} from "../actions/objects";
import {deleteExperiment} from "../api/routes/experiments";
import {addExperiment, getExperimentsOfSimulation} from "../api/routes/simulations";
-import {
- fetchAndStoreAllJobs,
- fetchAndStoreAllSchedulers,
- fetchAndStoreAllTasks,
- fetchAndStoreAllTraces,
- fetchAndStorePathsOfSimulation
-} from "./objects";
+import {fetchAndStoreAllSchedulers, fetchAndStoreAllTraces, fetchAndStorePathsOfSimulation} from "./objects";
export function* onFetchExperimentsOfSimulation() {
try {
@@ -22,21 +16,18 @@ export function* onFetchExperimentsOfSimulation() {
yield put(addPropToStoreObject("simulation", currentSimulationId,
{experimentIds: experiments.map(experiment => experiment.id)}));
} catch (error) {
- console.log(error);
+ console.error(error);
}
}
function* fetchExperimentSpecifications() {
try {
const currentSimulationId = yield select(state => state.currentSimulationId);
-
yield fetchAndStorePathsOfSimulation(currentSimulationId);
- yield fetchAndStoreAllTasks();
- yield fetchAndStoreAllJobs();
yield fetchAndStoreAllTraces();
yield fetchAndStoreAllSchedulers();
} catch (error) {
- console.log(error);
+ console.error(error);
}
}
@@ -44,17 +35,20 @@ export function* onAddExperiment(action) {
try {
const currentSimulationId = yield select(state => state.currentSimulationId);
- const experiment = yield call(addExperiment, currentSimulationId, Object.assign({}, action.experiment, {
- id: -1,
- simulationId: currentSimulationId
- }));
+ const experiment = yield call(addExperiment,
+ currentSimulationId,
+ Object.assign({}, action.experiment, {
+ id: -1,
+ simulationId: currentSimulationId
+ })
+ );
yield put(addToStore("experiment", experiment));
- const experimentIds = yield select(state => state.objects.simulation[currentSimulationId]);
+ const experimentIds = (yield select(state => state.objects.simulation[currentSimulationId])).experimentIds;
yield put(addPropToStoreObject("simulation", currentSimulationId,
{experimentIds: experimentIds.concat([experiment.id])}));
} catch (error) {
- console.log(error);
+ console.error(error);
}
}
@@ -68,6 +62,6 @@ export function* onDeleteExperiment(action) {
yield put(addPropToStoreObject("simulation", currentSimulationId,
{experimentIds: experimentIds.filter(id => id !== action.id)}));
} catch (error) {
- console.log(error);
+ console.error(error);
}
}