mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
fix: time series table (#7302)
* fix: time series table * fix: add default value for label * fix: use prop values if defined * fix: revert CollectionControl changes
This commit is contained in:
parent
0f1702b88e
commit
5dab983fd8
@ -22,16 +22,43 @@ import {
|
|||||||
Row, Col, FormControl, OverlayTrigger, Popover,
|
Row, Col, FormControl, OverlayTrigger, Popover,
|
||||||
} from 'react-bootstrap';
|
} from 'react-bootstrap';
|
||||||
import Select from 'react-select';
|
import Select from 'react-select';
|
||||||
|
import { t } from '@superset-ui/translation';
|
||||||
|
|
||||||
import InfoTooltipWithTrigger from '../../../components/InfoTooltipWithTrigger';
|
import InfoTooltipWithTrigger from '../../../components/InfoTooltipWithTrigger';
|
||||||
import BoundsControl from './BoundsControl';
|
import BoundsControl from './BoundsControl';
|
||||||
import CheckboxControl from './CheckboxControl';
|
import CheckboxControl from './CheckboxControl';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
|
label: PropTypes.string,
|
||||||
|
tooltip: PropTypes.string,
|
||||||
|
colType: PropTypes.string,
|
||||||
|
width: PropTypes.string,
|
||||||
|
height: PropTypes.string,
|
||||||
|
timeLag: PropTypes.string,
|
||||||
|
timeRatio: PropTypes.string,
|
||||||
|
comparisonType: PropTypes.string,
|
||||||
|
showYAxis: PropTypes.bool,
|
||||||
|
yAxisBounds: PropTypes.array,
|
||||||
|
bounds: PropTypes.array,
|
||||||
|
d3format: PropTypes.string,
|
||||||
|
dateFormat: PropTypes.string,
|
||||||
onChange: PropTypes.func,
|
onChange: PropTypes.func,
|
||||||
};
|
};
|
||||||
|
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
|
label: t('Time Series Columns'),
|
||||||
|
tooltip: '',
|
||||||
|
colType: '',
|
||||||
|
width: '',
|
||||||
|
height: '',
|
||||||
|
timeLag: '',
|
||||||
|
timeRatio: '',
|
||||||
|
comparisonType: '',
|
||||||
|
showYAxis: false,
|
||||||
|
yAxisBounds: [null, null],
|
||||||
|
bounds: [null, null],
|
||||||
|
d3format: '',
|
||||||
|
dateFormat: '',
|
||||||
onChange: () => {},
|
onChange: () => {},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -52,7 +79,21 @@ const colTypeOptions = [
|
|||||||
export default class TimeSeriesColumnControl extends React.Component {
|
export default class TimeSeriesColumnControl extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
const state = { ...props };
|
const state = {
|
||||||
|
label: this.props.label,
|
||||||
|
tooltip: this.props.tooltip,
|
||||||
|
colType: this.props.colType,
|
||||||
|
width: this.props.width,
|
||||||
|
height: this.props.height,
|
||||||
|
timeLag: this.props.timeLag,
|
||||||
|
timeRatio: this.props.timeRatio,
|
||||||
|
comparisonType: this.props.comparisonType,
|
||||||
|
showYAxis: this.props.showYAxis,
|
||||||
|
yAxisBounds: this.props.yAxisBounds,
|
||||||
|
bounds: this.props.bounds,
|
||||||
|
d3format: this.props.d3format,
|
||||||
|
dateFormat: this.props.dateFormat,
|
||||||
|
};
|
||||||
delete state.onChange;
|
delete state.onChange;
|
||||||
this.state = state;
|
this.state = state;
|
||||||
this.onChange = this.onChange.bind(this);
|
this.onChange = this.onChange.bind(this);
|
||||||
|
Loading…
Reference in New Issue
Block a user