diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-07-10 10:21:46 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:48:01 +0200 |
| commit | 8aa174e70c01631ae4e00a6d208966fcd77cf972 (patch) | |
| tree | 35ec6527e8d7a0b4093e18c8cb501c293a18b5eb /frontend/src/components/modals/custom-components/NewExperimentModalComponent.js | |
| parent | 607e8c72d85bf79dcd9bf28df96b239e2764bc30 (diff) | |
Add implementation of portfolio and scenario UI structure
Diffstat (limited to 'frontend/src/components/modals/custom-components/NewExperimentModalComponent.js')
| -rw-r--r-- | frontend/src/components/modals/custom-components/NewExperimentModalComponent.js | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/frontend/src/components/modals/custom-components/NewExperimentModalComponent.js b/frontend/src/components/modals/custom-components/NewExperimentModalComponent.js deleted file mode 100644 index ce685837..00000000 --- a/frontend/src/components/modals/custom-components/NewExperimentModalComponent.js +++ /dev/null @@ -1,105 +0,0 @@ -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, - topologies: PropTypes.arrayOf(Shapes.Topology), - schedulers: PropTypes.arrayOf(Shapes.Scheduler), - traces: PropTypes.arrayOf(Shapes.Trace), - callback: PropTypes.func.isRequired, - } - - reset() { - this.textInput.value = '' - this.topologySelect.selectedIndex = 0 - this.traceSelect.selectedIndex = 0 - this.schedulerSelect.selectedIndex = 0 - } - - onSubmit() { - this.props.callback( - this.textInput.value, - this.topologySelect.value, - this.traceSelect.value, - this.schedulerSelect.value, - ) - this.reset() - } - - onCancel() { - this.props.callback(undefined) - this.reset() - } - - render() { - return ( - <Modal - title="New Experiment" - show={this.props.show} - onSubmit={this.onSubmit.bind(this)} - onCancel={this.onCancel.bind(this)} - > - <form - onSubmit={e => { - e.preventDefault() - this.onSubmit() - }} - > - <div className="form-group"> - <label className="form-control-label">Name</label> - <input - type="text" - className="form-control" - required - ref={textInput => (this.textInput = textInput)} - /> - </div> - <div className="form-group"> - <label className="form-control-label">Topology</label> - <select - className="form-control" - ref={topologySelect => (this.topologySelect = topologySelect)} - > - {this.props.topologies.map(topology => ( - <option value={topology._id} key={topology._id}> - {topology.name} - </option> - ))} - </select> - </div> - <div className="form-group"> - <label className="form-control-label">Trace</label> - <select - className="form-control" - ref={traceSelect => (this.traceSelect = traceSelect)} - > - {this.props.traces.map(trace => ( - <option value={trace._id} key={trace._id}> - {trace.name} - </option> - ))} - </select> - </div> - <div className="form-group"> - <label className="form-control-label">Scheduler</label> - <select - className="form-control" - ref={schedulerSelect => (this.schedulerSelect = schedulerSelect)} - > - {this.props.schedulers.map(scheduler => ( - <option value={scheduler.name} key={scheduler.name}> - {scheduler.name} - </option> - ))} - </select> - </div> - </form> - </Modal> - ) - } -} - -export default NewExperimentModalComponent |
