fix(dashboard): Force native filters into vertical orientation when FF off (#22265)

This commit is contained in:
Cody Leff 2022-11-29 14:47:48 -07:00 committed by GitHub
parent a642d126f8
commit 969c9634f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -246,7 +246,10 @@ const DashboardBuilder: FC<DashboardBuilderProps> = () => {
state => state.dashboardState.fullSizeChartId,
);
const filterBarOrientation = useSelector<RootState, FilterBarOrientation>(
({ dashboardInfo }) => dashboardInfo.filterBarOrientation,
({ dashboardInfo }) =>
isFeatureEnabled(FeatureFlag.HORIZONTAL_FILTER_BAR)
? dashboardInfo.filterBarOrientation
: FilterBarOrientation.VERTICAL,
);
const handleChangeTab = useCallback(

View File

@ -26,6 +26,8 @@ import {
SupersetTheme,
t,
isNativeFilter,
isFeatureEnabled,
FeatureFlag,
} from '@superset-ui/core';
import {
createHtmlPortalNode,
@ -56,7 +58,10 @@ const FilterControls: FC<FilterControlsProps> = ({
onFilterSelectionChange,
}) => {
const filterBarOrientation = useSelector<RootState, FilterBarOrientation>(
state => state.dashboardInfo.filterBarOrientation,
({ dashboardInfo }) =>
isFeatureEnabled(FeatureFlag.HORIZONTAL_FILTER_BAR)
? dashboardInfo.filterBarOrientation
: FilterBarOrientation.VERTICAL,
);
const [overflowedIds, setOverflowedIds] = useState<string[]>([]);