From 526b5a58a01b43b279c2e47ff0ad2b3538fbbcc5 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Fri, 4 Jun 2021 14:53:31 +0800 Subject: [PATCH 1/3] fix: toggle fullscreen on the dashboard --- .../components/Header/HeaderActionsDropdown/index.jsx | 3 ++- superset-frontend/src/dashboard/util/getDashboardUrl.ts | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx index 06f5f3501415..e11ab205faec 100644 --- a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx +++ b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx @@ -164,11 +164,12 @@ class HeaderActionsDropdown extends React.PureComponent { break; } case MENU_KEYS.TOGGLE_FULLSCREEN: { + const hasStandalone = !!getUrlParam(URL_PARAMS.standalone); const url = getDashboardUrl( window.location.pathname, getActiveFilters(), window.location.hash, - getUrlParam(URL_PARAMS.standalone), + !hasStandalone, ); window.location.replace(url); break; diff --git a/superset-frontend/src/dashboard/util/getDashboardUrl.ts b/superset-frontend/src/dashboard/util/getDashboardUrl.ts index 7eb817a0957a..63b4d578dfe0 100644 --- a/superset-frontend/src/dashboard/util/getDashboardUrl.ts +++ b/superset-frontend/src/dashboard/util/getDashboardUrl.ts @@ -35,7 +35,10 @@ export default function getDashboardUrl( ); if (standalone) { - newSearchParams.set(URL_PARAMS.standalone.name, standalone.toString()); + newSearchParams.set( + URL_PARAMS.standalone.name, + standalone.toString(), + ); } const hashSection = hash ? `#${hash}` : ''; From d973150510f35e31f6359f5486ba51918b04c0f3 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Fri, 4 Jun 2021 15:10:43 +0800 Subject: [PATCH 2/3] fix lint --- superset-frontend/src/dashboard/util/getDashboardUrl.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/superset-frontend/src/dashboard/util/getDashboardUrl.ts b/superset-frontend/src/dashboard/util/getDashboardUrl.ts index 63b4d578dfe0..7eb817a0957a 100644 --- a/superset-frontend/src/dashboard/util/getDashboardUrl.ts +++ b/superset-frontend/src/dashboard/util/getDashboardUrl.ts @@ -35,10 +35,7 @@ export default function getDashboardUrl( ); if (standalone) { - newSearchParams.set( - URL_PARAMS.standalone.name, - standalone.toString(), - ); + newSearchParams.set(URL_PARAMS.standalone.name, standalone.toString()); } const hashSection = hash ? `#${hash}` : ''; From 5265c79d66d6c764f15b576d8c906550539e1fe3 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Fri, 4 Jun 2021 19:01:23 +0800 Subject: [PATCH 3/3] updates --- .../components/Header/HeaderActionsDropdown/index.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx index e11ab205faec..4ed5fd623d15 100644 --- a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx +++ b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx @@ -164,12 +164,11 @@ class HeaderActionsDropdown extends React.PureComponent { break; } case MENU_KEYS.TOGGLE_FULLSCREEN: { - const hasStandalone = !!getUrlParam(URL_PARAMS.standalone); const url = getDashboardUrl( window.location.pathname, getActiveFilters(), window.location.hash, - !hasStandalone, + !getUrlParam(URL_PARAMS.standalone), ); window.location.replace(url); break;