;
}
const Control = controlMap[this.props.controlName];
+
+ // Creating an object to pass the selected props to the children
+ const passthroughPropsObj = {};
+ this.props.passthroughProps.forEach((k) => {
+ passthroughPropsObj[k] = this.props[k];
+ });
+
return (
diff --git a/superset/assets/src/explore/components/controls/TimeSeriesColumnControl.jsx b/superset/assets/src/explore/components/controls/TimeSeriesColumnControl.jsx
index 24ec40102d3d9..dd8b88a60d069 100644
--- a/superset/assets/src/explore/components/controls/TimeSeriesColumnControl.jsx
+++ b/superset/assets/src/explore/components/controls/TimeSeriesColumnControl.jsx
@@ -22,6 +22,7 @@ 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';
@@ -102,9 +103,9 @@ export default class TimeSeriesColumnControl extends React.Component {
{this.formRow(
- 'Label',
- 'The column header label',
- 'time-lag',
+ t('Label'),
+ t('The column header label'),
+ 'row-label',
,
)}
{this.formRow(
- 'Tooltip',
- 'Column header tooltip',
+ t('Tooltip'),
+ t('Column header tooltip'),
'col-tooltip',
,
)}
{this.formRow(
- 'Type',
- 'Type of comparison, value difference or percentage',
+ t('Type'),
+ t('Type of comparison, value difference or percentage'),
'col-type',
{this.state.colType === 'spark' && this.formRow(
- 'Width',
- 'Width of the sparkline',
+ t('Width'),
+ t('Width of the sparkline'),
'spark-width',
,
)}
{this.state.colType === 'spark' && this.formRow(
- 'Height',
- 'Height of the sparkline',
+ t('Height'),
+ t('Height of the sparkline'),
'spark-width',
,
)}
{['time', 'avg'].indexOf(this.state.colType) >= 0 && this.formRow(
- 'Time Lag',
- 'Number of periods to compare against',
+ t('Time Lag'),
+ t('Number of periods to compare against'),
'time-lag',
,
)}
{['spark'].indexOf(this.state.colType) >= 0 && this.formRow(
- 'Time Ratio',
- 'Number of periods to ratio against',
+ t('Time Ratio'),
+ t('Number of periods to ratio against'),
'time-ratio',
,
)}
{this.state.colType === 'time' && this.formRow(
- 'Type',
- 'Type of comparison, value difference or percentage',
+ t('Type'),
+ t('Type of comparison, value difference or percentage'),
'comp-type',
,
)}
{this.state.colType === 'spark' && this.formRow(
- 'Show Y-axis',
- (
- 'Show Y-axis on the sparkline. Will display the manually set min/max if set or min/max values in the data otherwise.'
+ t('Show Y-axis'),
+ t(
+ 'Show Y-axis on the sparkline. Will display the manually set min/max if set or min/max values in the data otherwise.',
),
'show-y-axis-bounds',
,
)}
{this.state.colType === 'spark' && this.formRow(
- 'Y-axis bounds',
- (
- 'Manually set min/max values for the y-axis.'
+ t('Y-axis bounds'),
+ t(
+ 'Manually set min/max values for the y-axis.',
),
'y-axis-bounds',
,
)}
{this.state.colType !== 'spark' && this.formRow(
- 'Color bounds',
- (
+ t('Color bounds'),
+ t(
`Number bounds used for color encoding from red to blue.
Reverse the numbers for blue to red. To get pure red or blue,
- you can enter either only min or max.`
+ you can enter either only min or max.`,
),
'bounds',
,
)}
{this.formRow(
- 'Number format',
- 'Optional d3 number format string',
+ t('Number format'),
+ t('Optional d3 number format string'),
'd3-format',
,
)}
{this.state.colType === 'spark' && this.formRow(
- 'Date format',
- 'Optional d3 date format string',
+ t('Date format'),
+ t('Optional d3 date format string'),
'date-format',
({ datasource }),
},
diff --git a/superset/assets/src/utils/getClientErrorObject.js b/superset/assets/src/utils/getClientErrorObject.js
index 8af1e54ce9be2..ac5d327d3ccba 100644
--- a/superset/assets/src/utils/getClientErrorObject.js
+++ b/superset/assets/src/utils/getClientErrorObject.js
@@ -50,6 +50,9 @@ export default function getClientErrorObject(response) {
resolve({ ...response, error: errorText });
});
});
+ } else if (typeof (response) === 'object' && Object.keys(response).length === 0) {
+ // Weird empty object that can get converted to string
+ resolve({ ...response, error: String(response) });
} else {
// fall back to Response.statusText or generic error of we cannot read the response
resolve({ ...response, error: response.statusText || t('An error occurred') });