From df4b108d6cf7e3b7ff0b384a32e9b8bd2f57d665 Mon Sep 17 00:00:00 2001 From: Evan Rusackas Date: Wed, 31 Mar 2021 21:32:46 -0700 Subject: [PATCH] Fixing condition around left margin for dashboard layout. Fixes #13863 (#13905) --- .../components/DashboardBuilder/DashboardBuilder.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx index 17a2362d07f14..b532b3b449d0d 100644 --- a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx +++ b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx @@ -112,6 +112,10 @@ const DashboardBuilder: FC = () => { const filters = useFilters(); const filterValues = Object.values(filters); + const nativeFiltersEnabled = isFeatureEnabled( + FeatureFlag.DASHBOARD_NATIVE_FILTERS, + ); + const [dashboardFiltersOpen, setDashboardFiltersOpen] = useState(true); const toggleDashboardFiltersOpen = (visible?: boolean) => { @@ -150,7 +154,11 @@ const DashboardBuilder: FC = () => { (topLevelTabs ? TABS_HEIGHT : 0); useEffect(() => { - if (filterValues.length === 0 && dashboardFiltersOpen) { + if ( + filterValues.length === 0 && + dashboardFiltersOpen && + nativeFiltersEnabled + ) { toggleDashboardFiltersOpen(false); } }, [filterValues.length]); @@ -215,7 +223,7 @@ const DashboardBuilder: FC = () => { className="dashboard-content" dashboardFiltersOpen={dashboardFiltersOpen} > - {isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS) && !editMode && ( + {nativeFiltersEnabled && !editMode && (