Put formData in store (#1281)

* Put formData in store

* Reform actions and reducers

* Maded modifications based on comments:
This commit is contained in:
vera-liu
2016-10-07 14:53:36 -07:00
committed by GitHub
parent 3384e7598e
commit b7d1f78f5e
13 changed files with 283 additions and 390 deletions

View File

@@ -8,22 +8,19 @@ const propTypes = {
};
class SqlClause extends React.Component {
changeWhere(whereClause) {
this.props.actions.setWhereClause(whereClause);
}
changeHaving(havingClause) {
this.props.actions.setHavingClause(havingClause);
onChange(key, event) {
this.props.actions.setFormData(key, event.target.value);
}
render() {
return (
<div className="panel space-1">
<div className="panel">
<div className="panel-header">SQL</div>
<div className="panel-body">
<div className="row">
<h5 className="section-heading">Where</h5>
<input
type="text"
onChange={this.changeWhere.bind(this)}
onChange={this.onChange.bind(this, 'where')}
className="form-control input-sm"
placeholder="Where Clause"
/>
@@ -32,7 +29,7 @@ class SqlClause extends React.Component {
<h5 className="section-heading">Having</h5>
<input
type="text"
onChange={this.changeHaving.bind(this)}
onChange={this.onChange.bind(this, 'having')}
className="form-control input-sm"
placeholder="Having Clause"
/>