diff --git a/jitney_events b/jitney_events new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/superset/assets/javascripts/explorev2/components/ChartContainer.jsx b/superset/assets/javascripts/explorev2/components/ChartContainer.jsx index 66879d949d7df..ce6a5b9b1c0fc 100644 --- a/superset/assets/javascripts/explorev2/components/ChartContainer.jsx +++ b/superset/assets/javascripts/explorev2/components/ChartContainer.jsx @@ -211,6 +211,8 @@ class ChartContainer extends React.PureComponent { if (this.props.standalone) { return this.renderChart(); } + const queryResponse = this.props.queryResponse; + const query = queryResponse && queryResponse.query ? queryResponse.query : null; return (
{data.query}; - this.setState({ modalBody }); - }, - error(data) { - this.setState({ modalBody: (
{data.error}) }); - }, - }); + if (this.props.query) { + const modalBody = ( +
{this.props.query}+ ); + this.setState({ modalBody }); + } else { + $.ajax({ + type: 'GET', + url: this.props.queryEndpoint, + success: (data) => { + const modalBody = data.language ? +
{data.query}; + this.setState({ modalBody }); + }, + error(data) { + this.setState({ modalBody: (
{data.error}) }); + }, + }); + } } render() { return ( diff --git a/superset/assets/javascripts/explorev2/components/ExploreActionButtons.jsx b/superset/assets/javascripts/explorev2/components/ExploreActionButtons.jsx index 5823c93bf6f5a..bb30c9821b685 100644 --- a/superset/assets/javascripts/explorev2/components/ExploreActionButtons.jsx +++ b/superset/assets/javascripts/explorev2/components/ExploreActionButtons.jsx @@ -8,9 +8,10 @@ const propTypes = { canDownload: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]).isRequired, slice: PropTypes.object, queryEndpoint: PropTypes.string, + query: PropTypes.string, }; -export default function ExploreActionButtons({ canDownload, slice, queryEndpoint }) { +export default function ExploreActionButtons({ canDownload, slice, query, queryEndpoint }) { const exportToCSVClasses = cx('btn btn-default btn-sm', { 'disabled disabledButton': !canDownload, }); @@ -40,6 +41,7 @@ export default function ExploreActionButtons({ canDownload, slice, queryEndpoint