summaryrefslogtreecommitdiff
path: root/frontend/src/sagas/index.js
diff options
context:
space:
mode:
authorGeorgios Andreadis <info@gandreadis.com>2020-06-29 15:47:09 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-08-24 16:08:41 +0200
commit90fae26aa4bd0e0eb3272ff6e6524060e9004fbb (patch)
treebf6943882f5fa5f3114c01fc571503c79ee1056d /frontend/src/sagas/index.js
parent7032a007d4431f5a0c4c5e2d3f3bd20462d49950 (diff)
Prepare frontend repository for monorepo
This change prepares the frontend Git repository for the monorepo residing at https://github.com/atlarge-research.com/opendc. To accomodate for this, we move all files into a frontend subdirectory.
Diffstat (limited to 'frontend/src/sagas/index.js')
-rw-r--r--frontend/src/sagas/index.js106
1 files changed, 106 insertions, 0 deletions
diff --git a/frontend/src/sagas/index.js b/frontend/src/sagas/index.js
new file mode 100644
index 00000000..56c8f09b
--- /dev/null
+++ b/frontend/src/sagas/index.js
@@ -0,0 +1,106 @@
+import { takeEvery } from "redux-saga/effects";
+import { LOG_IN } from "../actions/auth";
+import {
+ ADD_EXPERIMENT,
+ DELETE_EXPERIMENT,
+ FETCH_EXPERIMENTS_OF_SIMULATION,
+ OPEN_EXPERIMENT_SUCCEEDED
+} from "../actions/experiments";
+import {
+ ADD_SIMULATION,
+ DELETE_SIMULATION,
+ OPEN_SIMULATION_SUCCEEDED
+} from "../actions/simulations";
+import {
+ ADD_TILE,
+ CANCEL_NEW_ROOM_CONSTRUCTION,
+ DELETE_TILE,
+ START_NEW_ROOM_CONSTRUCTION
+} from "../actions/topology/building";
+import {
+ ADD_UNIT,
+ DELETE_MACHINE,
+ DELETE_UNIT
+} from "../actions/topology/machine";
+import {
+ ADD_MACHINE,
+ DELETE_RACK,
+ EDIT_RACK_NAME
+} from "../actions/topology/rack";
+import {
+ ADD_RACK_TO_TILE,
+ DELETE_ROOM,
+ EDIT_ROOM_NAME
+} from "../actions/topology/room";
+import {
+ DELETE_CURRENT_USER,
+ FETCH_AUTHORIZATIONS_OF_CURRENT_USER
+} from "../actions/users";
+import {
+ onAddExperiment,
+ onDeleteExperiment,
+ onFetchExperimentsOfSimulation,
+ onOpenExperimentSucceeded
+} from "./experiments";
+import { onDeleteCurrentUser } from "./profile";
+import {
+ onOpenSimulationSucceeded,
+ onSimulationAdd,
+ onSimulationDelete
+} from "./simulations";
+import {
+ onAddMachine,
+ onAddRackToTile,
+ onAddTile,
+ onAddUnit,
+ onCancelNewRoomConstruction,
+ onDeleteMachine,
+ onDeleteRack,
+ onDeleteRoom,
+ onDeleteTile,
+ onDeleteUnit,
+ onEditRackName,
+ onEditRoomName,
+ onStartNewRoomConstruction
+} from "./topology";
+import {
+ onFetchAuthorizationsOfCurrentUser,
+ onFetchLoggedInUser
+} from "./users";
+
+export default function* rootSaga() {
+ yield takeEvery(LOG_IN, onFetchLoggedInUser);
+
+ yield takeEvery(
+ FETCH_AUTHORIZATIONS_OF_CURRENT_USER,
+ onFetchAuthorizationsOfCurrentUser
+ );
+ yield takeEvery(ADD_SIMULATION, onSimulationAdd);
+ yield takeEvery(DELETE_SIMULATION, onSimulationDelete);
+
+ yield takeEvery(DELETE_CURRENT_USER, onDeleteCurrentUser);
+
+ yield takeEvery(OPEN_SIMULATION_SUCCEEDED, onOpenSimulationSucceeded);
+ yield takeEvery(OPEN_EXPERIMENT_SUCCEEDED, onOpenExperimentSucceeded);
+
+ yield takeEvery(START_NEW_ROOM_CONSTRUCTION, onStartNewRoomConstruction);
+ yield takeEvery(CANCEL_NEW_ROOM_CONSTRUCTION, onCancelNewRoomConstruction);
+ yield takeEvery(ADD_TILE, onAddTile);
+ yield takeEvery(DELETE_TILE, onDeleteTile);
+ yield takeEvery(EDIT_ROOM_NAME, onEditRoomName);
+ yield takeEvery(DELETE_ROOM, onDeleteRoom);
+ yield takeEvery(EDIT_RACK_NAME, onEditRackName);
+ yield takeEvery(DELETE_RACK, onDeleteRack);
+ yield takeEvery(ADD_RACK_TO_TILE, onAddRackToTile);
+ yield takeEvery(ADD_MACHINE, onAddMachine);
+ yield takeEvery(DELETE_MACHINE, onDeleteMachine);
+ yield takeEvery(ADD_UNIT, onAddUnit);
+ yield takeEvery(DELETE_UNIT, onDeleteUnit);
+
+ yield takeEvery(
+ FETCH_EXPERIMENTS_OF_SIMULATION,
+ onFetchExperimentsOfSimulation
+ );
+ yield takeEvery(ADD_EXPERIMENT, onAddExperiment);
+ yield takeEvery(DELETE_EXPERIMENT, onDeleteExperiment);
+}