Skip to content

Commit

Permalink
- Do not lose the slice info so it can be overwritten and saved
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio-RiveroMartnez committed Sep 24, 2024
1 parent 843e33d commit 3da6b8c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions superset-frontend/src/pages/Chart/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,16 @@ const fetchExploreData = async (exploreUrlParams: URLSearchParams) => {
if (hasDataseId(rv)) {
return rv;
}
// Since there's no dataset id but the API responded with a valid payload,
// we assume the dataset was deleted, so we preserve some values from previous
// state so if the user decide to swap the datasource, the chart config remains
fallbackExploreInitialData.form_data = {
...rv.result.form_data,
...fallbackExploreInitialData.form_data,
};
if (rv.result?.slice) {
fallbackExploreInitialData.slice = rv.result.slice;
}
}
let message = t('Failed to load chart data');
const responseError = rv?.result?.message;
Expand Down

0 comments on commit 3da6b8c

Please sign in to comment.