Skip to content

Commit

Permalink
Fixing condition around left margin for dashboard layout. Fixes apach…
Browse files Browse the repository at this point in the history
…e#13863 (apache#13905)

(cherry picked from commit a7f48c6)
  • Loading branch information
rusackas authored and henryyeh committed Apr 9, 2021
1 parent 968962a commit ebe56a1
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ const DashboardBuilder: FC<DashboardBuilderProps> = () => {
const filters = useFilters();
const filterValues = Object.values<Filter>(filters);

const nativeFiltersEnabled = isFeatureEnabled(
FeatureFlag.DASHBOARD_NATIVE_FILTERS,
);

const [dashboardFiltersOpen, setDashboardFiltersOpen] = useState(true);

const toggleDashboardFiltersOpen = (visible?: boolean) => {
Expand Down Expand Up @@ -150,7 +154,11 @@ const DashboardBuilder: FC<DashboardBuilderProps> = () => {
(topLevelTabs ? TABS_HEIGHT : 0);

useEffect(() => {
if (filterValues.length === 0 && dashboardFiltersOpen) {
if (
filterValues.length === 0 &&
dashboardFiltersOpen &&
nativeFiltersEnabled
) {
toggleDashboardFiltersOpen(false);
}
}, [filterValues.length]);
Expand Down Expand Up @@ -215,7 +223,7 @@ const DashboardBuilder: FC<DashboardBuilderProps> = () => {
className="dashboard-content"
dashboardFiltersOpen={dashboardFiltersOpen}
>
{isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS) && !editMode && (
{nativeFiltersEnabled && !editMode && (
<StickyVerticalBar
filtersOpen={dashboardFiltersOpen}
topOffset={barTopOffset}
Expand Down

0 comments on commit ebe56a1

Please sign in to comment.