diff --git a/superset-frontend/src/dashboard/containers/Chart.jsx b/superset-frontend/src/dashboard/containers/Chart.jsx index 634a201d2cf14..f8ad642fe4b75 100644 --- a/superset-frontend/src/dashboard/containers/Chart.jsx +++ b/superset-frontend/src/dashboard/containers/Chart.jsx @@ -50,24 +50,28 @@ function mapStateToProps( ) { const { id } = ownProps; const chart = chartQueries[id] || {}; + const datasource = + (chart && chart.form_data && datasources[chart.form_data.datasource]) || {}; const { colorScheme, colorNamespace } = dashboardState; + // note: this method caches filters if possible to prevent render cascades + const formData = getFormDataWithExtraFilters({ + chart, + filters: getAppliedFilterValues(id), + colorScheme, + colorNamespace, + sliceId: id, + }); + + formData.dashboardId = dashboardInfo.id; + return { chart, - datasource: - (chart && chart.form_data && datasources[chart.form_data.datasource]) || - {}, + datasource, slice: sliceEntities.slices[id], timeout: dashboardInfo.common.conf.SUPERSET_WEBSERVER_TIMEOUT, filters: getActiveFilters() || EMPTY_FILTERS, - // note: this method caches filters if possible to prevent render cascades - formData: getFormDataWithExtraFilters({ - chart, - filters: getAppliedFilterValues(id), - colorScheme, - colorNamespace, - sliceId: id, - }), + formData, editMode: dashboardState.editMode, isExpanded: !!dashboardState.expandedSlices[id], supersetCanExplore: !!dashboardInfo.superset_can_explore, diff --git a/superset-frontend/src/explore/components/ExploreViewContainer.jsx b/superset-frontend/src/explore/components/ExploreViewContainer.jsx index fd6d1e00b3815..015928aceda57 100644 --- a/superset-frontend/src/explore/components/ExploreViewContainer.jsx +++ b/superset-frontend/src/explore/components/ExploreViewContainer.jsx @@ -44,6 +44,7 @@ import { const propTypes = { actions: PropTypes.object.isRequired, datasource_type: PropTypes.string.isRequired, + dashboardId: PropTypes.number, isDatasourceMetaLoading: PropTypes.bool.isRequired, chart: chartPropShape.isRequired, slice: PropTypes.object, @@ -338,6 +339,7 @@ class ExploreViewContainer extends React.Component { actions={this.props.actions} form_data={this.props.form_data} sliceName={this.props.sliceName} + dashboardId={this.props.dashboardId} /> )}