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 --- .../src/components/app/map/groups/RackGroup.js | 12 +-- .../src/components/app/map/groups/TileGroup.js | 5 +- .../app/sidebars/elements/LoadBarComponent.js | 22 ---- .../simulation/ExperimentMetadataComponent.js | 23 ---- .../app/sidebars/simulation/LoadMetricComponent.js | 35 ------- .../simulation/SimulationSidebarComponent.js | 18 ---- .../simulation/SimulationSidebarComponent.sass | 8 -- .../topology/building/BuildingSidebarComponent.js | 11 +- .../topology/machine/MachineSidebarComponent.js | 13 +-- .../app/sidebars/topology/machine/UnitComponent.js | 12 +-- .../sidebars/topology/machine/UnitListComponent.js | 12 +-- .../sidebars/topology/machine/UnitTabsComponent.js | 10 +- .../sidebars/topology/rack/EmptySlotComponent.js | 14 +-- .../app/sidebars/topology/rack/MachineComponent.js | 9 +- .../sidebars/topology/rack/RackSidebarComponent.js | 15 +-- .../sidebars/topology/room/RoomSidebarComponent.js | 19 +--- .../components/app/timeline/PlayButtonComponent.js | 30 ------ frontend/src/components/app/timeline/Timeline.sass | 116 --------------------- .../components/app/timeline/TimelineComponent.js | 37 ------- .../app/timeline/TimelineControlsComponent.js | 36 ------- .../app/timeline/TimelineLabelsComponent.js | 15 --- .../experiments/ExperimentRowComponent.js | 6 +- .../src/components/home/TechnologiesSection.js | 2 +- frontend/src/components/navigation/AppNavbar.js | 18 ++-- frontend/src/components/navigation/HomeNavbar.js | 2 +- frontend/src/components/navigation/Navbar.js | 6 +- frontend/src/components/projects/FilterButton.js | 24 +++++ frontend/src/components/projects/FilterPanel.js | 13 +++ frontend/src/components/projects/FilterPanel.sass | 5 + .../projects/NewProjectButtonComponent.js | 17 +++ .../components/projects/ProjectActionButtons.js | 37 +++++++ .../src/components/projects/ProjectAuthList.js | 43 ++++++++ frontend/src/components/projects/ProjectAuthRow.js | 32 ++++++ .../src/components/simulations/FilterButton.js | 24 ----- frontend/src/components/simulations/FilterPanel.js | 13 --- .../src/components/simulations/FilterPanel.sass | 5 - .../simulations/NewSimulationButtonComponent.js | 17 --- .../simulations/SimulationActionButtons.js | 37 ------- .../components/simulations/SimulationAuthList.js | 43 -------- .../components/simulations/SimulationAuthRow.js | 32 ------ 40 files changed, 221 insertions(+), 627 deletions(-) delete mode 100644 frontend/src/components/app/sidebars/elements/LoadBarComponent.js delete mode 100644 frontend/src/components/app/sidebars/simulation/ExperimentMetadataComponent.js delete mode 100644 frontend/src/components/app/sidebars/simulation/LoadMetricComponent.js delete mode 100644 frontend/src/components/app/sidebars/simulation/SimulationSidebarComponent.js delete mode 100644 frontend/src/components/app/sidebars/simulation/SimulationSidebarComponent.sass delete mode 100644 frontend/src/components/app/timeline/PlayButtonComponent.js delete mode 100644 frontend/src/components/app/timeline/Timeline.sass delete mode 100644 frontend/src/components/app/timeline/TimelineComponent.js delete mode 100644 frontend/src/components/app/timeline/TimelineControlsComponent.js delete mode 100644 frontend/src/components/app/timeline/TimelineLabelsComponent.js create mode 100644 frontend/src/components/projects/FilterButton.js create mode 100644 frontend/src/components/projects/FilterPanel.js create mode 100644 frontend/src/components/projects/FilterPanel.sass create mode 100644 frontend/src/components/projects/NewProjectButtonComponent.js create mode 100644 frontend/src/components/projects/ProjectActionButtons.js create mode 100644 frontend/src/components/projects/ProjectAuthList.js create mode 100644 frontend/src/components/projects/ProjectAuthRow.js delete mode 100644 frontend/src/components/simulations/FilterButton.js delete mode 100644 frontend/src/components/simulations/FilterPanel.js delete mode 100644 frontend/src/components/simulations/FilterPanel.sass delete mode 100644 frontend/src/components/simulations/NewSimulationButtonComponent.js delete mode 100644 frontend/src/components/simulations/SimulationActionButtons.js delete mode 100644 frontend/src/components/simulations/SimulationAuthList.js delete mode 100644 frontend/src/components/simulations/SimulationAuthRow.js (limited to 'frontend/src/components') diff --git a/frontend/src/components/app/map/groups/RackGroup.js b/frontend/src/components/app/map/groups/RackGroup.js index 6de939a9..5d4ee5e2 100644 --- a/frontend/src/components/app/map/groups/RackGroup.js +++ b/frontend/src/components/app/map/groups/RackGroup.js @@ -4,23 +4,17 @@ import RackEnergyFillContainer from '../../../../containers/app/map/RackEnergyFi import RackSpaceFillContainer from '../../../../containers/app/map/RackSpaceFillContainer' import Shapes from '../../../../shapes/index' import { RACK_BACKGROUND_COLOR } from '../../../../util/colors' -import { convertLoadToSimulationColor } from '../../../../util/simulation-load' import TileObject from '../elements/TileObject' -const RackGroup = ({ tile, inSimulation, rackLoad }) => { - let color = RACK_BACKGROUND_COLOR - if (inSimulation && rackLoad >= 0) { - color = convertLoadToSimulationColor(rackLoad) - } - +const RackGroup = ({ tile }) => { return ( - + { +const TileGroup = ({ tile, newTile, roomLoad, onClick }) => { let tileObject if (tile.rackId) { tileObject = @@ -18,8 +17,6 @@ const TileGroup = ({ tile, newTile, inSimulation, roomLoad, onClick }) => { let color = ROOM_DEFAULT_COLOR if (newTile) { color = ROOM_IN_CONSTRUCTION_COLOR - } else if (inSimulation && roomLoad >= 0) { - color = convertLoadToSimulationColor(roomLoad) } return ( diff --git a/frontend/src/components/app/sidebars/elements/LoadBarComponent.js b/frontend/src/components/app/sidebars/elements/LoadBarComponent.js deleted file mode 100644 index 01005085..00000000 --- a/frontend/src/components/app/sidebars/elements/LoadBarComponent.js +++ /dev/null @@ -1,22 +0,0 @@ -import classNames from 'classnames' -import React from 'react' - -const LoadBarComponent = ({ percent, disabled }) => ( -
- Current load -
-
- {percent}% -
-
-
-) - -export default LoadBarComponent diff --git a/frontend/src/components/app/sidebars/simulation/ExperimentMetadataComponent.js b/frontend/src/components/app/sidebars/simulation/ExperimentMetadataComponent.js deleted file mode 100644 index 30990a13..00000000 --- a/frontend/src/components/app/sidebars/simulation/ExperimentMetadataComponent.js +++ /dev/null @@ -1,23 +0,0 @@ -import React from 'react' - -const ExperimentMetadataComponent = ({ - experimentName, - topologyName, - traceName, - schedulerName, - }) => ( -
-

{experimentName}

-

- Topology: {topologyName} -

-

- Trace: {traceName} -

-

- Scheduler: {schedulerName} -

-
-) - -export default ExperimentMetadataComponent diff --git a/frontend/src/components/app/sidebars/simulation/LoadMetricComponent.js b/frontend/src/components/app/sidebars/simulation/LoadMetricComponent.js deleted file mode 100644 index 6ee6a3b9..00000000 --- a/frontend/src/components/app/sidebars/simulation/LoadMetricComponent.js +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react' -import { SIM_HIGH_COLOR, SIM_LOW_COLOR, SIM_MID_HIGH_COLOR, SIM_MID_LOW_COLOR } from '../../../../util/colors' -import { LOAD_NAME_MAP } from '../../../../util/simulation-load' - -const LoadMetricComponent = ({ loadMetric }) => ( -
-
- Colors represent {LOAD_NAME_MAP[loadMetric]} -
-
- - - - -
-
-) - -export default LoadMetricComponent diff --git a/frontend/src/components/app/sidebars/simulation/SimulationSidebarComponent.js b/frontend/src/components/app/sidebars/simulation/SimulationSidebarComponent.js deleted file mode 100644 index dba75eb2..00000000 --- a/frontend/src/components/app/sidebars/simulation/SimulationSidebarComponent.js +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react' -import ExperimentMetadataContainer from '../../../../containers/app/sidebars/simulation/ExperimentMetadataContainer' -import LoadMetricContainer from '../../../../containers/app/sidebars/simulation/LoadMetricContainer' -import Sidebar from '../Sidebar' -import './SimulationSidebarComponent.css' - -const SimulationSidebarComponent = () => { - return ( - -
- - -
-
- ) -} - -export default SimulationSidebarComponent diff --git a/frontend/src/components/app/sidebars/simulation/SimulationSidebarComponent.sass b/frontend/src/components/app/sidebars/simulation/SimulationSidebarComponent.sass deleted file mode 100644 index 6490cf8d..00000000 --- a/frontend/src/components/app/sidebars/simulation/SimulationSidebarComponent.sass +++ /dev/null @@ -1,8 +0,0 @@ -.simulation-sidebar-container - display: flex - height: 100% - max-height: 100% - -.trace-container - flex: 1 - overflow-y: scroll diff --git a/frontend/src/components/app/sidebars/topology/building/BuildingSidebarComponent.js b/frontend/src/components/app/sidebars/topology/building/BuildingSidebarComponent.js index 00965c18..4cc87798 100644 --- a/frontend/src/components/app/sidebars/topology/building/BuildingSidebarComponent.js +++ b/frontend/src/components/app/sidebars/topology/building/BuildingSidebarComponent.js @@ -2,18 +2,11 @@ import React from 'react' import NewRoomConstructionContainer from '../../../../../containers/app/sidebars/topology/building/NewRoomConstructionContainer' -const BuildingSidebarComponent = ({ inSimulation }) => { +const BuildingSidebarComponent = () => { return (

Building

- {inSimulation ? ( -
- - Click on individual rooms to see their stats! -
- ) : ( - - )} +
) } diff --git a/frontend/src/components/app/sidebars/topology/machine/MachineSidebarComponent.js b/frontend/src/components/app/sidebars/topology/machine/MachineSidebarComponent.js index 66c8c84f..d78c20eb 100644 --- a/frontend/src/components/app/sidebars/topology/machine/MachineSidebarComponent.js +++ b/frontend/src/components/app/sidebars/topology/machine/MachineSidebarComponent.js @@ -1,24 +1,15 @@ import React from 'react' -import LoadBarContainer from '../../../../../containers/app/sidebars/elements/LoadBarContainer' -import LoadChartContainer from '../../../../../containers/app/sidebars/elements/LoadChartContainer' import BackToRackContainer from '../../../../../containers/app/sidebars/topology/machine/BackToRackContainer' import DeleteMachineContainer from '../../../../../containers/app/sidebars/topology/machine/DeleteMachineContainer' import MachineNameContainer from '../../../../../containers/app/sidebars/topology/machine/MachineNameContainer' import UnitTabsContainer from '../../../../../containers/app/sidebars/topology/machine/UnitTabsContainer' -const MachineSidebarComponent = ({ inSimulation, machineId }) => { +const MachineSidebarComponent = ({ machineId }) => { return (
- {inSimulation ? ( -
- - -
- ) : ( - - )} +
) diff --git a/frontend/src/components/app/sidebars/topology/machine/UnitComponent.js b/frontend/src/components/app/sidebars/topology/machine/UnitComponent.js index bde6d444..3953347a 100644 --- a/frontend/src/components/app/sidebars/topology/machine/UnitComponent.js +++ b/frontend/src/components/app/sidebars/topology/machine/UnitComponent.js @@ -53,14 +53,10 @@ class UnitComponent extends React.Component { data-content={unitInfo} data-html="true" /> - {this.props.inSimulation ? ( - undefined - ) : ( - - )} + ) diff --git a/frontend/src/components/app/sidebars/topology/machine/UnitListComponent.js b/frontend/src/components/app/sidebars/topology/machine/UnitListComponent.js index da65da23..fcd3e03b 100644 --- a/frontend/src/components/app/sidebars/topology/machine/UnitListComponent.js +++ b/frontend/src/components/app/sidebars/topology/machine/UnitListComponent.js @@ -1,7 +1,7 @@ import React from 'react' import UnitContainer from '../../../../../containers/app/sidebars/topology/machine/UnitContainer' -const UnitListComponent = ({ unitType, unitIds, inSimulation }) => ( +const UnitListComponent = ({ unitType, unitIds }) => (
    {unitIds.length !== 0 ? ( unitIds.map((unitId, index) => ( @@ -14,13 +14,9 @@ const UnitListComponent = ({ unitType, unitIds, inSimulation }) => ( )) ) : (
    - {inSimulation ? ( - No units of this type in this machine - ) : ( - - No units... Add some with the menu above! - - )} + + No units... Add some with the menu above! +
    )}
diff --git a/frontend/src/components/app/sidebars/topology/machine/UnitTabsComponent.js b/frontend/src/components/app/sidebars/topology/machine/UnitTabsComponent.js index df7eeb77..c774036f 100644 --- a/frontend/src/components/app/sidebars/topology/machine/UnitTabsComponent.js +++ b/frontend/src/components/app/sidebars/topology/machine/UnitTabsComponent.js @@ -2,7 +2,7 @@ import React from 'react' import UnitAddContainer from '../../../../../containers/app/sidebars/topology/machine/UnitAddContainer' import UnitListContainer from '../../../../../containers/app/sidebars/topology/machine/UnitListContainer' -const UnitTabsComponent = ({ inSimulation }) => ( +const UnitTabsComponent = () => (
  • @@ -43,19 +43,19 @@ const UnitTabsComponent = ({ inSimulation }) => (
- {inSimulation ? undefined : } +
- {inSimulation ? undefined : } +
- {inSimulation ? undefined : } +
- {inSimulation ? undefined : } +
diff --git a/frontend/src/components/app/sidebars/topology/rack/EmptySlotComponent.js b/frontend/src/components/app/sidebars/topology/rack/EmptySlotComponent.js index f182a78c..03b44aa6 100644 --- a/frontend/src/components/app/sidebars/topology/rack/EmptySlotComponent.js +++ b/frontend/src/components/app/sidebars/topology/rack/EmptySlotComponent.js @@ -1,18 +1,14 @@ import React from 'react' -const EmptySlotComponent = ({ position, onAdd, inSimulation }) => ( +const EmptySlotComponent = ({ position, onAdd }) => (
  • {position} - {inSimulation ? ( - Empty Slot - ) : ( - - )} +
  • ) diff --git a/frontend/src/components/app/sidebars/topology/rack/MachineComponent.js b/frontend/src/components/app/sidebars/topology/rack/MachineComponent.js index b4204136..cec3c912 100644 --- a/frontend/src/components/app/sidebars/topology/rack/MachineComponent.js +++ b/frontend/src/components/app/sidebars/topology/rack/MachineComponent.js @@ -1,6 +1,5 @@ import React from 'react' import Shapes from '../../../../../shapes' -import { convertLoadToSimulationColor } from '../../../../../util/simulation-load' const UnitIcon = ({ id, type }) => (
    @@ -16,14 +15,8 @@ const UnitIcon = ({ id, type }) => ( const MachineComponent = ({ position, machine, - inSimulation, - machineLoad, onClick, }) => { - let color = 'white' - if (inSimulation && machineLoad >= 0) { - color = convertLoadToSimulationColor(machineLoad) - } const hasNoUnits = machine.cpuIds.length + machine.gpuIds.length + @@ -35,7 +28,7 @@ const MachineComponent = ({
  • {position}
    diff --git a/frontend/src/components/app/sidebars/topology/rack/RackSidebarComponent.js b/frontend/src/components/app/sidebars/topology/rack/RackSidebarComponent.js index 47d99254..23e8e743 100644 --- a/frontend/src/components/app/sidebars/topology/rack/RackSidebarComponent.js +++ b/frontend/src/components/app/sidebars/topology/rack/RackSidebarComponent.js @@ -1,28 +1,17 @@ import React from 'react' -import LoadBarContainer from '../../../../../containers/app/sidebars/elements/LoadBarContainer' -import LoadChartContainer from '../../../../../containers/app/sidebars/elements/LoadChartContainer' import BackToRoomContainer from '../../../../../containers/app/sidebars/topology/rack/BackToRoomContainer' import DeleteRackContainer from '../../../../../containers/app/sidebars/topology/rack/DeleteRackContainer' import MachineListContainer from '../../../../../containers/app/sidebars/topology/rack/MachineListContainer' import RackNameContainer from '../../../../../containers/app/sidebars/topology/rack/RackNameContainer' import './RackSidebarComponent.css' -const RackSidebarComponent = ({ inSimulation, rackId }) => { +const RackSidebarComponent = () => { return (
    - {inSimulation ? ( -
    - - -
    - ) : ( -
    - -
    - )} +
    diff --git a/frontend/src/components/app/sidebars/topology/room/RoomSidebarComponent.js b/frontend/src/components/app/sidebars/topology/room/RoomSidebarComponent.js index d8a805cb..a23ac381 100644 --- a/frontend/src/components/app/sidebars/topology/room/RoomSidebarComponent.js +++ b/frontend/src/components/app/sidebars/topology/room/RoomSidebarComponent.js @@ -1,29 +1,18 @@ import React from 'react' -import LoadBarContainer from '../../../../../containers/app/sidebars/elements/LoadBarContainer' -import LoadChartContainer from '../../../../../containers/app/sidebars/elements/LoadChartContainer' import BackToBuildingContainer from '../../../../../containers/app/sidebars/topology/room/BackToBuildingContainer' import DeleteRoomContainer from '../../../../../containers/app/sidebars/topology/room/DeleteRoomContainer' import EditRoomContainer from '../../../../../containers/app/sidebars/topology/room/EditRoomContainer' import RackConstructionContainer from '../../../../../containers/app/sidebars/topology/room/RackConstructionContainer' import RoomNameContainer from '../../../../../containers/app/sidebars/topology/room/RoomNameContainer' -const RoomSidebarComponent = ({ roomId, inSimulation }) => { +const RoomSidebarComponent = () => { return (
    - {inSimulation ? ( -
    - - -
    - ) : ( -
    - - - -
    - )} + + +
    ) } diff --git a/frontend/src/components/app/timeline/PlayButtonComponent.js b/frontend/src/components/app/timeline/PlayButtonComponent.js deleted file mode 100644 index 7968c68d..00000000 --- a/frontend/src/components/app/timeline/PlayButtonComponent.js +++ /dev/null @@ -1,30 +0,0 @@ -import React from 'react' - -const PlayButtonComponent = ({ - isPlaying, - currentTick, - lastSimulatedTick, - onPlay, - onPause, - }) => ( -
    { - if (isPlaying) { - onPause() - } else { - if (currentTick !== lastSimulatedTick) { - onPlay() - } - } - }} - > - {isPlaying ? ( - - ) : ( - - )} -
    -) - -export default PlayButtonComponent diff --git a/frontend/src/components/app/timeline/Timeline.sass b/frontend/src/components/app/timeline/Timeline.sass deleted file mode 100644 index 2d2cb979..00000000 --- a/frontend/src/components/app/timeline/Timeline.sass +++ /dev/null @@ -1,116 +0,0 @@ -@import ../../../style-globals/_variables.sass -@import ../../../style-globals/_mixins.sass - -$container-size: 500px -$play-btn-size: 40px -$border-width: 1px -$timeline-border: $border-width solid $gray-semi-dark - -.timeline-bar - display: block - position: absolute - left: 0 - bottom: 20px - width: 100% - text-align: center - z-index: 2000 - - pointer-events: none - -.timeline-container - display: inline-block - margin: 0 auto - text-align: left - - width: $container-size - -.timeline-labels - display: block - height: 25px - line-height: 25px - - div - display: inline-block - - .start-time-label - margin-left: $play-btn-size - $border-width - padding-left: 4px - - .end-time-label - padding-right: 4px - float: right - -.timeline-controls - display: flex - border: $timeline-border - overflow: hidden - - pointer-events: all - - +border-radius($standard-border-radius) - - .play-btn - width: $play-btn-size - height: $play-btn-size + $border-width - line-height: $play-btn-size + $border-width - text-align: center - float: left - margin-top: -$border-width - - font-size: 16pt - background: #333 - color: #eee - - +transition(background, $transition-length) - +user-select - +clickable - - .play-btn:hover - background: #656565 - - .play-btn:active - background: #000 - - .timeline - position: relative - flex: 1 - height: $play-btn-size - line-height: $play-btn-size - float: right - - background: $blue-light - - z-index: 500 - - div - +transition(all, $transition-length) - - .time-marker - position: absolute - top: 0 - left: 0 - - width: 6px - height: 100% - - background: $blue-very-dark - - +border-radius(2px) - - z-index: 503 - - pointer-events: none - - .section-marker - position: absolute - top: 0 - left: 0 - - width: 3px - height: 100% - - background: #222222 - - z-index: 504 - - pointer-events: none diff --git a/frontend/src/components/app/timeline/TimelineComponent.js b/frontend/src/components/app/timeline/TimelineComponent.js deleted file mode 100644 index c183c0e8..00000000 --- a/frontend/src/components/app/timeline/TimelineComponent.js +++ /dev/null @@ -1,37 +0,0 @@ -import React from 'react' -import TimelineControlsContainer from '../../../containers/app/timeline/TimelineControlsContainer' -import TimelineLabelsContainer from '../../../containers/app/timeline/TimelineLabelsContainer' -import './Timeline.css' - -class TimelineComponent extends React.Component { - componentDidMount() { - this.interval = setInterval(() => { - if (!this.props.isPlaying) { - return - } - - if (this.props.currentTick < this.props.lastSimulatedTick) { - this.props.incrementTick() - } else { - this.props.pauseSimulation() - } - }, 1000) - } - - componentWillUnmount() { - clearInterval(this.interval) - } - - render() { - return ( -
    -
    - - -
    -
    - ) - } -} - -export default TimelineComponent diff --git a/frontend/src/components/app/timeline/TimelineControlsComponent.js b/frontend/src/components/app/timeline/TimelineControlsComponent.js deleted file mode 100644 index 01911aff..00000000 --- a/frontend/src/components/app/timeline/TimelineControlsComponent.js +++ /dev/null @@ -1,36 +0,0 @@ -import React from 'react' -import PlayButtonContainer from '../../../containers/app/timeline/PlayButtonContainer' -import { convertTickToPercentage } from '../../../util/timeline' - -class TimelineControlsComponent extends React.Component { - onTimelineClick(e) { - const percentage = e.nativeEvent.offsetX / this.timeline.clientWidth - const tick = Math.floor(percentage * (this.props.lastSimulatedTick + 1)) - this.props.goToTick(tick) - } - - render() { - return ( -
    - -
    (this.timeline = timeline)} - onClick={this.onTimelineClick.bind(this)} - > -
    -
    -
    - ) - } -} - -export default TimelineControlsComponent diff --git a/frontend/src/components/app/timeline/TimelineLabelsComponent.js b/frontend/src/components/app/timeline/TimelineLabelsComponent.js deleted file mode 100644 index 55818d24..00000000 --- a/frontend/src/components/app/timeline/TimelineLabelsComponent.js +++ /dev/null @@ -1,15 +0,0 @@ -import React from 'react' -import { convertSecondsToFormattedTime } from '../../../util/date-time' - -const TimelineLabelsComponent = ({ currentTick, lastSimulatedTick }) => ( -
    -
    - {convertSecondsToFormattedTime(currentTick)} -
    -
    - {convertSecondsToFormattedTime(lastSimulatedTick)} -
    -
    -) - -export default TimelineLabelsComponent diff --git a/frontend/src/components/experiments/ExperimentRowComponent.js b/frontend/src/components/experiments/ExperimentRowComponent.js index 880d7e31..c6ae1ba4 100644 --- a/frontend/src/components/experiments/ExperimentRowComponent.js +++ b/frontend/src/components/experiments/ExperimentRowComponent.js @@ -3,7 +3,7 @@ import React from 'react' import { Link } from 'react-router-dom' import Shapes from '../../shapes/index' -const ExperimentRowComponent = ({ experiment, simulationId, onDelete }) => ( +const ExperimentRowComponent = ({ experiment, projectId, onDelete }) => ( {experiment.name} {experiment.topology.name} @@ -11,7 +11,7 @@ const ExperimentRowComponent = ({ experiment, simulationId, onDelete }) => ( {experiment.scheduler.name} @@ -30,7 +30,7 @@ const ExperimentRowComponent = ({ experiment, simulationId, onDelete }) => ( ExperimentRowComponent.propTypes = { experiment: Shapes.Experiment.isRequired, - simulationId: PropTypes.string.isRequired, + projectId: PropTypes.string.isRequired, } export default ExperimentRowComponent diff --git a/frontend/src/components/home/TechnologiesSection.js b/frontend/src/components/home/TechnologiesSection.js index 13d8ca02..01d55937 100644 --- a/frontend/src/components/home/TechnologiesSection.js +++ b/frontend/src/components/home/TechnologiesSection.js @@ -26,7 +26,7 @@ const TechnologiesSection = () => ( Database - MariaDB + MongoDB
  • diff --git a/frontend/src/components/navigation/AppNavbar.js b/frontend/src/components/navigation/AppNavbar.js index 15f08b5f..876d4abd 100644 --- a/frontend/src/components/navigation/AppNavbar.js +++ b/frontend/src/components/navigation/AppNavbar.js @@ -4,21 +4,21 @@ import { Link } from 'react-router-dom' import Navbar, { NavItem } from './Navbar' import './Navbar.css' -const AppNavbar = ({ simulationId, inSimulation, fullWidth, onViewTopologies }) => ( +const AppNavbar = ({ projectId, inProject, fullWidth, onViewTopologies }) => ( - - + + - My Simulations + My Projects - {inSimulation ? ( + {inProject ? ( <> - + Construction @@ -34,11 +34,11 @@ const AppNavbar = ({ simulationId, inSimulation, fullWidth, onViewTopologies }) Topologies - + Experiments diff --git a/frontend/src/components/navigation/HomeNavbar.js b/frontend/src/components/navigation/HomeNavbar.js index 5bb6721d..4e3f3869 100644 --- a/frontend/src/components/navigation/HomeNavbar.js +++ b/frontend/src/components/navigation/HomeNavbar.js @@ -14,7 +14,7 @@ const HomeNavbar = () => ( - + diff --git a/frontend/src/components/navigation/Navbar.js b/frontend/src/components/navigation/Navbar.js index b47f1f94..0ef19ecb 100644 --- a/frontend/src/components/navigation/Navbar.js +++ b/frontend/src/components/navigation/Navbar.js @@ -40,9 +40,9 @@ const LoggedInSectionWithoutRoute = ({ location }) => ( {userIsLoggedIn() ? ( [ location.pathname === '/' ? ( - - - My Simulations + + + My Projects ) : ( diff --git a/frontend/src/components/projects/FilterButton.js b/frontend/src/components/projects/FilterButton.js new file mode 100644 index 00000000..664f9b46 --- /dev/null +++ b/frontend/src/components/projects/FilterButton.js @@ -0,0 +1,24 @@ +import classNames from 'classnames' +import PropTypes from 'prop-types' +import React from 'react' + +const FilterButton = ({ active, children, onClick }) => ( + +) + +FilterButton.propTypes = { + active: PropTypes.bool.isRequired, + children: PropTypes.node.isRequired, + onClick: PropTypes.func.isRequired, +} + +export default FilterButton diff --git a/frontend/src/components/projects/FilterPanel.js b/frontend/src/components/projects/FilterPanel.js new file mode 100644 index 00000000..0970f573 --- /dev/null +++ b/frontend/src/components/projects/FilterPanel.js @@ -0,0 +1,13 @@ +import React from 'react' +import FilterLink from '../../containers/projects/FilterLink' +import './FilterPanel.css' + +const FilterPanel = () => ( +
    + All Projects + My Projects + Shared with me +
    +) + +export default FilterPanel diff --git a/frontend/src/components/projects/FilterPanel.sass b/frontend/src/components/projects/FilterPanel.sass new file mode 100644 index 00000000..f71cf6c8 --- /dev/null +++ b/frontend/src/components/projects/FilterPanel.sass @@ -0,0 +1,5 @@ +.filter-panel + display: flex + + button + flex: 1 !important diff --git a/frontend/src/components/projects/NewProjectButtonComponent.js b/frontend/src/components/projects/NewProjectButtonComponent.js new file mode 100644 index 00000000..3ddef5e5 --- /dev/null +++ b/frontend/src/components/projects/NewProjectButtonComponent.js @@ -0,0 +1,17 @@ +import PropTypes from 'prop-types' +import React from 'react' + +const NewProjectButtonComponent = ({ onClick }) => ( +
    +
    + + New Project +
    +
    +) + +NewProjectButtonComponent.propTypes = { + onClick: PropTypes.func.isRequired, +} + +export default NewProjectButtonComponent diff --git a/frontend/src/components/projects/ProjectActionButtons.js b/frontend/src/components/projects/ProjectActionButtons.js new file mode 100644 index 00000000..456dd6b6 --- /dev/null +++ b/frontend/src/components/projects/ProjectActionButtons.js @@ -0,0 +1,37 @@ +import PropTypes from 'prop-types' +import React from 'react' +import { Link } from 'react-router-dom' + +const ProjectActionButtons = ({ projectId, onViewUsers, onDelete }) => ( + + + + +
    onViewUsers(projectId)} + > + +
    +
    onDelete(projectId)} + > + +
    + +) + +ProjectActionButtons.propTypes = { + projectId: PropTypes.string.isRequired, + onViewUsers: PropTypes.func, + onDelete: PropTypes.func, +} + +export default ProjectActionButtons diff --git a/frontend/src/components/projects/ProjectAuthList.js b/frontend/src/components/projects/ProjectAuthList.js new file mode 100644 index 00000000..5a2c6695 --- /dev/null +++ b/frontend/src/components/projects/ProjectAuthList.js @@ -0,0 +1,43 @@ +import PropTypes from 'prop-types' +import React from 'react' +import Shapes from '../../shapes/index' +import ProjectAuthRow from './ProjectAuthRow' + +const ProjectAuthList = ({ authorizations }) => { + return ( +
    + {authorizations.length === 0 ? ( +
    + + No projects here yet... Add some with the 'New + Project' button! +
    + ) : ( + + + + + + + + + + {authorizations.map(authorization => ( + + ))} + +
    Project nameLast editedAccess rights +
    + )} +
    + ) +} + +ProjectAuthList.propTypes = { + authorizations: PropTypes.arrayOf(Shapes.Authorization).isRequired, +} + +export default ProjectAuthList diff --git a/frontend/src/components/projects/ProjectAuthRow.js b/frontend/src/components/projects/ProjectAuthRow.js new file mode 100644 index 00000000..be9de6e0 --- /dev/null +++ b/frontend/src/components/projects/ProjectAuthRow.js @@ -0,0 +1,32 @@ +import classNames from 'classnames' +import React from 'react' +import ProjectActions from '../../containers/projects/ProjectActions' +import Shapes from '../../shapes/index' +import { AUTH_DESCRIPTION_MAP, AUTH_ICON_MAP } from '../../util/authorizations' +import { parseAndFormatDateTime } from '../../util/date-time' + +const ProjectAuthRow = ({ projectAuth }) => ( + + {projectAuth.project.name} + + {parseAndFormatDateTime(projectAuth.project.datetimeLastEdited)} + + + + {AUTH_DESCRIPTION_MAP[projectAuth.authorizationLevel]} + + + +) + +ProjectAuthRow.propTypes = { + projectAuth: Shapes.Authorization.isRequired, +} + +export default ProjectAuthRow diff --git a/frontend/src/components/simulations/FilterButton.js b/frontend/src/components/simulations/FilterButton.js deleted file mode 100644 index 664f9b46..00000000 --- a/frontend/src/components/simulations/FilterButton.js +++ /dev/null @@ -1,24 +0,0 @@ -import classNames from 'classnames' -import PropTypes from 'prop-types' -import React from 'react' - -const FilterButton = ({ active, children, onClick }) => ( - -) - -FilterButton.propTypes = { - active: PropTypes.bool.isRequired, - children: PropTypes.node.isRequired, - onClick: PropTypes.func.isRequired, -} - -export default FilterButton diff --git a/frontend/src/components/simulations/FilterPanel.js b/frontend/src/components/simulations/FilterPanel.js deleted file mode 100644 index cbc3bf6a..00000000 --- a/frontend/src/components/simulations/FilterPanel.js +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react' -import FilterLink from '../../containers/simulations/FilterLink' -import './FilterPanel.css' - -const FilterPanel = () => ( -
    - All Simulations - My Simulations - Shared with me -
    -) - -export default FilterPanel diff --git a/frontend/src/components/simulations/FilterPanel.sass b/frontend/src/components/simulations/FilterPanel.sass deleted file mode 100644 index f71cf6c8..00000000 --- a/frontend/src/components/simulations/FilterPanel.sass +++ /dev/null @@ -1,5 +0,0 @@ -.filter-panel - display: flex - - button - flex: 1 !important diff --git a/frontend/src/components/simulations/NewSimulationButtonComponent.js b/frontend/src/components/simulations/NewSimulationButtonComponent.js deleted file mode 100644 index d07a6419..00000000 --- a/frontend/src/components/simulations/NewSimulationButtonComponent.js +++ /dev/null @@ -1,17 +0,0 @@ -import PropTypes from 'prop-types' -import React from 'react' - -const NewSimulationButtonComponent = ({ onClick }) => ( -
    -
    - - New Simulation -
    -
    -) - -NewSimulationButtonComponent.propTypes = { - onClick: PropTypes.func.isRequired, -} - -export default NewSimulationButtonComponent diff --git a/frontend/src/components/simulations/SimulationActionButtons.js b/frontend/src/components/simulations/SimulationActionButtons.js deleted file mode 100644 index 3395cdeb..00000000 --- a/frontend/src/components/simulations/SimulationActionButtons.js +++ /dev/null @@ -1,37 +0,0 @@ -import PropTypes from 'prop-types' -import React from 'react' -import { Link } from 'react-router-dom' - -const SimulationActionButtons = ({ simulationId, onViewUsers, onDelete }) => ( - - - - -
    onViewUsers(simulationId)} - > - -
    -
    onDelete(simulationId)} - > - -
    - -) - -SimulationActionButtons.propTypes = { - simulationId: PropTypes.string.isRequired, - onViewUsers: PropTypes.func, - onDelete: PropTypes.func, -} - -export default SimulationActionButtons diff --git a/frontend/src/components/simulations/SimulationAuthList.js b/frontend/src/components/simulations/SimulationAuthList.js deleted file mode 100644 index c760d08f..00000000 --- a/frontend/src/components/simulations/SimulationAuthList.js +++ /dev/null @@ -1,43 +0,0 @@ -import PropTypes from 'prop-types' -import React from 'react' -import Shapes from '../../shapes/index' -import SimulationAuthRow from './SimulationAuthRow' - -const SimulationAuthList = ({ authorizations }) => { - return ( -
    - {authorizations.length === 0 ? ( -
    - - No simulations here yet... Add some with the 'New - Simulation' button! -
    - ) : ( - - - - - - - - - - {authorizations.map(authorization => ( - - ))} - -
    Simulation nameLast editedAccess rights -
    - )} -
    - ) -} - -SimulationAuthList.propTypes = { - authorizations: PropTypes.arrayOf(Shapes.Authorization).isRequired, -} - -export default SimulationAuthList diff --git a/frontend/src/components/simulations/SimulationAuthRow.js b/frontend/src/components/simulations/SimulationAuthRow.js deleted file mode 100644 index 0e9c36da..00000000 --- a/frontend/src/components/simulations/SimulationAuthRow.js +++ /dev/null @@ -1,32 +0,0 @@ -import classNames from 'classnames' -import React from 'react' -import SimulationActions from '../../containers/simulations/SimulationActions' -import Shapes from '../../shapes/index' -import { AUTH_DESCRIPTION_MAP, AUTH_ICON_MAP } from '../../util/authorizations' -import { parseAndFormatDateTime } from '../../util/date-time' - -const SimulationAuthRow = ({ simulationAuth }) => ( - - {simulationAuth.simulation.name} - - {parseAndFormatDateTime(simulationAuth.simulation.datetimeLastEdited)} - - - - {AUTH_DESCRIPTION_MAP[simulationAuth.authorizationLevel]} - - - -) - -SimulationAuthRow.propTypes = { - simulationAuth: Shapes.Authorization.isRequired, -} - -export default SimulationAuthRow -- cgit v1.2.3