Added controls for Table Viz (#1253)

* Added controls for Table Viz

* Change control panel container to stateless

* Changed specs

* Resolved conflicts
This commit is contained in:
vera-liu
2016-10-05 14:53:51 -07:00
committed by GitHub
parent 659bf6d7e8
commit 66b498de25
11 changed files with 294 additions and 85 deletions

View File

@@ -1,20 +1,36 @@
import React from 'react';
import { connect } from 'react-redux';
import { Panel } from 'react-bootstrap';
import TimeFilter from './TimeFilter';
import ChartControl from './ChartControl';
import GroupBy from './GroupBy';
import SqlClause from './SqlClause';
import Filters from './Filters';
import { DefaultControls, VIZ_CONTROL_MAPPING } from '../constants';
const ControlPanelsContainer = function () {
const propTypes = {
vizType: React.PropTypes.string,
};
const defaultProps = {
vizType: null,
};
function ControlPanelsContainer(props) {
return (
<Panel>
<ChartControl />
<TimeFilter />
<GroupBy />
<SqlClause />
<Filters />
{DefaultControls}
{VIZ_CONTROL_MAPPING[props.vizType]}
</Panel>
);
};
export default ControlPanelsContainer;
}
ControlPanelsContainer.propTypes = propTypes;
ControlPanelsContainer.defaultProps = defaultProps;
function mapStateToProps(state) {
return {
vizType: state.vizType,
};
}
function mapDispatchToProps() {
return {};
}
export default connect(mapStateToProps, mapDispatchToProps)(ControlPanelsContainer);