@@ -4,20 +4,14 @@ import {connect} from 'react-redux';
44import { Field , FieldArray , getFormValues , reduxForm } from 'redux-form' ;
55import { withRouter } from 'react-router-dom' ;
66import { Button , Grid } from 'semantic-ui-react' ;
7- import { DropdownField } from 'react-semantic-redux-form' ;
87import { asyncValidate , validate , validateScaffoldProperties , warn } from '../utils/validation' ;
98import ScaffoldField from '../components-ui/inputs/Field' ;
109import { saveOpenScaffold } from '../actions/deploy-contract' ;
11- import { fetchKeys } from '../actions/keys' ;
1210import { TemplateSelect } from "../components/TemplateSelect" ;
1311import ScaffoldPropertyFields from "../components-ui/inputs/PropertyFields" ;
1412
1513class OpenScaffoldForm extends Component {
1614
17- componentDidMount ( ) {
18- this . props . actions . fetchKeys ( ) ;
19- }
20-
2115 handleOnSubmit = async e => {
2216 const { actions, history, formValues} = this . props ;
2317 e . preventDefault ( ) ;
@@ -31,7 +25,7 @@ class OpenScaffoldForm extends Component {
3125 } ;
3226
3327 render ( ) {
34- const { invalid : disableSubmit , formValues, scaffoldFieldsErrors, openKeyOptions } = this . props ;
28+ const { invalid : disableSubmit , formValues, scaffoldFieldsErrors } = this . props ;
3529
3630 return (
3731 < form onSubmit = { this . handleOnSubmit } >
@@ -40,17 +34,6 @@ class OpenScaffoldForm extends Component {
4034 < Grid . Column width = { 16 } style = { { paddingTop : '10px' } } >
4135 < TemplateSelect />
4236 </ Grid . Column >
43- < Grid . Column width = { 16 } style = { { paddingTop : '10px' } } >
44- < Field
45- key = { 1 }
46- className = "ui selection fluid dropdown"
47- placeholder = "Choose Developer API Key"
48- component = { DropdownField }
49- options = { openKeyOptions }
50- type = "text"
51- name = "openKey"
52- />
53- </ Grid . Column >
5437 < Grid . Column width = { 16 } >
5538 < Field
5639 key = { 2 }
@@ -168,24 +151,19 @@ const getValues = getFormValues('openScaffoldCreationForm');
168151const mapStateToProps = state => {
169152 const formValues = getValues ( state ) || { } ;
170153 const initialValues = state . scaffoldFeilds ;
171- const openKey = state . auth ? state . auth . openKeys : undefined ;
172154 const scaffoldFieldsErrors = validateScaffoldProperties ( formValues . properties || [ ] ) ;
173- const openKeyOptions = state . keys . filter ( it => it . enabled ) . map ( it => ( { text : it . value , value : it . value } ) ) ;
174155
175156 return {
176157 formValues,
177158 initialValues,
178- openKey,
179159 scaffoldFieldsErrors,
180- openKeyOptions
181160 } ;
182161} ;
183162
184163const mapDispatchToProps = dispatch => ( {
185164 actions : bindActionCreators (
186165 {
187- saveOpenScaffold : saveOpenScaffold ,
188- fetchKeys
166+ saveOpenScaffold : saveOpenScaffold
189167 } ,
190168 dispatch
191169 )
0 commit comments