From f604406453f95c82c3e5e4294a51245661868bbe Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Thu, 14 Sep 2017 14:07:21 +0200 Subject: First attempt at experiment list UI --- .../NewExperimentModalComponent.js | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 src/components/modals/custom-components/NewExperimentModalComponent.js (limited to 'src/components/modals') diff --git a/src/components/modals/custom-components/NewExperimentModalComponent.js b/src/components/modals/custom-components/NewExperimentModalComponent.js new file mode 100644 index 00000000..9efccc8a --- /dev/null +++ b/src/components/modals/custom-components/NewExperimentModalComponent.js @@ -0,0 +1,87 @@ +import PropTypes from "prop-types"; +import React from "react"; +import Shapes from "../../../shapes"; +import Modal from "../Modal"; + +class NewExperimentModalComponent extends React.Component { + static propTypes = { + show: PropTypes.bool.isRequired, + paths: PropTypes.arrayOf(Shapes.Path), + schedulers: PropTypes.arrayOf(Shapes.Scheduler), + traces: PropTypes.arrayOf(Shapes.Trace), + callback: PropTypes.func.isRequired, + }; + + reset() { + this.textInput.value = ""; + this.pathSelect.selectedIndex = 0; + this.traceSelect.selectedIndex = 0; + this.schedulerSelect.selectedIndex = 0; + } + + onSubmit() { + this.props.callback(this.textInput.value, this.pathSelect.value, this.traceSelect.value, + this.schedulerSelect.value); + this.reset(); + } + + onCancel() { + this.props.callback(undefined); + this.reset(); + } + + render() { + return ( + +
{ + e.preventDefault(); + this.onSubmit(); + }}> +
+ + this.textInput = textInput}/> +
+
+ + +
+
+ + +
+
+ + +
+
+
+ ); + } +} + +export default NewExperimentModalComponent; -- cgit v1.2.3