diff --git a/web/src/css/app.less b/web/src/css/app.less index b9b5b310a..1f246b192 100644 --- a/web/src/css/app.less +++ b/web/src/css/app.less @@ -14,7 +14,6 @@ html { @import (less) "flowtable.less"; @import (less) "flowdetail.less"; @import (less) "flowview.less"; -@import (less) "prompt.less"; @import (less) "eventlog.less"; @import (less) "footer.less"; @import (less) "codemirror.less"; diff --git a/web/src/css/prompt.less b/web/src/css/prompt.less deleted file mode 100644 index eee0426dd..000000000 --- a/web/src/css/prompt.less +++ /dev/null @@ -1,27 +0,0 @@ -.prompt-dialog { - top: 0; - bottom: 0; - left: 0; - right: 0; - position: fixed; - z-index: 100; - background-color: rgba(0, 0, 0, 0.1); -} - -.prompt-content { - position: fixed; - bottom: 0; - left: 0; - right: 0; - height: 25px; - padding: 2px 5px; - background-color: white; - box-shadow: 0 -1px 3px lightgray; - - .option { - cursor: pointer; - &:not(:last-child)::after { - content: ", "; - } - } -} \ No newline at end of file diff --git a/web/src/js/components/FlowView.jsx b/web/src/js/components/FlowView.jsx index d03d681aa..fbdbb0496 100644 --- a/web/src/js/components/FlowView.jsx +++ b/web/src/js/components/FlowView.jsx @@ -5,7 +5,6 @@ import _ from 'lodash' import Nav from './FlowView/Nav' import { Request, Response, ErrorView as Error } from './FlowView/Messages' import Details from './FlowView/Details' -import Prompt from './Prompt' import { selectTab } from '../ducks/ui/flow' @@ -80,7 +79,7 @@ class FlowView extends Component { /> this.tabComponent = tab } flow={flow} updateFlow={updateFlow} /> {this.props.promptOpen && ( - +
fixme
)} ) diff --git a/web/src/js/components/Header/FileMenu.jsx b/web/src/js/components/Header/FileMenu.jsx index 5cb8e507a..1e3b9268a 100644 --- a/web/src/js/components/Header/FileMenu.jsx +++ b/web/src/js/components/Header/FileMenu.jsx @@ -20,7 +20,7 @@ FileMenu.onNewClick = (e, clearFlows) => { clearFlows() } -export function FileMenu ({clearFlows, loadFlows, saveFlows, openModal}) { +export function FileMenu ({clearFlows, loadFlows, saveFlows, openOptions}) { return ( FileMenu.onNewClick(e, clearFlows)}> @@ -38,7 +38,7 @@ export function FileMenu ({clearFlows, loadFlows, saveFlows, openModal}) { - { e.preventDefault(); openModal(); }}> + { e.preventDefault(); openOptions(); }}>  Options @@ -59,6 +59,6 @@ export default connect( clearFlows: flowsActions.clear, loadFlows: flowsActions.upload, saveFlows: flowsActions.download, - openModal: () => modalActions.setActiveModal('OptionModal'), + openOptions: () => modalActions.setActiveModal('OptionModal'), } )(FileMenu) diff --git a/web/src/js/components/Prompt.jsx b/web/src/js/components/Prompt.jsx deleted file mode 100755 index 77b07027c..000000000 --- a/web/src/js/components/Prompt.jsx +++ /dev/null @@ -1,67 +0,0 @@ -import React from 'react' -import PropTypes from 'prop-types' -import ReactDOM from 'react-dom' -import _ from 'lodash' - -import {Key} from '../utils.js' - -Prompt.propTypes = { - options: PropTypes.array.isRequired, - done: PropTypes.func.isRequired, - prompt: PropTypes.string, -} - -export default function Prompt({ prompt, done, options }) { - const opts = [] - - for (let i = 0; i < options.length; i++) { - let opt = options[i] - if (_.isString(opt)) { - let str = opt - while (str.length > 0 && keyTaken(str[0])) { - str = str.substr(1) - } - opt = { text: opt, key: str[0] } - } - if (!opt.text || !opt.key || keyTaken(opt.key)) { - throw 'invalid options' - } - opts.push(opt) - } - - function keyTaken(k) { - return _.map(opts, 'key').includes(k) - } - - function onKeyDown(event) { - event.stopPropagation() - event.preventDefault() - const key = opts.find(opt => Key[opt.key.toUpperCase()] === event.keyCode) - if (!key && event.keyCode !== Key.ESC && event.keyCode !== Key.ENTER) { - return - } - done(key.key || false) - } - - return ( -
-
- {prompt || Select: } - {opts.map(opt => { - const idx = opt.text.indexOf(opt.key) - function onClick(event) { - done(opt.key) - event.stopPropagation() - } - return ( - - {idx !== -1 ? opt.text.substring(0, idx) : opt.text + '('} - {opt.key} - {idx !== -1 ? opt.text.substring(idx + 1) : ')'} - - ) - })} -
-
- ) -}