Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(explore): chart link is broken without localStorage #21707

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions superset-frontend/src/explore/ExplorePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const getDashboardContextFormData = () => {
Object.assign(dashboardContextWithFilters, { dashboardId });
return dashboardContextWithFilters;
}
return {};
return null;
};

export default function ExplorePage() {
Expand All @@ -117,10 +117,12 @@ export default function ExplorePage() {
if (!isExploreInitialized.current || isSaveAction) {
fetchExploreData(exploreUrlParams)
.then(({ result }) => {
const formData = getFormDataWithDashboardContext(
result.form_data,
dashboardContextFormData,
);
const formData = dashboardContextFormData
? getFormDataWithDashboardContext(
result.form_data,
dashboardContextFormData,
)
: result.form_data;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be merged into getFormDataWithDashboardContext? Basically make the second parameter nullable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather to keep this way because using getFormDataWithDashboardContext without dashboardContent seems odd.

dispatch(
hydrateExplore({
...result,
Expand Down