summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-11-07 17:07:49 +0100
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-11-07 17:07:49 +0100
commit4b9cbc645a8e6824996c4c0afef438164e569928 (patch)
treebda7b053e7d622000a1b23ac819ef2f1c1cc4374 /src
parent886877950b1a2b4006d1f5dbe93367c086e213a0 (diff)
parent2f71cb1c9fd3e649a1f0e6f713922a73372f064e (diff)
Merge branch 'master' into upgrade-dependencies
# Conflicts: # README.md
Diffstat (limited to 'src')
-rw-r--r--src/components/app/sidebars/elements/LoadChartComponent.js11
-rw-r--r--src/components/experiments/ExperimentListComponent.js32
-rw-r--r--src/containers/experiments/ExperimentListContainer.js1
-rw-r--r--src/reducers/construction-mode.js2
4 files changed, 37 insertions, 9 deletions
diff --git a/src/components/app/sidebars/elements/LoadChartComponent.js b/src/components/app/sidebars/elements/LoadChartComponent.js
index 6f66010e..5f0d40cb 100644
--- a/src/components/app/sidebars/elements/LoadChartComponent.js
+++ b/src/components/app/sidebars/elements/LoadChartComponent.js
@@ -4,6 +4,7 @@ import SvgSaver from "svgsaver";
import {
VictoryAxis,
VictoryChart,
+ VictoryLabel,
VictoryLine,
VictoryScatter
} from "victory";
@@ -56,9 +57,17 @@ const VictoryChartComponent = ({ data, currentTick, showCurrentTick }) => (
<VictoryScatter data={data} />
{showCurrentTick ? (
<VictoryLine
+ labelComponent={
+ <VictoryLabel renderInPortal angle={90} dy={-5} dx={60} />
+ }
data={[{ x: currentTick + 1, y: 0 }, { x: currentTick + 1, y: 1 }]}
+ labels={point =>
+ point.y === 1
+ ? "Current tick : " + convertSecondsToFormattedTime(currentTick)
+ : ""}
style={{
- data: { stroke: "#00A6D6", strokeWidth: 3 }
+ data: { stroke: "#00A6D6", strokeWidth: 4 },
+ labels: { fill: "#00A6D6" }
}}
/>
) : (
diff --git a/src/components/experiments/ExperimentListComponent.js b/src/components/experiments/ExperimentListComponent.js
index 28c06f29..2f7106e5 100644
--- a/src/components/experiments/ExperimentListComponent.js
+++ b/src/components/experiments/ExperimentListComponent.js
@@ -2,15 +2,30 @@ import PropTypes from "prop-types";
import React from "react";
import ExperimentRowContainer from "../../containers/experiments/ExperimentRowContainer";
-const ExperimentListComponent = ({ experimentIds }) => {
+const ExperimentListComponent = ({ experimentIds, loading }) => {
+ let alert;
+
+ if (loading) {
+ alert = (
+ <div className="alert alert-success">
+ <span className="fa fa-refresh fa-spin mr-2" />
+ <strong>Loading Experiments...</strong>
+ </div>
+ );
+ } else if (experimentIds.length === 0 && !loading) {
+ alert = (
+ <div className="alert alert-info">
+ <span className="fa fa-question-circle mr-2" />
+ <strong>No experiments here yet...</strong> Add some with the button
+ below!
+ </div>
+ );
+ }
+
return (
<div className="vertically-expanding-container">
- {experimentIds.length === 0 ? (
- <div className="alert alert-info">
- <span className="info-icon fa fa-question-circle mr-2" />
- <strong>No experiments here yet...</strong> Add some with the button
- below!
- </div>
+ {alert ? (
+ alert
) : (
<table className="table table-striped">
<thead>
@@ -37,7 +52,8 @@ const ExperimentListComponent = ({ experimentIds }) => {
};
ExperimentListComponent.propTypes = {
- experimentIds: PropTypes.arrayOf(PropTypes.number).isRequired
+ experimentIds: PropTypes.arrayOf(PropTypes.number).isRequired,
+ loading: PropTypes.bool
};
export default ExperimentListComponent;
diff --git a/src/containers/experiments/ExperimentListContainer.js b/src/containers/experiments/ExperimentListContainer.js
index 632942bf..53bb1dad 100644
--- a/src/containers/experiments/ExperimentListContainer.js
+++ b/src/containers/experiments/ExperimentListContainer.js
@@ -7,6 +7,7 @@ const mapStateToProps = state => {
!("experimentIds" in state.objects.simulation[state.currentSimulationId])
) {
return {
+ loading: true,
experimentIds: []
};
}
diff --git a/src/reducers/construction-mode.js b/src/reducers/construction-mode.js
index 4778bd44..f58684e6 100644
--- a/src/reducers/construction-mode.js
+++ b/src/reducers/construction-mode.js
@@ -1,5 +1,6 @@
import { combineReducers } from "redux";
import { OPEN_EXPERIMENT_SUCCEEDED } from "../actions/experiments";
+import { GO_DOWN_ONE_INTERACTION_LEVEL } from "../actions/interaction-level";
import {
CANCEL_NEW_ROOM_CONSTRUCTION_SUCCEEDED,
FINISH_NEW_ROOM_CONSTRUCTION,
@@ -29,6 +30,7 @@ export function inRackConstructionMode(state = false, action) {
return true;
case STOP_RACK_CONSTRUCTION:
case OPEN_EXPERIMENT_SUCCEEDED:
+ case GO_DOWN_ONE_INTERACTION_LEVEL:
return false;
default:
return state;