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
  • Loading branch information
rusackas authored and lyndsiWilliams committed Apr 7, 2021
1 parent 77823b0 commit b0ba3e3
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 b0ba3e3

Please sign in to comment.