You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by vi...@apache.org on 2021/12/16 09:29:25 UTC
[superset] branch master updated: fix(filter-sets): 404 on dashboard load (#17777)
This is an automated email from the ASF dual-hosted git repository.
villebro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 961766e fix(filter-sets): 404 on dashboard load (#17777)
961766e is described below
commit 961766e83393826087e8f187e0e1a5f45a750b86
Author: Ville Brofeldt <33...@users.noreply.github.com>
AuthorDate: Thu Dec 16 11:27:46 2021 +0200
fix(filter-sets): 404 on dashboard load (#17777)
---
superset-frontend/src/dashboard/actions/nativeFilters.ts | 9 ++++-----
superset-frontend/src/dashboard/containers/DashboardPage.tsx | 2 +-
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/superset-frontend/src/dashboard/actions/nativeFilters.ts b/superset-frontend/src/dashboard/actions/nativeFilters.ts
index 65d655d..359adb8 100644
--- a/superset-frontend/src/dashboard/actions/nativeFilters.ts
+++ b/superset-frontend/src/dashboard/actions/nativeFilters.ts
@@ -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,
{
@@ -271,7 +270,7 @@ export const createFilterSet =
dispatch({
type: CREATE_FILTER_SET_COMPLETE,
});
- dispatch(getFilterSets());
+ dispatch(getFilterSets(dashboardId));
};
export const updateFilterSet =
@@ -308,7 +307,7 @@ export const updateFilterSet =
dispatch({
type: UPDATE_FILTER_SET_COMPLETE,
});
- dispatch(getFilterSets());
+ dispatch(getFilterSets(dashboardId));
};
export const deleteFilterSet =
@@ -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';
diff --git a/superset-frontend/src/dashboard/containers/DashboardPage.tsx b/superset-frontend/src/dashboard/containers/DashboardPage.tsx
index 3596888..20e98a5 100644
--- a/superset-frontend/src/dashboard/containers/DashboardPage.tsx
+++ b/superset-frontend/src/dashboard/containers/DashboardPage.tsx
@@ -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));