From 1af91ed756515ebba9f200aff850564547070957 Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Tue, 8 Jun 2021 09:58:15 -0300 Subject: [PATCH] fix: Adds left padding to dashboard edit mode when filter bar is closed (#15024) --- .../DashboardBuilder/DashboardBuilder.tsx | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx index 9873dfbd4..b38191c82 100644 --- a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx +++ b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx @@ -57,7 +57,10 @@ const HEADER_HEIGHT = 67; type DashboardBuilderProps = {}; -const StyledDashboardContent = styled.div<{ dashboardFiltersOpen: boolean }>` +const StyledDashboardContent = styled.div<{ + dashboardFiltersOpen: boolean; + editMode: boolean; +}>` display: flex; flex-direction: row; flex-wrap: nowrap; @@ -75,13 +78,15 @@ const StyledDashboardContent = styled.div<{ dashboardFiltersOpen: boolean }>` width: 100%; flex-grow: 1; position: relative; - margin: ${({ theme }) => theme.gridUnit * 6}px - ${({ theme }) => theme.gridUnit * 8}px - ${({ theme }) => theme.gridUnit * 6}px - ${({ theme, dashboardFiltersOpen }) => { - if (dashboardFiltersOpen) return theme.gridUnit * 8; + margin-top: ${({ theme }) => theme.gridUnit * 6}px; + margin-right: ${({ theme }) => theme.gridUnit * 8}px; + margin-bottom: ${({ theme }) => theme.gridUnit * 6}px; + margin-left: ${({ theme, dashboardFiltersOpen, editMode }) => { + if (!dashboardFiltersOpen && !editMode) { return 0; - }}px; + } + return theme.gridUnit * 8; + }}px; } .dashboard-component-chart-holder { @@ -204,6 +209,7 @@ const DashboardBuilder: FC = () => { {nativeFiltersEnabled && !editMode && (