diff --git a/RESOURCES/FEATURE_FLAGS.md b/RESOURCES/FEATURE_FLAGS.md index 5c286ffa96487..6ce8c1c1ee2dc 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_FILTERS_EXPERIMENTAL - DASHBOARD_NATIVE_FILTERS - ENABLE_JAVASCRIPT_CONTROLS - GENERIC_CHART_AXES diff --git a/UPDATING.md b/UPDATING.md index 7e5e2ea472d75..05d56bdc3f90a 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -30,6 +30,7 @@ assists people when migrating to a new version. ### Breaking Changes +- [26330](https://github.com/apache/superset/issues/26330): Removes the deprecated `DASHBOARD_FILTERS_EXPERIMENTAL` feature flag. The previous value of the feature flag was `False` and now the feature is permanently removed. - [26344](https://github.com/apache/superset/issues/26344): Removes the deprecated `ENABLE_EXPLORE_JSON_CSRF_PROTECTION` feature flag. The previous value of the feature flag was `False` and now the feature is permanently removed. - [26345](https://github.com/apache/superset/issues/26345): Removes the deprecated `ENABLE_TEMPLATE_REMOVE_FILTERS` feature flag. The previous value of the feature flag was `True` and now the feature is permanently enabled. - [26346](https://github.com/apache/superset/issues/26346): Removes the deprecated `REMOVE_SLICE_LEVEL_LABEL_COLORS` feature flag. The previous value of the feature flag was `False` and now the feature is permanently removed. 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 b2001ec4c136a..6d5935f04eac6 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_FILTERS_EXPERIMENTAL = 'DASHBOARD_FILTERS_EXPERIMENTAL', DASHBOARD_NATIVE_FILTERS = 'DASHBOARD_NATIVE_FILTERS', DASHBOARD_VIRTUALIZATION = 'DASHBOARD_VIRTUALIZATION', DASHBOARD_RBAC = 'DASHBOARD_RBAC', diff --git a/superset-frontend/src/dashboard/components/nativeFilters/utils.test.ts b/superset-frontend/src/dashboard/components/nativeFilters/utils.test.ts index 7219ae360b764..0388565595ff4 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/utils.test.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/utils.test.ts @@ -94,10 +94,7 @@ describe('nativeFilterGate', () => { isFeatureEnabledMock = jest .spyOn(uiCore, 'isFeatureEnabled') .mockImplementation((featureFlag: FeatureFlag) => - [ - FeatureFlag.DASHBOARD_CROSS_FILTERS, - FeatureFlag.DASHBOARD_FILTERS_EXPERIMENTAL, - ].includes(featureFlag), + [FeatureFlag.DASHBOARD_CROSS_FILTERS].includes(featureFlag), ); }); diff --git a/superset-frontend/src/dashboard/components/nativeFilters/utils.ts b/superset-frontend/src/dashboard/components/nativeFilters/utils.ts index 9e1108366d3ef..12f6d33e20b0c 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/utils.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/utils.ts @@ -151,8 +151,7 @@ export function getExtraFormData( export function nativeFilterGate(behaviors: Behavior[]): boolean { return ( !behaviors.includes(Behavior.NATIVE_FILTER) || - (isFeatureEnabled(FeatureFlag.DASHBOARD_FILTERS_EXPERIMENTAL) && - isFeatureEnabled(FeatureFlag.DASHBOARD_CROSS_FILTERS) && + (isFeatureEnabled(FeatureFlag.DASHBOARD_CROSS_FILTERS) && behaviors.includes(Behavior.INTERACTIVE_CHART)) ); } diff --git a/superset-frontend/src/filters/components/GroupBy/GroupByFilterPlugin.tsx b/superset-frontend/src/filters/components/GroupBy/GroupByFilterPlugin.tsx deleted file mode 100644 index dfc314024ec9f..0000000000000 --- a/superset-frontend/src/filters/components/GroupBy/GroupByFilterPlugin.tsx +++ /dev/null @@ -1,130 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -import { - ensureIsArray, - ExtraFormData, - getColumnLabel, - t, - tn, -} from '@superset-ui/core'; -import React, { useEffect, useState } from 'react'; -import { FormItemProps } from 'antd/lib/form'; -import { Select } from 'src/components'; -import { FilterPluginStyle, StyledFormItem, StatusMessage } from '../common'; -import { PluginFilterGroupByProps } from './types'; - -export default function PluginFilterGroupBy(props: PluginFilterGroupByProps) { - const { - data, - formData, - height, - width, - setDataMask, - setHoveredFilter, - unsetHoveredFilter, - setFocusedFilter, - unsetFocusedFilter, - setFilterActive, - filterState, - inputRef, - } = props; - const { defaultValue, multiSelect } = formData; - - const [value, setValue] = useState(defaultValue ?? []); - - const handleChange = (value?: string[] | string | null) => { - const resultValue: string[] = ensureIsArray(value); - setValue(resultValue); - const extraFormData: ExtraFormData = {}; - if (resultValue.length) { - extraFormData.interactive_groupby = resultValue; - } - - setDataMask({ - filterState: { value: resultValue.length ? resultValue : null }, - extraFormData, - }); - }; - - useEffect(() => { - handleChange(filterState.value); - }, [JSON.stringify(filterState.value), multiSelect]); - - useEffect(() => { - handleChange(defaultValue ?? null); - // I think after Config Modal update some filter it re-creates default value for all other filters - // so we can process it like this `JSON.stringify` or start to use `Immer` - }, [JSON.stringify(defaultValue), multiSelect]); - - const groupbys = ensureIsArray(formData.groupby).map(getColumnLabel); - const groupby = groupbys[0]?.length ? groupbys[0] : null; - - const withData = groupby - ? data.filter(row => groupby.includes(row.column_name as string)) - : data; - - const columns = data ? withData : []; - - const placeholderText = - columns.length === 0 - ? t('No columns') - : tn('%s option', '%s options', columns.length, columns.length); - - const formItemData: FormItemProps = {}; - if (filterState.validateMessage) { - formItemData.extra = ( - - {filterState.validateMessage} - - ); - } - const options = columns.map( - (row: { column_name: string; verbose_name: string | null }) => { - const { column_name: columnName, verbose_name: verboseName } = row; - return { - label: verboseName ?? columnName, - value: columnName, - }; - }, - ); - return ( - - -