Skip to content

Commit

Permalink
fix(filter-sets): 404 on dashboard load (apache#17777)
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro authored and shcoderAlex committed Feb 7, 2022
1 parent 592404d commit cbc861c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions superset-frontend/src/dashboard/actions/nativeFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ export interface SetBootstrapData {
}

export const getFilterSets =
() => async (dispatch: Dispatch, getState: () => RootState) => {
const dashboardId = getState().dashboardInfo.id;
(dashboardId: number) => async (dispatch: Dispatch) => {
const fetchFilterSets = makeApi<
null,
{
Expand Down Expand Up @@ -271,7 +270,7 @@ export const createFilterSet =
dispatch({
type: CREATE_FILTER_SET_COMPLETE,
});
dispatch(getFilterSets());
dispatch(getFilterSets(dashboardId));
};

export const updateFilterSet =
Expand Down Expand Up @@ -308,7 +307,7 @@ export const updateFilterSet =
dispatch({
type: UPDATE_FILTER_SET_COMPLETE,
});
dispatch(getFilterSets());
dispatch(getFilterSets(dashboardId));
};

export const deleteFilterSet =
Expand All @@ -329,7 +328,7 @@ export const deleteFilterSet =
dispatch({
type: DELETE_FILTER_SET_COMPLETE,
});
dispatch(getFilterSets());
dispatch(getFilterSets(dashboardId));
};

export const SET_FOCUSED_NATIVE_FILTER = 'SET_FOCUSED_NATIVE_FILTER';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ const DashboardPage: FC = () => {
isDashboardHydrated.current = true;
if (isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS_SET)) {
// only initialize filterset once
dispatch(getFilterSets());
dispatch(getFilterSets(id));
}
}
dispatch(hydrateDashboard(dashboard, charts, filterboxMigrationState));
Expand Down

0 comments on commit cbc861c

Please sign in to comment.