mirror of
https://github.com/apache/superset.git
synced 2026-04-22 01:24:43 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user