Skip to content

Commit

Permalink
fix(filter-sets): 404 on dashboard load (#17777)
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro authored Dec 16, 2021
1 parent c18d486 commit 961766e
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 961766e

Please sign in to comment.