From 206d02fcf5b10b128d3adedfbcd772db60a620eb Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Sat, 18 Nov 2017 22:42:08 -0800 Subject: [PATCH] Fixes default hanlding in Altered slice tag --- .../explore/components/ExploreChartHeader.jsx | 16 ++++++---------- superset/assets/javascripts/explore/index.jsx | 9 +++++++-- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/superset/assets/javascripts/explore/components/ExploreChartHeader.jsx b/superset/assets/javascripts/explore/components/ExploreChartHeader.jsx index 3750fc029141f..b8b52e36fdb3f 100644 --- a/superset/assets/javascripts/explore/components/ExploreChartHeader.jsx +++ b/superset/assets/javascripts/explore/components/ExploreChartHeader.jsx @@ -55,13 +55,6 @@ class ExploreChartHeader extends React.PureComponent { }); } - renderAlteredTag() { - const origFormData = (this.props.slice && this.props.slice.form_data) || {}; - const currentFormData = this.props.form_data; - const tagProps = { origFormData, currentFormData }; - return (); - } - renderChartTitle() { let title; if (this.props.slice) { @@ -113,9 +106,12 @@ class ExploreChartHeader extends React.PureComponent { } - - {this.renderAlteredTag()} - + {this.props.chart.sliceFormData && + + }
{this.props.chart.chartStatus === 'success' && queryResponse && diff --git a/superset/assets/javascripts/explore/index.jsx b/superset/assets/javascripts/explore/index.jsx index fa92d7c97d9af..7e2ed35926431 100644 --- a/superset/assets/javascripts/explore/index.jsx +++ b/superset/assets/javascripts/explore/index.jsx @@ -36,8 +36,12 @@ const bootstrappedState = Object.assign( isStarred: false, }, ); - -const chartKey = bootstrappedState.slice ? ('slice_' + bootstrappedState.slice.slice_id) : 'slice'; +const slice = bootstrappedState.slice; +const sliceFormData = slice ? + getFormDataFromControls(getControlsState(bootstrapData, slice.form_data)) + : + null; +const chartKey = slice ? ('slice_' + slice.slice_id) : 'slice'; const initState = { charts: { [chartKey]: { @@ -47,6 +51,7 @@ const initState = { chartUpdateEndTime: null, chartUpdateStartTime: now(), latestQueryFormData: getFormDataFromControls(controls), + sliceFormData, queryRequest: null, queryResponse: null, triggerQuery: true,