diff --git a/superset-frontend/src/chart/ChartRenderer.jsx b/superset-frontend/src/chart/ChartRenderer.jsx index eafe4b40c7be..e4b24a7754e7 100644 --- a/superset-frontend/src/chart/ChartRenderer.jsx +++ b/superset-frontend/src/chart/ChartRenderer.jsx @@ -74,8 +74,12 @@ class ChartRenderer extends React.Component { setControlValue: this.handleSetControlValue, onFilterMenuOpen: this.props.onFilterMenuOpen, onFilterMenuClose: this.props.onFilterMenuClose, - setExtraFormData: extraFormData => - this.props.actions?.setExtraFormData(this.props.chartId, extraFormData), + setExtraFormData: ({ extraFormData, currentState }) => + this.props.actions?.setExtraFormData( + this.props.chartId, + extraFormData, + currentState, + ), }; } diff --git a/superset-frontend/src/dashboard/util/activeDashboardNativeFilters.ts b/superset-frontend/src/dashboard/util/activeDashboardNativeFilters.ts index 66128ea9c728..44779394a919 100644 --- a/superset-frontend/src/dashboard/util/activeDashboardNativeFilters.ts +++ b/superset-frontend/src/dashboard/util/activeDashboardNativeFilters.ts @@ -20,6 +20,7 @@ import { CHART_TYPE } from './componentTypes'; import { Scope } from '../components/nativeFilters/types'; import { ActiveFilters, LayoutItem } from '../types'; import { NativeFiltersState } from '../reducers/types'; +import { DASHBOARD_ROOT_ID } from './constants'; // Looking for affected chart scopes and values export const findAffectedCharts = ({ @@ -82,10 +83,11 @@ export const getActiveNativeFilters = ({ } Object.values(nativeFilters.filtersState).forEach( ({ id: filterId, extraFormData }) => { - const scope = nativeFilters?.filters?.[filterId]?.scope; - if (!scope) { - return; - } + // TODO: for a case of a cross filters (should be updated will be added scope there) + const scope = nativeFilters?.filters?.[filterId]?.scope ?? { + rootPath: [DASHBOARD_ROOT_ID], + excluded: [], + }; // Iterate over all roots to find all affected charts scope.rootPath.forEach(layoutItemId => { layout[layoutItemId].children.forEach((child: string) => { diff --git a/superset-frontend/src/filters/components/Select/buildQuery.ts b/superset-frontend/src/filters/components/Select/buildQuery.ts index ba82222b91f0..7cca60102fe1 100644 --- a/superset-frontend/src/filters/components/Select/buildQuery.ts +++ b/superset-frontend/src/filters/components/Select/buildQuery.ts @@ -36,6 +36,7 @@ export default function buildQuery(formData: QueryFormData) { return buildQueryContext(formData, baseQueryObject => [ { ...baseQueryObject, + groupby: baseQueryObject.columns, }, ]); }