From 8c3e988a8c95bae7235d5de4ba8e85e77988c395 Mon Sep 17 00:00:00 2001 From: Matthew Shao Date: Mon, 24 Jul 2017 20:34:15 +0800 Subject: [web] Add Download/Load button to OptionEditor. --- web/src/js/components/Modal/OptionModal.jsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'web/src/js/components/Modal') diff --git a/web/src/js/components/Modal/OptionModal.jsx b/web/src/js/components/Modal/OptionModal.jsx index 35ba3a2e..6595717d 100644 --- a/web/src/js/components/Modal/OptionModal.jsx +++ b/web/src/js/components/Modal/OptionModal.jsx @@ -1,7 +1,9 @@ import React, { Component } from "react" import { connect } from "react-redux" import * as modalAction from "../../ducks/ui/modal" +import * as optionAction from "../../ducks/options" import Option from "./Option" +import FileChooser from '../../components/common/FileChooser' import _ from "lodash" function PureOptionHelp({help}){ @@ -52,7 +54,7 @@ class PureOptionModal extends Component { } render() { - const { hideModal, options } = this.props + const { hideModal, options, download, upload } = this.props const { title } = this.state return (
@@ -88,6 +90,17 @@ class PureOptionModal extends Component {
+ + + {upload(file); alert('Option configuration loaded!')}} + text="Load" + className="btn btn-primary" + />
) @@ -100,5 +113,7 @@ export default connect( }), { hideModal: modalAction.hideModal, + download: optionAction.download, + upload: optionAction.upload, } )(PureOptionModal) -- cgit v1.2.3