From 11057fe5c2daf785e575d7913a8d8a8a0a9b8f88 Mon Sep 17 00:00:00 2001 From: Geido <60598000+geido@users.noreply.github.com> Date: Thu, 11 Nov 2021 19:07:00 +0200 Subject: [PATCH] Fix missing dashboardId (#17380) --- .../src/explore/components/ExploreViewContainer.jsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/explore/components/ExploreViewContainer.jsx b/superset-frontend/src/explore/components/ExploreViewContainer.jsx index 097ab6ee6c87d..6fe99e5682b9f 100644 --- a/superset-frontend/src/explore/components/ExploreViewContainer.jsx +++ b/superset-frontend/src/explore/components/ExploreViewContainer.jsx @@ -194,12 +194,19 @@ function ExploreViewContainer(props) { const addHistory = useCallback( ({ isReplace = false, title } = {}) => { - const payload = { ...props.form_data }; + const formData = props.dashboardId + ? { + ...props.form_data, + dashboardId: props.dashboardId, + } + : props.form_data; + const payload = { ...formData }; const longUrl = getExploreLongUrl( - props.form_data, + formData, props.standalone ? URL_PARAMS.standalone.name : null, false, ); + try { if (isReplace) { window.history.replaceState(payload, title, longUrl);