Skip to content

Commit

Permalink
Fixing condition around left margin for dashboard layout. Fixes #13863
Browse files Browse the repository at this point in the history
  • Loading branch information
rusackas committed Mar 31, 2021
1 parent 9d6832d commit 4da64ce
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 4da64ce

Please sign in to comment.