11import React from 'react' ;
2+ import PropTypes from 'prop-types' ;
23import { reduxForm } from 'redux-form' ;
34import ReactTabs from 'react-tabs' ;
45
@@ -10,11 +11,7 @@ import { contains } from '../utils';
1011import * as Action from '../actions' ;
1112
1213
13- const Tab = ReactTabs . Tab ;
14- const Tabs = ReactTabs . Tabs ;
15- const TabList = ReactTabs . TabList ;
16- const TabPanel = ReactTabs . TabPanel ;
17-
14+ const { Tab, Tabs, TabList, TabPanel } = { ...ReactTabs } ;
1815
1916const FeaturizeForm = ( props ) => {
2017 const { fields, fields : { datasetID, featuresetName, customFeatsCode } ,
@@ -69,9 +66,13 @@ const FeaturizeForm = (props) => {
6966 < TabPanel >
7067 < a
7168 href = "#"
72- onClick = { ( ) => {
69+ onClick = {
70+ ( ) => {
7371 props . dispatch ( Action . groupToggleCheckedFeatures (
74- props . featuresByCategory [ ctgy ] ) ) ; } }
72+ props . featuresByCategory [ ctgy ]
73+ ) ) ;
74+ }
75+ }
7576 >
7677 Check/Uncheck All
7778 </ a >
@@ -103,7 +104,8 @@ const FeaturizeForm = (props) => {
103104 < TabPanel >
104105 < TextareaInput
105106 label = "Enter Python code defining custom features"
106- rows = "10" cols = "50"
107+ rows = "10"
108+ cols = "50"
107109 { ...customFeatsCode }
108110 />
109111 </ TabPanel >
@@ -113,19 +115,21 @@ const FeaturizeForm = (props) => {
113115 ) ;
114116} ;
115117FeaturizeForm . propTypes = {
116- fields : React . PropTypes . object . isRequired ,
117- datasets : React . PropTypes . arrayOf ( React . PropTypes . object ) . isRequired ,
118- error : React . PropTypes . string ,
119- handleSubmit : React . PropTypes . func . isRequired ,
120- submitting : React . PropTypes . bool . isRequired ,
121- resetForm : React . PropTypes . func . isRequired ,
122- selectedProject : React . PropTypes . object ,
123- featuresByCategory : React . PropTypes . object ,
124- tagList : React . PropTypes . arrayOf ( React . PropTypes . string ) . isRequired ,
125- featuresList : React . PropTypes . array ,
126- featureDescriptions : React . PropTypes . object
118+ fields : PropTypes . object . isRequired ,
119+ datasets : PropTypes . arrayOf ( PropTypes . object ) . isRequired ,
120+ error : PropTypes . string ,
121+ handleSubmit : PropTypes . func . isRequired ,
122+ submitting : PropTypes . bool . isRequired ,
123+ resetForm : PropTypes . func . isRequired ,
124+ selectedProject : PropTypes . object . isRequired ,
125+ featuresByCategory : PropTypes . object . isRequired ,
126+ tagList : PropTypes . arrayOf ( PropTypes . string ) . isRequired ,
127+ featuresList : PropTypes . array . isRequired ,
128+ featureDescriptions : PropTypes . object . isRequired
129+ } ;
130+ FeaturizeForm . defaultProps = {
131+ error : ""
127132} ;
128-
129133
130134const mapStateToProps = ( state , ownProps ) => {
131135 const featuresList = state . features . featsWithCheckedTags ;
@@ -144,7 +148,8 @@ const mapStateToProps = (state, ownProps) => {
144148 featureDescriptions : state . features . descriptions ,
145149 datasets : filteredDatasets ,
146150 fields : featuresList . concat (
147- [ 'datasetID' , 'featuresetName' , 'customFeatsCode' ] ) ,
151+ [ 'datasetID' , 'featuresetName' , 'customFeatsCode' ]
152+ ) ,
148153 initialValues : { ...initialValues ,
149154 datasetID : zerothDataset ? zerothDataset . id . toString ( ) : "" ,
150155 customFeatsCode : "" }
0 commit comments