superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From michel...@apache.org
Subject [incubator-superset] 02/03: fix: time series table (#7302) (#7312)
Date Wed, 15 May 2019 00:52:08 GMT
This is an automated email from the ASF dual-hosted git repository.

michellet pushed a commit to branch release--0.32
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git

commit 8e9a114442907949a6ab09c28c3d979c8b2021b5
Author: michellethomas <michelle.q.thomas@gmail.com>
AuthorDate: Wed Apr 17 12:37:45 2019 -0700

    fix: time series table (#7302) (#7312)
    
    * fix: time series table
    
    * fix: add default value for label
    
    * fix: use prop values if defined
    
    * fix: revert CollectionControl changes
    
    (cherry picked from commit 5dab983fd8be6463e58a699e59177846c774c816)
    (cherry picked from commit 9341995803883a27a21e5021c39b51ec63ce9ccd)
---
 .../controls/TimeSeriesColumnControl.jsx           | 43 +++++++++++++++++++++-
 1 file changed, 42 insertions(+), 1 deletion(-)

diff --git a/superset/assets/src/explore/components/controls/TimeSeriesColumnControl.jsx b/superset/assets/src/explore/components/controls/TimeSeriesColumnControl.jsx
index 24ec401..145f80f 100644
--- a/superset/assets/src/explore/components/controls/TimeSeriesColumnControl.jsx
+++ b/superset/assets/src/explore/components/controls/TimeSeriesColumnControl.jsx
@@ -22,16 +22,43 @@ import {
   Row, Col, FormControl, OverlayTrigger, Popover,
 } from 'react-bootstrap';
 import Select from 'react-select';
+import { t } from '@superset-ui/translation';
 
 import InfoTooltipWithTrigger from '../../../components/InfoTooltipWithTrigger';
 import BoundsControl from './BoundsControl';
 import CheckboxControl from './CheckboxControl';
 
 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,
 };
 
 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: () => {},
 };
 
@@ -52,7 +79,21 @@ const colTypeOptions = [
 export default class TimeSeriesColumnControl extends React.Component {
   constructor(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;
     this.state = state;
     this.onChange = this.onChange.bind(this);


Mime
View raw message