From 90fae26aa4bd0e0eb3272ff6e6524060e9004fbb Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Mon, 29 Jun 2020 15:47:09 +0200 Subject: 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. --- src/pages/App.js | 125 ----------------------------------------------- src/pages/Experiments.js | 75 ---------------------------- src/pages/Home.js | 62 ----------------------- src/pages/Home.sass | 9 ---- src/pages/NotFound.js | 14 ------ src/pages/NotFound.sass | 11 ----- src/pages/Profile.js | 40 --------------- src/pages/Simulations.js | 46 ----------------- 8 files changed, 382 deletions(-) delete mode 100644 src/pages/App.js delete mode 100644 src/pages/Experiments.js delete mode 100644 src/pages/Home.js delete mode 100644 src/pages/Home.sass delete mode 100644 src/pages/NotFound.js delete mode 100644 src/pages/NotFound.sass delete mode 100644 src/pages/Profile.js delete mode 100644 src/pages/Simulations.js (limited to 'src/pages') diff --git a/src/pages/App.js b/src/pages/App.js deleted file mode 100644 index ad201e7d..00000000 --- a/src/pages/App.js +++ /dev/null @@ -1,125 +0,0 @@ -import PropTypes from "prop-types"; -import React from "react"; -import DocumentTitle from "react-document-title"; -import { connect } from "react-redux"; -import { ShortcutManager } from "react-shortcuts"; -import { openExperimentSucceeded } from "../actions/experiments"; -import { openSimulationSucceeded } from "../actions/simulations"; -import { resetCurrentDatacenter } from "../actions/topology/building"; -import ToolPanelComponent from "../components/app/map/controls/ToolPanelComponent"; -import LoadingScreen from "../components/app/map/LoadingScreen"; -import SimulationSidebarComponent from "../components/app/sidebars/simulation/SimulationSidebarComponent"; -import AppNavbar from "../components/navigation/AppNavbar"; -import ScaleIndicatorContainer from "../containers/app/map/controls/ScaleIndicatorContainer"; -import MapStage from "../containers/app/map/MapStage"; -import TopologySidebar from "../containers/app/sidebars/topology/TopologySidebar"; -import TimelineContainer from "../containers/app/timeline/TimelineContainer"; -import DeleteMachineModal from "../containers/modals/DeleteMachineModal"; -import DeleteRackModal from "../containers/modals/DeleteRackModal"; -import DeleteRoomModal from "../containers/modals/DeleteRoomModal"; -import EditRackNameModal from "../containers/modals/EditRackNameModal"; -import EditRoomNameModal from "../containers/modals/EditRoomNameModal"; -import KeymapConfiguration from "../shortcuts/keymap"; - -const shortcutManager = new ShortcutManager(KeymapConfiguration); - -class AppComponent extends React.Component { - static propTypes = { - simulationId: PropTypes.number.isRequired, - inSimulation: PropTypes.bool, - experimentId: PropTypes.number, - simulationName: PropTypes.string - }; - static childContextTypes = { - shortcuts: PropTypes.object.isRequired - }; - - componentDidMount() { - this.props.resetCurrentDatacenter(); - if (this.props.inSimulation) { - this.props.openExperimentSucceeded( - this.props.simulationId, - this.props.experimentId - ); - return; - } - this.props.openSimulationSucceeded(this.props.simulationId); - } - - getChildContext() { - return { - shortcuts: shortcutManager - }; - } - - render() { - return ( - -
- - {this.props.datacenterIsLoading ? ( -
- -
- ) : ( -
- - - - - {this.props.inSimulation ? : undefined} - {this.props.inSimulation ? ( - - ) : ( - undefined - )} -
- )} - - - - - -
-
- ); - } -} - -const mapStateToProps = state => { - let simulationName = undefined; - if ( - state.currentSimulationId !== -1 && - state.objects.simulation[state.currentSimulationId] - ) { - simulationName = state.objects.simulation[state.currentSimulationId].name; - } - - return { - datacenterIsLoading: state.currentDatacenterId === -1, - simulationName - }; -}; - -const mapDispatchToProps = dispatch => { - return { - resetCurrentDatacenter: () => dispatch(resetCurrentDatacenter()), - openSimulationSucceeded: id => dispatch(openSimulationSucceeded(id)), - openExperimentSucceeded: (simulationId, experimentId) => - dispatch(openExperimentSucceeded(simulationId, experimentId)) - }; -}; - -const App = connect(mapStateToProps, mapDispatchToProps)(AppComponent); - -export default App; diff --git a/src/pages/Experiments.js b/src/pages/Experiments.js deleted file mode 100644 index 2f73cd7e..00000000 --- a/src/pages/Experiments.js +++ /dev/null @@ -1,75 +0,0 @@ -import PropTypes from "prop-types"; -import React from "react"; -import DocumentTitle from "react-document-title"; -import { connect } from "react-redux"; -import { fetchExperimentsOfSimulation } from "../actions/experiments"; -import { openSimulationSucceeded } from "../actions/simulations"; -import AppNavbar from "../components/navigation/AppNavbar"; -import ExperimentListContainer from "../containers/experiments/ExperimentListContainer"; -import NewExperimentButtonContainer from "../containers/experiments/NewExperimentButtonContainer"; -import NewExperimentModal from "../containers/modals/NewExperimentModal"; - -class ExperimentsComponent extends React.Component { - static propTypes = { - simulationId: PropTypes.number.isRequired, - simulationName: PropTypes.string - }; - - componentDidMount() { - this.props.storeSimulationId(this.props.simulationId); - this.props.fetchExperimentsOfSimulation(this.props.simulationId); - } - - render() { - return ( - -
- -
- - -
- -
-
- ); - } -} - -const mapStateToProps = state => { - let simulationName = undefined; - if ( - state.currentSimulationId !== -1 && - state.objects.simulation[state.currentSimulationId] - ) { - simulationName = state.objects.simulation[state.currentSimulationId].name; - } - - return { - simulationName - }; -}; - -const mapDispatchToProps = dispatch => { - return { - storeSimulationId: id => dispatch(openSimulationSucceeded(id)), - fetchExperimentsOfSimulation: id => - dispatch(fetchExperimentsOfSimulation(id)) - }; -}; - -const Experiments = connect(mapStateToProps, mapDispatchToProps)( - ExperimentsComponent -); - -export default Experiments; diff --git a/src/pages/Home.js b/src/pages/Home.js deleted file mode 100644 index f6479722..00000000 --- a/src/pages/Home.js +++ /dev/null @@ -1,62 +0,0 @@ -import React from "react"; -import DocumentTitle from "react-document-title"; -import ContactSection from "../components/home/ContactSection"; -import IntroSection from "../components/home/IntroSection"; -import JumbotronHeader from "../components/home/JumbotronHeader"; -import ModelingSection from "../components/home/ModelingSection"; -import SimulationSection from "../components/home/SimulationSection"; -import StakeholderSection from "../components/home/StakeholderSection"; -import TeamSection from "../components/home/TeamSection"; -import TechnologiesSection from "../components/home/TechnologiesSection"; -import HomeNavbar from "../components/navigation/HomeNavbar"; -import jQuery from "../util/jquery"; -import "./Home.css"; - -class Home extends React.Component { - state = { - scrollSpySetup: false - }; - - componentDidMount() { - const scrollOffset = 60; - jQuery("#navbar") - .find("li a") - .click(function(e) { - if (jQuery(e.target).parents(".auth-links").length > 0) { - return; - } - e.preventDefault(); - jQuery(jQuery(this).attr("href"))[0].scrollIntoView(); - window.scrollBy(0, -scrollOffset); - }); - - if (!this.state.scrollSpySetup) { - jQuery("body").scrollspy({ - target: "#navbar", - offset: scrollOffset - }); - this.setState({ scrollSpySetup: true }); - } - } - - render() { - return ( -
- -
- - - - - - - - - -
-
- ); - } -} - -export default Home; diff --git a/src/pages/Home.sass b/src/pages/Home.sass deleted file mode 100644 index 9c812db2..00000000 --- a/src/pages/Home.sass +++ /dev/null @@ -1,9 +0,0 @@ -.body-wrapper - position: relative - overflow-y: hidden - -.intro-section, .modeling-section, .technologies-section - background-color: #fff - -.stakeholder-section, .simulation-section, .team-section - background-color: #f2f2f2 diff --git a/src/pages/NotFound.js b/src/pages/NotFound.js deleted file mode 100644 index b344e923..00000000 --- a/src/pages/NotFound.js +++ /dev/null @@ -1,14 +0,0 @@ -import React from "react"; -import DocumentTitle from "react-document-title"; -import TerminalWindow from "../components/not-found/TerminalWindow"; -import "./NotFound.css"; - -const NotFound = () => ( - -
- -
-
-); - -export default NotFound; diff --git a/src/pages/NotFound.sass b/src/pages/NotFound.sass deleted file mode 100644 index 9457da01..00000000 --- a/src/pages/NotFound.sass +++ /dev/null @@ -1,11 +0,0 @@ -.not-found-backdrop - position: absolute - left: 0 - top: 0 - - margin: 0 - padding: 0 - width: 100% - height: 100% - - background-image: linear-gradient(135deg, #00678a, #008fbf, #00A6D6) diff --git a/src/pages/Profile.js b/src/pages/Profile.js deleted file mode 100644 index 106ec97e..00000000 --- a/src/pages/Profile.js +++ /dev/null @@ -1,40 +0,0 @@ -import React from "react"; -import DocumentTitle from "react-document-title"; -import { connect } from "react-redux"; -import { openDeleteProfileModal } from "../actions/modals/profile"; -import AppNavbar from "../components/navigation/AppNavbar"; -import DeleteProfileModal from "../containers/modals/DeleteProfileModal"; - -const ProfileContainer = ({ onDelete }) => ( - -
- -
- -

- This does not delete your Google account, but simply disconnects it - from the OpenDC platform and deletes any simulation info that is - associated with you (simulations you own and any authorizations you - may have on other projects). -

-
- -
-
-); - -const mapDispatchToProps = dispatch => { - return { - onDelete: () => dispatch(openDeleteProfileModal()) - }; -}; - -const Profile = connect(undefined, mapDispatchToProps)(ProfileContainer); - -export default Profile; diff --git a/src/pages/Simulations.js b/src/pages/Simulations.js deleted file mode 100644 index ecff8fe6..00000000 --- a/src/pages/Simulations.js +++ /dev/null @@ -1,46 +0,0 @@ -import React from "react"; -import DocumentTitle from "react-document-title"; -import { connect } from "react-redux"; -import { openNewSimulationModal } from "../actions/modals/simulations"; -import { fetchAuthorizationsOfCurrentUser } from "../actions/users"; -import AppNavbar from "../components/navigation/AppNavbar"; -import SimulationFilterPanel from "../components/simulations/FilterPanel"; -import NewSimulationModal from "../containers/modals/NewSimulationModal"; -import NewSimulationButtonContainer from "../containers/simulations/NewSimulationButtonContainer"; -import VisibleSimulationList from "../containers/simulations/VisibleSimulationAuthList"; - -class SimulationsContainer extends React.Component { - componentDidMount() { - this.props.fetchAuthorizationsOfCurrentUser(); - } - - render() { - return ( - -
- -
- - - -
- -
-
- ); - } -} - -const mapDispatchToProps = dispatch => { - return { - fetchAuthorizationsOfCurrentUser: () => - dispatch(fetchAuthorizationsOfCurrentUser()), - openNewSimulationModal: () => dispatch(openNewSimulationModal()) - }; -}; - -const Simulations = connect(undefined, mapDispatchToProps)( - SimulationsContainer -); - -export default Simulations; -- cgit v1.2.3