diff --git a/RESOURCES/FEATURE_FLAGS.md b/RESOURCES/FEATURE_FLAGS.md index ef05ab98db5c5..d782c10cbec79 100644 --- a/RESOURCES/FEATURE_FLAGS.md +++ b/RESOURCES/FEATURE_FLAGS.md @@ -84,7 +84,6 @@ These features flags currently default to True and **will be removed in a future [//]: # "PLEASE KEEP THE LIST SORTED ALPHABETICALLY" - DASHBOARD_CROSS_FILTERS -- DASHBOARD_NATIVE_FILTERS - ENABLE_JAVASCRIPT_CONTROLS - GENERIC_CHART_AXES - KV_STORE diff --git a/UPDATING.md b/UPDATING.md index f1f2566736817..804b7cdd24f34 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -43,6 +43,7 @@ assists people when migrating to a new version. - [26637](https://github.com/apache/superset/issues/26637): Sets the `DRILL_BY` feature flag to `True` by default given that the feature has been tested for a while and reached a stable state. - [26462](https://github.com/apache/superset/issues/26462): Removes the Profile feature given that it's not actively maintained and not widely used. - [26377](https://github.com/apache/superset/pull/26377): Removes the deprecated Redirect API that supported short URLs used before the permalink feature. +- [26329](https://github.com/apache/superset/issues/26329): Removes the deprecated `DASHBOARD_NATIVE_FILTERS` feature flag. The previous value of the feature flag was `True` and now the feature is permanently enabled. ### Potential Downtime diff --git a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts index ba9d0d6680fd8..f993e451f3bf3 100644 --- a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts +++ b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts @@ -29,7 +29,6 @@ export enum FeatureFlag { CONFIRM_DASHBOARD_DIFF = 'CONFIRM_DASHBOARD_DIFF', /** @deprecated */ DASHBOARD_CROSS_FILTERS = 'DASHBOARD_CROSS_FILTERS', - DASHBOARD_NATIVE_FILTERS = 'DASHBOARD_NATIVE_FILTERS', DASHBOARD_VIRTUALIZATION = 'DASHBOARD_VIRTUALIZATION', DASHBOARD_RBAC = 'DASHBOARD_RBAC', DATAPANEL_CLOSED_BY_DEFAULT = 'DATAPANEL_CLOSED_BY_DEFAULT', diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/pagination.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/pagination.tsx index bf4c1207174d1..97a8206a1133b 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/pagination.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/pagination.tsx @@ -21,26 +21,22 @@ import { ControlSetItem, ControlSetRow, } from '@superset-ui/chart-controls'; -import { FeatureFlag, isFeatureEnabled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; import { PAGE_SIZE_OPTIONS } from '../../consts'; -export const serverPaginationControlSetRow: ControlSetRow = - isFeatureEnabled(FeatureFlag.DASHBOARD_CROSS_FILTERS) || - isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS) - ? [ - { - name: 'server_pagination', - config: { - type: 'CheckboxControl', - label: t('Server pagination'), - description: t( - 'Enable server side pagination of results (experimental feature)', - ), - default: false, - }, - }, - ] - : []; +export const serverPaginationControlSetRow: ControlSetRow = [ + { + name: 'server_pagination', + config: { + type: 'CheckboxControl', + label: t('Server pagination'), + description: t( + 'Enable server side pagination of results (experimental feature)', + ), + default: false, + }, + }, +]; export const serverPageLengthControlSetItem: ControlSetItem = { name: 'server_page_length', diff --git a/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx index a59ade460a5fc..c3fe7282e698f 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx @@ -21,11 +21,9 @@ import React from 'react'; import { ChartDataResponseResult, ensureIsArray, - FeatureFlag, GenericDataType, hasGenericChartAxes, isAdhocColumn, - isFeatureEnabled, isPhysicalColumn, QueryFormColumn, QueryMode, @@ -290,22 +288,19 @@ const config: ControlPanelConfig = { }, }, ], - isFeatureEnabled(FeatureFlag.DASHBOARD_CROSS_FILTERS) || - isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS) - ? [ - { - name: 'server_pagination', - config: { - type: 'CheckboxControl', - label: t('Server pagination'), - description: t( - 'Enable server side pagination of results (experimental feature)', - ), - default: false, - }, - }, - ] - : [], + [ + { + name: 'server_pagination', + config: { + type: 'CheckboxControl', + label: t('Server pagination'), + description: t( + 'Enable server side pagination of results (experimental feature)', + ), + default: false, + }, + }, + ], [ { name: 'row_limit', diff --git a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.test.tsx b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.test.tsx index 179c03c996f10..08cfed16f622d 100644 --- a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.test.tsx +++ b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardBuilder.test.tsx @@ -20,7 +20,6 @@ import React from 'react'; import fetchMock from 'fetch-mock'; import { render } from 'spec/helpers/testing-library'; import { fireEvent, within } from '@testing-library/react'; -import * as uiCore from '@superset-ui/core'; import DashboardBuilder from 'src/dashboard/components/DashboardBuilder/DashboardBuilder'; import useStoredSidebarWidth from 'src/components/ResizableSidebar/useStoredSidebarWidth'; import { @@ -247,35 +246,20 @@ describe('DashboardBuilder', () => { expect(await findByAltText('Loading...')).toBeVisible(); }); - describe('when nativeFiltersEnabled', () => { - let isFeatureEnabledMock: jest.MockInstance; - beforeAll(() => { - isFeatureEnabledMock = jest - .spyOn(uiCore, 'isFeatureEnabled') - .mockImplementation( - flag => flag === uiCore.FeatureFlag.DASHBOARD_NATIVE_FILTERS, - ); - }); - - afterAll(() => { - isFeatureEnabledMock.mockRestore(); - }); - - it('should set FilterBar width by useStoredSidebarWidth', () => { - const expectedValue = 200; - const setter = jest.fn(); - (useStoredSidebarWidth as jest.Mock).mockImplementation(() => [ - expectedValue, - setter, - ]); - const { getByTestId } = setup({ - dashboardInfo: { - ...mockState.dashboardInfo, - dash_edit_perm: true, - }, - }); - const filterbar = getByTestId('dashboard-filters-panel'); - expect(filterbar).toHaveStyleRule('width', `${expectedValue}px`); + it('should set FilterBar width by useStoredSidebarWidth', () => { + const expectedValue = 200; + const setter = jest.fn(); + (useStoredSidebarWidth as jest.Mock).mockImplementation(() => [ + expectedValue, + setter, + ]); + const { getByTestId } = setup({ + dashboardInfo: { + ...mockState.dashboardInfo, + dash_edit_perm: true, + }, }); + const filterbar = getByTestId('dashboard-filters-panel'); + expect(filterbar).toHaveStyleRule('width', `${expectedValue}px`); }); }); diff --git a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.tsx b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.tsx index f3f214468e833..5f03eeaf1a8fa 100644 --- a/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.tsx +++ b/superset-frontend/src/dashboard/components/DashboardBuilder/DashboardContainer.tsx @@ -21,11 +21,9 @@ import React, { FC, useCallback, useEffect, useMemo, useRef } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { - FeatureFlag, Filter, Filters, getCategoricalSchemeRegistry, - isFeatureEnabled, SupersetClient, useComponentDidUpdate, } from '@superset-ui/core'; @@ -104,10 +102,7 @@ const DashboardContainer: FC = ({ topLevelTabs }) => { }, [dashboardLayout, directPathToChild]); useEffect(() => { - if ( - !isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS) || - nativeFilterScopes.length === 0 - ) { + if (nativeFilterScopes.length === 0) { return; } const scopes = nativeFilterScopes.map(filterScope => { diff --git a/superset-frontend/src/dashboard/components/DashboardBuilder/state.ts b/superset-frontend/src/dashboard/components/DashboardBuilder/state.ts index 1936e331c3db2..9b8af1dda30f5 100644 --- a/superset-frontend/src/dashboard/components/DashboardBuilder/state.ts +++ b/superset-frontend/src/dashboard/components/DashboardBuilder/state.ts @@ -17,7 +17,6 @@ * under the License. */ import { useSelector } from 'react-redux'; -import { isFeatureEnabled, FeatureFlag } from '@superset-ui/core'; import { useCallback, useEffect, useState } from 'react'; import { URL_PARAMS } from 'src/constants'; import { getUrlParam } from 'src/utils/urlUtils'; @@ -42,8 +41,7 @@ export const useNativeFilters = () => { ); const nativeFiltersEnabled = - isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS) && - (canEdit || (!canEdit && filterValues.length !== 0)); + canEdit || (!canEdit && filterValues.length !== 0); const requiredFirstFilter = filterValues.filter( filter => filter.requiredFirst, diff --git a/superset-frontend/src/dashboard/components/FiltersBadge/FiltersBadge.test.tsx b/superset-frontend/src/dashboard/components/FiltersBadge/FiltersBadge.test.tsx index 058c5329b6ba0..c5e0d0df9c37b 100644 --- a/superset-frontend/src/dashboard/components/FiltersBadge/FiltersBadge.test.tsx +++ b/superset-frontend/src/dashboard/components/FiltersBadge/FiltersBadge.test.tsx @@ -133,10 +133,6 @@ describe('FiltersBadge', () => { }); it('shows the indicator when filters have been applied', () => { - // @ts-ignore - global.featureFlags = { - [SupersetUI.FeatureFlag.DASHBOARD_NATIVE_FILTERS]: true, - }; const store = getMockStoreWithNativeFilters(); // start with basic dashboard state, dispatch an event to simulate query completion store.dispatch({ diff --git a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/HeaderActionsDropdown.test.tsx b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/HeaderActionsDropdown.test.tsx index deea296d4c04f..cefdbafa73d48 100644 --- a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/HeaderActionsDropdown.test.tsx +++ b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/HeaderActionsDropdown.test.tsx @@ -24,12 +24,8 @@ import userEvent from '@testing-library/user-event'; import fetchMock from 'fetch-mock'; import { HeaderDropdownProps } from 'src/dashboard/components/Header/types'; import injectCustomCss from 'src/dashboard/util/injectCustomCss'; -import { FeatureFlag } from '@superset-ui/core'; -import * as uiCore from '@superset-ui/core'; import HeaderActionsDropdown from '.'; -let isFeatureEnabledMock: jest.MockInstance; - const createProps = () => ({ addSuccessToast: jest.fn(), addDangerToast: jest.fn(), @@ -135,7 +131,7 @@ test('should render the menu items', async () => { test('should render the menu items in edit mode', async () => { setup(editModeOnProps); - expect(screen.getAllByRole('menuitem')).toHaveLength(5); + expect(screen.getAllByRole('menuitem')).toHaveLength(4); expect(screen.getByText('Set auto-refresh interval')).toBeInTheDocument(); expect(screen.getByText('Edit properties')).toBeInTheDocument(); expect(screen.getByText('Edit CSS')).toBeInTheDocument(); @@ -150,56 +146,14 @@ test('should render the menu items in Embedded mode', async () => { expect(screen.getByText('Set auto-refresh interval')).toBeInTheDocument(); }); -describe('with native filters feature flag disabled', () => { - beforeAll(() => { - isFeatureEnabledMock = jest - .spyOn(uiCore, 'isFeatureEnabled') - .mockImplementation( - (featureFlag: FeatureFlag) => - featureFlag !== FeatureFlag.DASHBOARD_NATIVE_FILTERS, - ); - }); - - afterAll(() => { - // @ts-ignore - isFeatureEnabledMock.restore(); - }); - - it('should render filter mapping in edit mode if explicit filter scopes undefined', async () => { - setup(editModeOnProps); - expect(screen.getByText('Set filter mapping')).toBeInTheDocument(); - }); - - it('should render filter mapping in edit mode if explicit filter scopes defined', async () => { - setup(editModeOnWithFilterScopesProps); - expect(screen.getByText('Set filter mapping')).toBeInTheDocument(); - }); +test('should not render filter mapping in edit mode if explicit filter scopes undefined', async () => { + setup(editModeOnProps); + expect(screen.queryByText('Set filter mapping')).not.toBeInTheDocument(); }); -describe('with native filters feature flag enabled', () => { - beforeAll(() => { - isFeatureEnabledMock = jest - .spyOn(uiCore, 'isFeatureEnabled') - .mockImplementation( - (featureFlag: FeatureFlag) => - featureFlag === FeatureFlag.DASHBOARD_NATIVE_FILTERS, - ); - }); - - afterAll(() => { - // @ts-ignore - isFeatureEnabledMock.restore(); - }); - - it('should not render filter mapping in edit mode if explicit filter scopes undefined', async () => { - setup(editModeOnProps); - expect(screen.queryByText('Set filter mapping')).not.toBeInTheDocument(); - }); - - it('should render filter mapping in edit mode if explicit filter scopes defined', async () => { - setup(editModeOnWithFilterScopesProps); - expect(screen.getByText('Set filter mapping')).toBeInTheDocument(); - }); +test('should render filter mapping in edit mode if explicit filter scopes defined', async () => { + setup(editModeOnWithFilterScopesProps); + expect(screen.getByText('Set filter mapping')).toBeInTheDocument(); }); test('should show the share actions', async () => { diff --git a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx index b0d3fc251e9d9..f1a3f59039bd4 100644 --- a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx +++ b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/index.jsx @@ -19,12 +19,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { isEmpty } from 'lodash'; -import { - isFeatureEnabled, - FeatureFlag, - SupersetClient, - t, -} from '@superset-ui/core'; +import { SupersetClient, t } from '@superset-ui/core'; import { Menu } from 'src/components/Menu'; import { URL_PARAMS } from 'src/constants'; import ShareMenuItems from 'src/dashboard/components/menu/ShareMenuItems'; @@ -361,18 +356,14 @@ class HeaderActionsDropdown extends React.PureComponent { ) ) : null} - {editMode && - !( - isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS) && - isEmpty(dashboardInfo?.metadata?.filter_scopes) - ) && ( - - - - )} + {editMode && !isEmpty(dashboardInfo?.metadata?.filter_scopes) && ( + + + + )} (FILTERS_CONFIG_MODAL_TEST_ID, true); const FILTER_NAME = 'Time filter 1'; -// @ts-ignore -global.featureFlags = { - [FeatureFlag.DASHBOARD_NATIVE_FILTERS]: true, -}; - const addFilterFlow = async () => { // open filter config modal userEvent.click(screen.getByTestId(getTestId('collapsable'))); @@ -291,10 +286,6 @@ describe('FilterBar', () => { }); it('create filter and apply it flow', async () => { - // @ts-ignore - global.featureFlags = { - [FeatureFlag.DASHBOARD_NATIVE_FILTERS]: true, - }; renderWrapper(openedBarProps, stateWithoutNativeFilters); expect(screen.getByTestId(getTestId('apply-button'))).toBeDisabled(); diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx index c74d1b08a967e..629ec75cb000c 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx @@ -212,23 +212,20 @@ const FilterControls: FC = ({ selectedCrossFilters.at(-1), ), })); - if (isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS)) { - const nativeFiltersInScope = filtersInScope.map((filter, index) => ({ - id: filter.id, - element: ( -
- {renderer(filter, index)} -
- ), - })); - return [...crossFilters, ...nativeFiltersInScope]; - } - return [...crossFilters]; + const nativeFiltersInScope = filtersInScope.map((filter, index) => ({ + id: filter.id, + element: ( +
+ {renderer(filter, index)} +
+ ), + })); + return [...crossFilters, ...nativeFiltersInScope]; }, [filtersInScope, renderer, rendererCrossFilter, selectedCrossFilters]); const renderHorizontalContent = () => ( diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Header/index.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Header/index.tsx index d839cd4d39404..7cd4877d11e2c 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Header/index.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Header/index.tsx @@ -17,14 +17,7 @@ * under the License. */ /* eslint-disable no-param-reassign */ -import { - FeatureFlag, - css, - isFeatureEnabled, - styled, - t, - useTheme, -} from '@superset-ui/core'; +import { css, styled, t, useTheme } from '@superset-ui/core'; import React, { FC, useMemo } from 'react'; import Icons from 'src/components/Icons'; import Button from 'src/components/Button'; @@ -124,7 +117,7 @@ const Header: FC = ({ toggleFiltersBar }) => { - {canEdit && isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS) && ( + {canEdit && ( = ({ : []; const hasFilters = filterValues.length > 0 || selectedCrossFilters.length > 0; - const actionsElement = useMemo( - () => - isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS) ? actions : null, - [actions], - ); - return ( @@ -143,7 +137,7 @@ const HorizontalFilterBar: React.FC = ({ ) : ( <> - {canEdit && isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS) && ( + {canEdit && ( = ({ onFilterSelectionChange={onSelectionChange} /> )} - {actionsElement} + {actions} )} diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/HorizontalFilterBar.test.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/HorizontalFilterBar.test.tsx index efad04a0388d7..09625151a2c2d 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/HorizontalFilterBar.test.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/HorizontalFilterBar.test.tsx @@ -16,8 +16,7 @@ * specific language governing permissions and limitations * under the License. */ - -import { FeatureFlag, NativeFilterType } from '@superset-ui/core'; +import { NativeFilterType } from '@superset-ui/core'; import React from 'react'; import { render, screen, waitFor } from 'spec/helpers/testing-library'; import HorizontalBar from './Horizontal'; @@ -32,11 +31,6 @@ const defaultProps = { onSelectionChange: jest.fn(), }; -// @ts-ignore -global.featureFlags = { - [FeatureFlag.DASHBOARD_NATIVE_FILTERS]: true, -}; - const renderWrapper = (overrideProps?: Record) => waitFor(() => render(, { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx index b2da460502979..998c460dfc0f2 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/Vertical.tsx @@ -196,12 +196,6 @@ const VerticalFilterBar: React.FC = ({ [], ); - const actionsElement = useMemo( - () => - isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS) ? actions : null, - [actions], - ); - return ( = ({
<> {crossFilters} - {isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS) && - filterControls} + {filterControls}
)} - {actionsElement} + {actions}
diff --git a/superset-frontend/src/dashboard/components/nativeFilters/selectors.ts b/superset-frontend/src/dashboard/components/nativeFilters/selectors.ts index a8bfafd8341bc..ae8a2f7a4df8e 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/selectors.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/selectors.ts @@ -358,34 +358,31 @@ export const selectNativeIndicatorsForChart = ( return cachedNativeIndicatorsForChart[chartId]; } - let nativeFilterIndicators: any = []; - if (isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS)) { - nativeFilterIndicators = - nativeFilters && - Object.values(nativeFilters) - .filter( - nativeFilter => - nativeFilter.type === NativeFilterType.NATIVE_FILTER && - nativeFilter.chartsInScope?.includes(chartId), - ) - .map(nativeFilter => { - const column = nativeFilter.targets?.[0]?.column?.name; - const filterState = dataMask[nativeFilter.id]?.filterState; - const label = extractLabel(filterState); - return { + const nativeFilterIndicators = + nativeFilters && + Object.values(nativeFilters) + .filter( + nativeFilter => + nativeFilter.type === NativeFilterType.NATIVE_FILTER && + nativeFilter.chartsInScope?.includes(chartId), + ) + .map(nativeFilter => { + const column = nativeFilter.targets?.[0]?.column?.name; + const filterState = dataMask[nativeFilter.id]?.filterState; + const label = extractLabel(filterState); + return { + column, + name: nativeFilter.name, + path: [nativeFilter.id], + status: getStatus({ + label, column, - name: nativeFilter.name, - path: [nativeFilter.id], - status: getStatus({ - label, - column, - rejectedColumns, - appliedColumns, - }), - value: label, - }; - }); - } + rejectedColumns, + appliedColumns, + }), + value: label, + }; + }); let crossFilterIndicators: any = []; if (isFeatureEnabled(FeatureFlag.DASHBOARD_CROSS_FILTERS)) { diff --git a/superset-frontend/src/dashboard/components/nativeFilters/utils.test.ts b/superset-frontend/src/dashboard/components/nativeFilters/utils.test.ts index 0388565595ff4..be636bf17a4af 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/utils.test.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/utils.test.ts @@ -55,41 +55,7 @@ describe('nativeFilterGate', () => { }); }); - describe('with only native filters feature flag enabled', () => { - beforeAll(() => { - isFeatureEnabledMock = jest - .spyOn(uiCore, 'isFeatureEnabled') - .mockImplementation( - (featureFlag: FeatureFlag) => - featureFlag === FeatureFlag.DASHBOARD_NATIVE_FILTERS, - ); - }); - - afterAll(() => { - // @ts-ignore - isFeatureEnabledMock.restore(); - }); - - it('should return true for regular chart', () => { - expect(nativeFilterGate([])).toEqual(true); - }); - - it('should return true for cross filter chart', () => { - expect(nativeFilterGate([Behavior.INTERACTIVE_CHART])).toEqual(true); - }); - - it('should return false for native filter chart with cross filter support', () => { - expect( - nativeFilterGate([Behavior.NATIVE_FILTER, Behavior.INTERACTIVE_CHART]), - ).toEqual(false); - }); - - it('should return false for native filter behavior', () => { - expect(nativeFilterGate([Behavior.NATIVE_FILTER])).toEqual(false); - }); - }); - - describe('with native filters and experimental feature flag enabled', () => { + describe('with cross filters and experimental feature flag enabled', () => { beforeAll(() => { isFeatureEnabledMock = jest .spyOn(uiCore, 'isFeatureEnabled') diff --git a/superset-frontend/src/dataMask/actions.ts b/superset-frontend/src/dataMask/actions.ts index 7c41703a10bfb..cb7ed393d732c 100644 --- a/superset-frontend/src/dataMask/actions.ts +++ b/superset-frontend/src/dataMask/actions.ts @@ -16,13 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { - DataMask, - isFeatureEnabled, - FeatureFlag, - FilterConfiguration, - Filters, -} from '@superset-ui/core'; +import { DataMask, FilterConfiguration, Filters } from '@superset-ui/core'; import { getInitialDataMask } from './reducer'; export const CLEAR_DATA_MASK_STATE = 'CLEAR_DATA_MASK_STATE'; @@ -73,14 +67,10 @@ export function updateDataMask( filterId: string | number, dataMask: DataMask, ): UpdateDataMask { - // Only apply data mask if one of the relevant features is enabled - const isFeatureFlagActive = - isFeatureEnabled(FeatureFlag.DASHBOARD_NATIVE_FILTERS) || - isFeatureEnabled(FeatureFlag.DASHBOARD_CROSS_FILTERS); return { type: UPDATE_DATA_MASK, filterId, - dataMask: isFeatureFlagActive ? dataMask : {}, + dataMask, }; } diff --git a/superset/config.py b/superset/config.py index 4d0eda4b2f048..1d6409deb8ac0 100644 --- a/superset/config.py +++ b/superset/config.py @@ -428,7 +428,6 @@ class D3Format(TypedDict, total=False): "LISTVIEWS_DEFAULT_CARD_VIEW": False, # When True, this escapes HTML (rather than rendering it) in Markdown components "ESCAPE_MARKDOWN_HTML": False, - "DASHBOARD_NATIVE_FILTERS": True, # deprecated "DASHBOARD_CROSS_FILTERS": True, # deprecated "DASHBOARD_VIRTUALIZATION": True, "GLOBAL_ASYNC_QUERIES": False, diff --git a/tests/integration_tests/superset_test_config.py b/tests/integration_tests/superset_test_config.py index 89287be663e55..2aeeb3004e184 100644 --- a/tests/integration_tests/superset_test_config.py +++ b/tests/integration_tests/superset_test_config.py @@ -69,7 +69,6 @@ "SHARE_QUERIES_VIA_KV_STORE": True, "ENABLE_TEMPLATE_PROCESSING": True, "ALERT_REPORTS": True, - "DASHBOARD_NATIVE_FILTERS": True, "DRILL_TO_DETAIL": True, "DRILL_BY": True, "HORIZONTAL_FILTER_BAR": True,