Skip to content

Commit

Permalink
[hotfix] fixing issues around new time_table viz (#3599)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch authored Oct 4, 2017
1 parent ed21244 commit 1fb8716
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import InfoTooltipWithTrigger from '../../components/InfoTooltipWithTrigger';
import { t } from '../../locales';

const propTypes = {
label: PropTypes.string.isRequired,
label: PropTypes.string,
description: PropTypes.string,
validationErrors: PropTypes.array,
renderTrigger: PropTypes.bool,
Expand Down Expand Up @@ -52,6 +52,9 @@ export default class ControlHeader extends React.Component {
return null;
}
render() {
if (!this.props.label) {
return null;
}
const labelClass = (this.props.validationErrors.length > 0) ? 'text-danger' : '';
return (
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const propTypes = {
]),
isFloat: PropTypes.bool,
isInt: PropTypes.bool,
control: PropTypes.func,
controlName: PropTypes.string.isRequired,
};

const defaultProps = {
Expand Down Expand Up @@ -64,7 +64,7 @@ export default class CollectionControl extends React.Component {
if (this.props.value.length === 0) {
return <div className="text-muted">{this.props.placeholder}</div>;
}
const control = controlMap[this.props.control];
const Control = controlMap[this.props.controlName];
return (
<SortableListGroup
useDragHandle
Expand All @@ -81,7 +81,7 @@ export default class CollectionControl extends React.Component {
<SortableDragger />
</div>
<div className="pull-left">
<control
<Control
{...o}
onChange={this.onChange.bind(this, i)}
/>
Expand Down
2 changes: 1 addition & 1 deletion superset/assets/javascripts/explore/stores/controls.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,7 @@ export const controls = {
type: 'CollectionControl',
label: t('Time Series Columns'),
validators: [v.nonEmpty],
control: 'TimeSeriesColumnControl',
controlName: 'TimeSeriesColumnControl',
},

};
Expand Down
2 changes: 1 addition & 1 deletion superset/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"react-syntax-highlighter": "^5.7.0",
"react-virtualized": "^9.3.0",
"react-virtualized-select": "^2.4.0",
"reactable": "^0.14.0",
"reactable": "^0.14.1",
"redux": "^3.5.2",
"redux-localstorage": "^0.4.1",
"redux-thunk": "^2.1.0",
Expand Down
4 changes: 2 additions & 2 deletions superset/assets/visualizations/time_table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ function FormattedNumber({ num, format }) {
return <span>{num}</span>;
}
FormattedNumber.propTypes = {
num: propTypes.number.isRequired,
format: propTypes.string.isRequired,
num: propTypes.number,
format: propTypes.string,
};

function viz(slice, payload) {
Expand Down

0 comments on commit 1fb8716

Please sign in to comment.