All files / javascripts/explorev2/components SqlClause.jsx

0% Statements 0/10
100% Branches 0/0
0% Functions 0/2
0% Lines 0/10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56                                                                                                               
import React from 'react';
import { bindActionCreators } from 'redux';
import * as actions from '../actions/exploreActions';
import { connect } from 'react-redux';
 
const propTypes = {
  actions: React.PropTypes.object,
};
 
class SqlClause extends React.Component {
  onChange(key, event) {
    this.props.actions.setFormData(key, event.target.value);
  }
  render() {
    return (
      <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.onChange.bind(this, 'where')}
              className="form-control input-sm"
              placeholder="Where Clause"
            />
          </div>
          <div className="row">
            <h5 className="section-heading">Having</h5>
            <input
              type="text"
              onChange={this.onChange.bind(this, 'having')}
              className="form-control input-sm"
              placeholder="Having Clause"
            />
          </div>
        </div>
      </div>
    );
  }
}
 
SqlClause.propTypes = propTypes;
 
function mapStateToProps() {
  return {};
}
 
function mapDispatchToProps(dispatch) {
  return {
    actions: bindActionCreators(actions, dispatch),
  };
}
 
export default connect(mapStateToProps, mapDispatchToProps)(SqlClause);