diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-07-07 09:55:10 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:47:25 +0200 |
| commit | b4bdf9fde013bb7ff9579693b64ff575f7b00e44 (patch) | |
| tree | 5e05ceba918849391a639bbeeab37d290a86523c /frontend/src/actions | |
| parent | 7331e9baf2cfe7bdfb24effcf0a4801da1e7ea4d (diff) | |
Rename simulations to projects and remove experiment view
Diffstat (limited to 'frontend/src/actions')
| -rw-r--r-- | frontend/src/actions/experiments.js | 12 | ||||
| -rw-r--r-- | frontend/src/actions/modals/projects.js | 14 | ||||
| -rw-r--r-- | frontend/src/actions/modals/simulations.js | 14 | ||||
| -rw-r--r-- | frontend/src/actions/projects.js | 52 | ||||
| -rw-r--r-- | frontend/src/actions/simulation/load-metric.js | 8 | ||||
| -rw-r--r-- | frontend/src/actions/simulation/playback.js | 15 | ||||
| -rw-r--r-- | frontend/src/actions/simulation/tick.js | 25 | ||||
| -rw-r--r-- | frontend/src/actions/simulations.js | 52 | ||||
| -rw-r--r-- | frontend/src/actions/states.js | 9 |
9 files changed, 72 insertions, 129 deletions
diff --git a/frontend/src/actions/experiments.js b/frontend/src/actions/experiments.js index 5d384abf..dce48a09 100644 --- a/frontend/src/actions/experiments.js +++ b/frontend/src/actions/experiments.js @@ -1,12 +1,12 @@ -export const FETCH_EXPERIMENTS_OF_SIMULATION = 'FETCH_EXPERIMENTS_OF_SIMULATION' +export const FETCH_EXPERIMENTS_OF_PROJECT = 'FETCH_EXPERIMENTS_OF_PROJECT' export const ADD_EXPERIMENT = 'ADD_EXPERIMENT' export const DELETE_EXPERIMENT = 'DELETE_EXPERIMENT' export const OPEN_EXPERIMENT_SUCCEEDED = 'OPEN_EXPERIMENT_SUCCEEDED' -export function fetchExperimentsOfSimulation(simulationId) { +export function fetchExperimentsOfProject(projectId) { return { - type: FETCH_EXPERIMENTS_OF_SIMULATION, - simulationId, + type: FETCH_EXPERIMENTS_OF_PROJECT, + projectId, } } @@ -24,10 +24,10 @@ export function deleteExperiment(id) { } } -export function openExperimentSucceeded(simulationId, experimentId) { +export function openExperimentSucceeded(projectId, experimentId) { return { type: OPEN_EXPERIMENT_SUCCEEDED, - simulationId, + projectId, experimentId, } } diff --git a/frontend/src/actions/modals/projects.js b/frontend/src/actions/modals/projects.js new file mode 100644 index 00000000..d1043cbb --- /dev/null +++ b/frontend/src/actions/modals/projects.js @@ -0,0 +1,14 @@ +export const OPEN_NEW_PROJECT_MODAL = 'OPEN_NEW_PROJECT_MODAL' +export const CLOSE_NEW_PROJECT_MODAL = 'CLOSE_PROJECT_MODAL' + +export function openNewProjectModal() { + return { + type: OPEN_NEW_PROJECT_MODAL, + } +} + +export function closeNewProjectModal() { + return { + type: CLOSE_NEW_PROJECT_MODAL, + } +} diff --git a/frontend/src/actions/modals/simulations.js b/frontend/src/actions/modals/simulations.js deleted file mode 100644 index 0ef1cbaa..00000000 --- a/frontend/src/actions/modals/simulations.js +++ /dev/null @@ -1,14 +0,0 @@ -export const OPEN_NEW_SIMULATION_MODAL = 'OPEN_NEW_SIMULATION_MODAL' -export const CLOSE_NEW_SIMULATION_MODAL = 'CLOSE_SIMULATION_MODAL' - -export function openNewSimulationModal() { - return { - type: OPEN_NEW_SIMULATION_MODAL, - } -} - -export function closeNewSimulationModal() { - return { - type: CLOSE_NEW_SIMULATION_MODAL, - } -} diff --git a/frontend/src/actions/projects.js b/frontend/src/actions/projects.js new file mode 100644 index 00000000..add0f242 --- /dev/null +++ b/frontend/src/actions/projects.js @@ -0,0 +1,52 @@ +export const SET_AUTH_VISIBILITY_FILTER = 'SET_AUTH_VISIBILITY_FILTER' +export const ADD_PROJECT = 'ADD_PROJECT' +export const ADD_PROJECT_SUCCEEDED = 'ADD_PROJECT_SUCCEEDED' +export const DELETE_PROJECT = 'DELETE_PROJECT' +export const DELETE_PROJECT_SUCCEEDED = 'DELETE_PROJECT_SUCCEEDED' +export const OPEN_PROJECT_SUCCEEDED = 'OPEN_PROJECT_SUCCEEDED' + +export function setAuthVisibilityFilter(filter) { + return { + type: SET_AUTH_VISIBILITY_FILTER, + filter, + } +} + +export function addProject(name) { + return (dispatch, getState) => { + const { auth } = getState() + dispatch({ + type: ADD_PROJECT, + name, + userId: auth.userId, + }) + } +} + +export function addProjectSucceeded(authorization) { + return { + type: ADD_PROJECT_SUCCEEDED, + authorization, + } +} + +export function deleteProject(id) { + return { + type: DELETE_PROJECT, + id, + } +} + +export function deleteProjectSucceeded(id) { + return { + type: DELETE_PROJECT_SUCCEEDED, + id, + } +} + +export function openProjectSucceeded(id) { + return { + type: OPEN_PROJECT_SUCCEEDED, + id, + } +} diff --git a/frontend/src/actions/simulation/load-metric.js b/frontend/src/actions/simulation/load-metric.js deleted file mode 100644 index c59338ed..00000000 --- a/frontend/src/actions/simulation/load-metric.js +++ /dev/null @@ -1,8 +0,0 @@ -export const CHANGE_LOAD_METRIC = 'CHANGE_LOAD_METRIC' - -export function changeLoadMetric(metric) { - return { - type: CHANGE_LOAD_METRIC, - metric, - } -} diff --git a/frontend/src/actions/simulation/playback.js b/frontend/src/actions/simulation/playback.js deleted file mode 100644 index 5d7d8af2..00000000 --- a/frontend/src/actions/simulation/playback.js +++ /dev/null @@ -1,15 +0,0 @@ -export const SET_PLAYING = 'SET_PLAYING' - -export function playSimulation() { - return { - type: SET_PLAYING, - playing: true, - } -} - -export function pauseSimulation() { - return { - type: SET_PLAYING, - playing: false, - } -} diff --git a/frontend/src/actions/simulation/tick.js b/frontend/src/actions/simulation/tick.js deleted file mode 100644 index ca2027a4..00000000 --- a/frontend/src/actions/simulation/tick.js +++ /dev/null @@ -1,25 +0,0 @@ -export const GO_TO_TICK = 'GO_TO_TICK' -export const SET_LAST_SIMULATED_TICK = 'SET_LAST_SIMULATED_TICK' - -export function incrementTick() { - return (dispatch, getState) => { - const { currentTick } = getState() - dispatch(goToTick(currentTick + 1)) - } -} - -export function goToTick(tick) { - return (dispatch, getState) => { - dispatch({ - type: GO_TO_TICK, - tick, - }) - } -} - -export function setLastSimulatedTick(tick) { - return { - type: SET_LAST_SIMULATED_TICK, - tick, - } -} diff --git a/frontend/src/actions/simulations.js b/frontend/src/actions/simulations.js deleted file mode 100644 index 779e9b9e..00000000 --- a/frontend/src/actions/simulations.js +++ /dev/null @@ -1,52 +0,0 @@ -export const SET_AUTH_VISIBILITY_FILTER = 'SET_AUTH_VISIBILITY_FILTER' -export const ADD_SIMULATION = 'ADD_SIMULATION' -export const ADD_SIMULATION_SUCCEEDED = 'ADD_SIMULATION_SUCCEEDED' -export const DELETE_SIMULATION = 'DELETE_SIMULATION' -export const DELETE_SIMULATION_SUCCEEDED = 'DELETE_SIMULATION_SUCCEEDED' -export const OPEN_SIMULATION_SUCCEEDED = 'OPEN_SIMULATION_SUCCEEDED' - -export function setAuthVisibilityFilter(filter) { - return { - type: SET_AUTH_VISIBILITY_FILTER, - filter, - } -} - -export function addSimulation(name) { - return (dispatch, getState) => { - const { auth } = getState() - dispatch({ - type: ADD_SIMULATION, - name, - userId: auth.userId, - }) - } -} - -export function addSimulationSucceeded(authorization) { - return { - type: ADD_SIMULATION_SUCCEEDED, - authorization, - } -} - -export function deleteSimulation(id) { - return { - type: DELETE_SIMULATION, - id, - } -} - -export function deleteSimulationSucceeded(id) { - return { - type: DELETE_SIMULATION_SUCCEEDED, - id, - } -} - -export function openSimulationSucceeded(id) { - return { - type: OPEN_SIMULATION_SUCCEEDED, - id, - } -} diff --git a/frontend/src/actions/states.js b/frontend/src/actions/states.js deleted file mode 100644 index 430fbd09..00000000 --- a/frontend/src/actions/states.js +++ /dev/null @@ -1,9 +0,0 @@ -export const ADD_BATCH_TO_STATES = 'ADD_BATCH_TO_STATES' - -export function addBatchToStates(objectType, objects) { - return { - type: ADD_BATCH_TO_STATES, - objectType, - objects, - } -} |
