mirror of
https://github.com/apache/superset.git
synced 2024-09-16 10:39:55 -04:00
fix(dashboard): JS error when editing charts (#21422)
This commit is contained in:
parent
d28909d56c
commit
1084bde2cc
@ -61,11 +61,20 @@ const fetchExploreData = async (exploreUrlParams: URLSearchParams) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getDashboardPageContext = (pageId?: string | null) => {
|
||||||
|
if (!pageId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
getItem(LocalStorageKeys.dashboard__explore_context, {})[pageId] || null
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const getDashboardContextFormData = () => {
|
const getDashboardContextFormData = () => {
|
||||||
const dashboardPageId = getUrlParam(URL_PARAMS.dashboardPageId);
|
const dashboardPageId = getUrlParam(URL_PARAMS.dashboardPageId);
|
||||||
|
const dashboardContext = getDashboardPageContext(dashboardPageId);
|
||||||
|
if (dashboardContext) {
|
||||||
const sliceId = getUrlParam(URL_PARAMS.sliceId) || 0;
|
const sliceId = getUrlParam(URL_PARAMS.sliceId) || 0;
|
||||||
let dashboardContextWithFilters = {};
|
|
||||||
if (dashboardPageId) {
|
|
||||||
const {
|
const {
|
||||||
labelColors,
|
labelColors,
|
||||||
sharedLabelColors,
|
sharedLabelColors,
|
||||||
@ -75,11 +84,8 @@ const getDashboardContextFormData = () => {
|
|||||||
filterBoxFilters,
|
filterBoxFilters,
|
||||||
dataMask,
|
dataMask,
|
||||||
dashboardId,
|
dashboardId,
|
||||||
} =
|
} = dashboardContext;
|
||||||
getItem(LocalStorageKeys.dashboard__explore_context, {})[
|
const dashboardContextWithFilters = getFormDataWithExtraFilters({
|
||||||
dashboardPageId
|
|
||||||
] || {};
|
|
||||||
dashboardContextWithFilters = getFormDataWithExtraFilters({
|
|
||||||
chart: { id: sliceId },
|
chart: { id: sliceId },
|
||||||
filters: getAppliedFilterValues(sliceId, filterBoxFilters),
|
filters: getAppliedFilterValues(sliceId, filterBoxFilters),
|
||||||
nativeFilters,
|
nativeFilters,
|
||||||
|
Loading…
Reference in New Issue
Block a user