From b4bdf9fde013bb7ff9579693b64ff575f7b00e44 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Tue, 7 Jul 2020 09:55:10 +0200 Subject: Rename simulations to projects and remove experiment view --- frontend/src/sagas/simulations.js | 43 --------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 frontend/src/sagas/simulations.js (limited to 'frontend/src/sagas/simulations.js') diff --git a/frontend/src/sagas/simulations.js b/frontend/src/sagas/simulations.js deleted file mode 100644 index be69fedd..00000000 --- a/frontend/src/sagas/simulations.js +++ /dev/null @@ -1,43 +0,0 @@ -import { call, put } from 'redux-saga/effects' -import { addToStore } from '../actions/objects' -import { addSimulationSucceeded, deleteSimulationSucceeded } from '../actions/simulations' -import { addSimulation, deleteSimulation, getSimulation } from '../api/routes/simulations' -import { fetchAndStoreAllTopologiesOfSimulation } from './topology' - -export function* onOpenSimulationSucceeded(action) { - try { - const simulation = yield call(getSimulation, action.id) - yield put(addToStore('simulation', simulation)) - - yield fetchAndStoreAllTopologiesOfSimulation(action.id) - } catch (error) { - console.error(error) - } -} - -export function* onSimulationAdd(action) { - try { - const simulation = yield call(addSimulation, { name: action.name }) - yield put(addToStore('simulation', simulation)) - - const authorization = { - simulationId: simulation._id, - userId: action.userId, - authorizationLevel: 'OWN', - simulation, - } - yield put(addToStore('authorization', authorization)) - yield put(addSimulationSucceeded([authorization.userId, authorization.simulationId])) - } catch (error) { - console.error(error) - } -} - -export function* onSimulationDelete(action) { - try { - yield call(deleteSimulation, action.id) - yield put(deleteSimulationSucceeded(action.id)) - } catch (error) { - console.error(error) - } -} -- cgit v1.2.3