You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by di...@apache.org on 2023/04/25 13:09:06 UTC

[superset] 01/01: Hide FiltersPanel

This is an automated email from the ASF dual-hosted git repository.

diegopucci pushed a commit to branch fix/dashboard-report-empty-space
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 4ae9b63a1300e9d4d04fe78fca187ff046b88d08
Author: geido <di...@gmail.com>
AuthorDate: Tue Apr 25 16:08:46 2023 +0300

    Hide FiltersPanel
---
 .../src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx    | 4 +++-
 .../src/dashboard/components/nativeFilters/FilterBar/index.tsx        | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx
index dffa7bc3b2..bb28a470fd 100644
--- a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx
+++ b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.tsx
@@ -153,11 +153,12 @@ const StyledDiv = styled.div`
 `;
 
 // @z-index-above-dashboard-charts + 1 = 11
-const FiltersPanel = styled.div<{ width: number }>`
+const FiltersPanel = styled.div<{ width: number; hidden: boolean }>`
   grid-column: 1;
   grid-row: 1 / span 2;
   z-index: 11;
   width: ${({ width }) => width}px;
+  ${({ hidden }) => hidden && `display: none;`}
 `;
 
 const StickyPanel = styled.div<{ width: number }>`
@@ -654,6 +655,7 @@ const DashboardBuilder: FC<DashboardBuilderProps> = () => {
               return (
                 <FiltersPanel
                   width={filterBarWidth}
+                  hidden={isReport}
                   data-test="dashboard-filters-panel"
                 >
                   <StickyPanel ref={containerRef} width={filterBarWidth}>
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx
index 52d36c254c..5dfcaba488 100644
--- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx
+++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/index.tsx
@@ -52,6 +52,8 @@ import ActionButtons from './ActionButtons';
 import Horizontal from './Horizontal';
 import Vertical from './Vertical';
 
+// FilterBar is just being hidden as it must still
+// render fully due to encapsulated logics
 const HiddenFilterBar = styled.div`
   display: none;
 `;