All files / javascripts/explorev2/components NotGroupBy.jsx

0% Statements 0/15
100% Branches 0/0
0% Functions 0/4
0% Lines 0/14
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 57 58 59 60 61 62 63 64 65 66 67 68 69                                                                                                                                         
import React from 'react';
import SelectArray from './SelectArray';
import { bindActionCreators } from 'redux';
import * as actions from '../actions/exploreActions';
import { connect } from 'react-redux';
 
const propTypes = {
  actions: React.PropTypes.object,
  columnOpts: React.PropTypes.array,
  columns: React.PropTypes.array,
  orderingOpts: React.PropTypes.array,
  orderings: React.PropTypes.array,
};
 
const defaultProps = {
  columnOpts: [],
  columns: [],
  orderingOpts: [],
  orderings: [],
};
 
const NotGroupBy = (props) => {
  const selects = [
    {
      key: 'columns',
      title: 'Columns',
      options: props.columnOpts,
      value: props.columns,
      multi: true,
      width: '12',
    },
    {
      key: 'orderings',
      title: 'Orderings',
      options: props.orderingOpts,
      value: props.orderings,
      multi: true,
      width: '12',
    }];
  return (
    <div className="panel">
      <div className="panel-header">Not GroupBy</div>
      <div className="panel-body">
        <SelectArray selectArray={selects} />
      </div>
    </div>
  );
};
 
NotGroupBy.propTypes = propTypes;
NotGroupBy.defaultProps = defaultProps;
 
function mapStateToProps(state) {
  return {
    columnOpts: state.columnOpts,
    columns: state.viz.formData.columns,
    orderingOpts: state.orderingOpts,
    orderings: state.viz.formData.orderings,
  };
}
 
function mapDispatchToProps(dispatch) {
  return {
    actions: bindActionCreators(actions, dispatch),
  };
}
 
export default connect(mapStateToProps, mapDispatchToProps)(NotGroupBy);