Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions superset-frontend/src/chart/ChartRenderer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ({
Expand Down Expand Up @@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default function buildQuery(formData: QueryFormData) {
return buildQueryContext(formData, baseQueryObject => [
{
...baseQueryObject,
groupby: baseQueryObject.columns,
},
]);
}