Skip to content

Commit

Permalink
Fixes default hanlding in Altered slice tag
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Nov 19, 2017
1 parent 4bfe08d commit 206d02f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (<AlteredSliceTag {...tagProps} />);
}

renderChartTitle() {
let title;
if (this.props.slice) {
Expand Down Expand Up @@ -113,9 +106,12 @@ class ExploreChartHeader extends React.PureComponent {
</TooltipWrapper>
</span>
}

{this.renderAlteredTag()}

{this.props.chart.sliceFormData &&
<AlteredSliceTag
origFormData={this.props.chart.sliceFormData}
currentFormData={this.props.form_data}
/>
}
<div className="pull-right">
{this.props.chart.chartStatus === 'success' &&
queryResponse &&
Expand Down
9 changes: 7 additions & 2 deletions superset/assets/javascripts/explore/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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]: {
Expand All @@ -47,6 +51,7 @@ const initState = {
chartUpdateEndTime: null,
chartUpdateStartTime: now(),
latestQueryFormData: getFormDataFromControls(controls),
sliceFormData,
queryRequest: null,
queryResponse: null,
triggerQuery: true,
Expand Down

0 comments on commit 206d02f

Please sign in to comment.