From 6063f4ff04eb2fda056307b5c1e07e35b75d5a2a Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Tue, 16 Jan 2024 10:47:52 -0300 Subject: [PATCH] refactor: Removes the deprecated ENABLE_EXPLORE_DRAG_AND_DROP feature flag (#26343) --- RESOURCES/FEATURE_FLAGS.md | 1 - UPDATING.md | 1 + .../src/shared-controls/dndControls.tsx | 28 +---------- .../src/shared-controls/index.ts | 1 - .../src/shared-controls/sharedControls.tsx | 2 - .../src/utils/featureFlags.ts | 1 - .../src/controlPanel.tsx | 27 ++--------- .../src/controlPanel.ts | 20 +------- .../src/layers/Geojson/controlPanel.ts | 14 +----- .../src/layers/Path/controlPanel.ts | 9 +--- .../src/layers/Polygon/controlPanel.ts | 11 ++--- .../src/Tree/controlPanel.tsx | 6 +-- .../src/plugin/controls/columns.tsx | 37 +-------------- .../src/plugin/controls/metrics.tsx | 6 +-- .../components/DatasourcePanel/index.tsx | 46 ++++++------------- .../ExploreViewContainer.test.tsx | 2 +- .../DndColumnSelect.test.tsx | 9 ---- .../DndColumnSelect.tsx | 14 +----- .../DndFilterSelect.test.tsx | 9 ---- .../DndFilterSelect.tsx | 9 +--- .../DndMetricSelect.test.tsx | 9 ---- .../DndMetricSelect.tsx | 10 +--- superset/config.py | 1 - 23 files changed, 41 insertions(+), 232 deletions(-) diff --git a/RESOURCES/FEATURE_FLAGS.md b/RESOURCES/FEATURE_FLAGS.md index da0c50deb6..fa33f73d06 100644 --- a/RESOURCES/FEATURE_FLAGS.md +++ b/RESOURCES/FEATURE_FLAGS.md @@ -91,7 +91,6 @@ These features flags currently default to True and **will be removed in a future - DASHBOARD_FILTERS_EXPERIMENTAL - DASHBOARD_NATIVE_FILTERS - DASHBOARD_NATIVE_FILTERS_SET -- ENABLE_EXPLORE_DRAG_AND_DROP - ENABLE_EXPLORE_JSON_CSRF_PROTECTION - ENABLE_TEMPLATE_REMOVE_FILTERS - GENERIC_CHART_AXES diff --git a/UPDATING.md b/UPDATING.md index ad18b1e0e6..4c21669e1c 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -29,6 +29,7 @@ assists people when migrating to a new version. ### Breaking Changes +- [26343](https://github.com/apache/superset/issues/26343): Removes the deprecated `ENABLE_EXPLORE_DRAG_AND_DROP` feature flag. The previous value of the feature flag was `True` and now the feature is permanently enabled. - [26331](https://github.com/apache/superset/issues/26331): Removes the deprecated `DISABLE_DATASET_SOURCE_EDIT` feature flag. The previous value of the feature flag was `False` and now the feature is permanently removed. ### Potential Downtime diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/dndControls.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/dndControls.tsx index 9a15f5c5c3..4fd069873c 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/dndControls.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/dndControls.tsx @@ -17,14 +17,8 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useMemo } from 'react'; -import { - FeatureFlag, - isFeatureEnabled, - QueryColumn, - t, - validateNonEmpty, -} from '@superset-ui/core'; +import React from 'react'; +import { QueryColumn, t, validateNonEmpty } from '@superset-ui/core'; import { ExtraControlProps, SharedControlConfig, @@ -266,21 +260,3 @@ export const dndXAxisControl: typeof dndGroupByControl = { ...dndGroupByControl, ...xAxisMixin, }; - -export function withDndFallback( - DndComponent: React.ComponentType, - FallbackComponent: React.ComponentType, -) { - return function DndControl(props: any) { - const enableExploreDnd = useMemo( - () => isFeatureEnabled(FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP), - [], - ); - - return enableExploreDnd ? ( - - ) : ( - - ); - }; -} diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/index.ts b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/index.ts index acf3f3e8fd..ec769a871e 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/index.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/index.ts @@ -17,7 +17,6 @@ * under the License. */ export { default as sharedControls } from './sharedControls'; -export { withDndFallback } from './dndControls'; // React control components export { default as sharedControlComponents } from './components'; export * from './components'; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx index 341aaa0729..a981c4422e 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx @@ -86,8 +86,6 @@ import { dndXAxisControl, } from './dndControls'; -export { withDndFallback } from './dndControls'; - const categoricalSchemeRegistry = getCategoricalSchemeRegistry(); const sequentialSchemeRegistry = getSequentialSchemeRegistry(); 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 e3ad0a5d12..f30f7d1e1b 100644 --- a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts +++ b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts @@ -41,7 +41,6 @@ export enum FeatureFlag { EMBEDDABLE_CHARTS = 'EMBEDDABLE_CHARTS', EMBEDDED_SUPERSET = 'EMBEDDED_SUPERSET', ENABLE_ADVANCED_DATA_TYPES = 'ENABLE_ADVANCED_DATA_TYPES', - ENABLE_EXPLORE_DRAG_AND_DROP = 'ENABLE_EXPLORE_DRAG_AND_DROP', ENABLE_JAVASCRIPT_CONTROLS = 'ENABLE_JAVASCRIPT_CONTROLS', ENABLE_TEMPLATE_PROCESSING = 'ENABLE_TEMPLATE_PROCESSING', ENABLE_TEMPLATE_REMOVE_FILTERS = 'ENABLE_TEMPLATE_REMOVE_FILTERS', diff --git a/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/controlPanel.tsx b/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/controlPanel.tsx index 1b115a17e9..44bb75cea2 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/controlPanel.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/controlPanel.tsx @@ -17,16 +17,9 @@ * under the License. */ import React from 'react'; +import { t } from '@superset-ui/core'; import { - FeatureFlag, - isFeatureEnabled, - t, - validateNonEmpty, -} from '@superset-ui/core'; -import { - columnChoices, ControlPanelConfig, - ControlPanelState, formatSelectOptionsForRange, sections, sharedControls, @@ -41,25 +34,11 @@ const sortAxisChoices = [ ['value_desc', t('Metric descending')], ]; -const allColumns = { - type: 'SelectControl', - default: null, - description: t('Columns to display'), - mapStateToProps: (state: ControlPanelState) => ({ - choices: columnChoices(state.datasource), - }), - validators: [validateNonEmpty], -}; - const dndAllColumns = { ...sharedControls.entity, description: t('Columns to display'), }; -const columnsConfig = isFeatureEnabled(FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP) - ? dndAllColumns - : allColumns; - const config: ControlPanelConfig = { controlPanelSections: [ sections.legacyRegularTime, @@ -71,7 +50,7 @@ const config: ControlPanelConfig = { { name: 'all_columns_x', config: { - ...columnsConfig, + ...dndAllColumns, label: t('X Axis'), }, }, @@ -80,7 +59,7 @@ const config: ControlPanelConfig = { { name: 'all_columns_y', config: { - ...columnsConfig, + ...dndAllColumns, label: t('Y Axis'), }, }, diff --git a/superset-frontend/plugins/legacy-plugin-chart-map-box/src/controlPanel.ts b/superset-frontend/plugins/legacy-plugin-chart-map-box/src/controlPanel.ts index e0b6524609..f82701b5b0 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-map-box/src/controlPanel.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-map-box/src/controlPanel.ts @@ -16,33 +16,17 @@ * specific language governing permissions and limitations * under the License. */ -import { - FeatureFlag, - isFeatureEnabled, - t, - validateMapboxStylesUrl, -} from '@superset-ui/core'; +import { t, validateMapboxStylesUrl } from '@superset-ui/core'; import { columnChoices, ControlPanelConfig, - ControlPanelState, formatSelectOptions, sections, sharedControls, getStandardizedControls, } from '@superset-ui/chart-controls'; -const allColumns = { - type: 'SelectControl', - default: null, - mapStateToProps: (state: ControlPanelState) => ({ - choices: columnChoices(state.datasource), - }), -}; - -const columnsConfig = isFeatureEnabled(FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP) - ? sharedControls.entity - : allColumns; +const columnsConfig = sharedControls.entity; const colorChoices = [ ['rgb(0, 139, 139)', t('Dark Cyan')], diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/controlPanel.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/controlPanel.ts index 7c5b162d8d..27ebb3be97 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/controlPanel.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/controlPanel.ts @@ -17,12 +17,7 @@ * under the License. */ import { ControlPanelConfig, sections } from '@superset-ui/chart-controls'; -import { - t, - legacyValidateInteger, - isFeatureEnabled, - FeatureFlag, -} from '@superset-ui/core'; +import { t, legacyValidateInteger } from '@superset-ui/core'; import { formatSelectOptions } from '../../utilities/utils'; import { filterNulls, @@ -37,16 +32,11 @@ import { extruded, viewport, mapboxStyle, - geojsonColumn, autozoom, lineWidth, } from '../../utilities/Shared_DeckGL'; import { dndGeojsonColumn } from '../../utilities/sharedDndControls'; -const geojson = isFeatureEnabled(FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP) - ? dndGeojsonColumn - : geojsonColumn; - const config: ControlPanelConfig = { controlPanelSections: [ sections.legacyRegularTime, @@ -54,7 +44,7 @@ const config: ControlPanelConfig = { label: t('Query'), expanded: true, controlSetRows: [ - [geojson], + [dndGeojsonColumn], ['row_limit'], [filterNulls], ['adhoc_filters'], diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/controlPanel.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/controlPanel.ts index b0403b3596..a11ca7f1ac 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/controlPanel.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/controlPanel.ts @@ -17,7 +17,7 @@ * under the License. */ import { ControlPanelConfig, sections } from '@superset-ui/chart-controls'; -import { FeatureFlag, isFeatureEnabled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; import { filterNulls, autozoom, @@ -25,7 +25,6 @@ import { jsDataMutator, jsTooltip, jsOnclickHref, - lineColumn, viewport, lineWidth, lineType, @@ -41,11 +40,7 @@ const config: ControlPanelConfig = { label: t('Query'), expanded: true, controlSetRows: [ - [ - isFeatureEnabled(FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP) - ? dndLineColumn - : lineColumn, - ], + [dndLineColumn], [ { ...lineType, diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/controlPanel.ts b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/controlPanel.ts index c336dd25be..490f87de4f 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/controlPanel.ts +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/controlPanel.ts @@ -21,7 +21,7 @@ import { getStandardizedControls, sections, } from '@superset-ui/chart-controls'; -import { FeatureFlag, isFeatureEnabled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; import timeGrainSqlaAnimationOverrides from '../../utilities/controls'; import { formatSelectOptions } from '../../utilities/utils'; import { @@ -33,7 +33,6 @@ import { jsOnclickHref, legendFormat, legendPosition, - lineColumn, fillColorPicker, strokeColorPicker, filled, @@ -49,10 +48,6 @@ import { } from '../../utilities/Shared_DeckGL'; import { dndLineColumn } from '../../utilities/sharedDndControls'; -const lines = isFeatureEnabled(FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP) - ? dndLineColumn - : lineColumn; - const config: ControlPanelConfig = { controlPanelSections: [ sections.legacyRegularTime, @@ -62,9 +57,9 @@ const config: ControlPanelConfig = { controlSetRows: [ [ { - ...lines, + ...dndLineColumn, config: { - ...lines.config, + ...dndLineColumn.config, label: t('Polygon Column'), }, }, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx index 46ef10fa2b..4e5b5cd981 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx @@ -17,7 +17,7 @@ * under the License. */ import React from 'react'; -import { FeatureFlag, isFeatureEnabled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; import { ControlPanelConfig, ControlSubSectionHeader, @@ -93,9 +93,7 @@ const controlPanel: ControlPanelConfig = { name: 'metric', config: { ...optionalEntity, - type: isFeatureEnabled(FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP) - ? 'DndMetricSelect' - : 'MetricsControl', + type: 'DndMetricSelect', label: t('Metric'), description: t('Metric for node values'), }, diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/columns.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/columns.tsx index 447494714c..9189c75e68 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/columns.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/columns.tsx @@ -17,46 +17,15 @@ * under the License. */ import { - ColumnOption, ControlSetItem, ExtraControlProps, sharedControls, Dataset, ColumnMeta, } from '@superset-ui/chart-controls'; -import { - ensureIsArray, - FeatureFlag, - isFeatureEnabled, - t, -} from '@superset-ui/core'; -import React from 'react'; +import { ensureIsArray, t } from '@superset-ui/core'; import { getQueryMode, isRawMode } from './shared'; -const allColumns: typeof sharedControls.groupby = { - type: 'SelectControl', - label: t('Columns'), - description: t('Columns to display'), - multi: true, - freeForm: true, - allowAll: true, - commaChoosesOption: false, - default: [], - optionRenderer: c => , - valueRenderer: c => , - valueKey: 'column_name', - mapStateToProps: ({ datasource, controls }, controlState) => ({ - options: datasource?.columns || [], - queryMode: getQueryMode(controls), - externalValidationErrors: - isRawMode({ controls }) && ensureIsArray(controlState?.value).length === 0 - ? [t('must have a value')] - : [], - }), - visibility: isRawMode, - resetOnHide: false, -}; - const dndAllColumns: typeof sharedControls.groupby = { type: 'DndColumnSelect', label: t('Columns'), @@ -84,7 +53,5 @@ const dndAllColumns: typeof sharedControls.groupby = { export const allColumnsControlSetItem: ControlSetItem = { name: 'all_columns', - config: isFeatureEnabled(FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP) - ? dndAllColumns - : allColumns, + config: dndAllColumns, }; diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/metrics.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/metrics.tsx index 5de81b5fbf..67a55cff0d 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/metrics.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/metrics.tsx @@ -25,7 +25,7 @@ import { ColumnMeta, defineSavedMetrics, } from '@superset-ui/chart-controls'; -import { FeatureFlag, isFeatureEnabled, t } from '@superset-ui/core'; +import { t } from '@superset-ui/core'; import { getQueryMode, isAggMode, validateAggControlValues } from './shared'; const percentMetrics: typeof sharedControls.metrics = { @@ -64,9 +64,7 @@ const dndPercentMetrics = { export const percentMetricsControlSetItem: ControlSetItem = { name: 'percent_metrics', config: { - ...(isFeatureEnabled(FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP) - ? dndPercentMetrics - : percentMetrics), + ...dndPercentMetrics, }, }; diff --git a/superset-frontend/src/explore/components/DatasourcePanel/index.tsx b/superset-frontend/src/explore/components/DatasourcePanel/index.tsx index 80ed37a301..99f6b48b89 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel/index.tsx +++ b/superset-frontend/src/explore/components/DatasourcePanel/index.tsx @@ -20,15 +20,13 @@ import React, { useEffect, useMemo, useRef, useState } from 'react'; import { css, DatasourceType, - isFeatureEnabled, - FeatureFlag, Metric, QueryFormData, styled, t, } from '@superset-ui/core'; -import { ControlConfig, ColumnMeta } from '@superset-ui/chart-controls'; +import { ControlConfig } from '@superset-ui/chart-controls'; import { debounce, isArray } from 'lodash'; import { matchSorter, rankings } from 'match-sorter'; @@ -42,7 +40,6 @@ import { ExploreActions } from 'src/explore/actions/exploreActions'; import Control from 'src/explore/components/Control'; import DatasourcePanelDragOption from './DatasourcePanelDragOption'; import { DndItemType } from '../DndItemType'; -import { StyledColumnOption, StyledMetricOption } from '../optionRenderers'; import { DndItemValue } from './types'; interface DatasourceControl extends ControlConfig { @@ -83,10 +80,6 @@ export interface Props { formData?: QueryFormData; } -const enableExploreDnd = isFeatureEnabled( - FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP, -); - const Button = styled.button` background: none; border: none; @@ -151,14 +144,11 @@ const LabelWrapper = styled.div` margin-bottom: 0; } - ${enableExploreDnd && - css` - padding: 0; - cursor: pointer; - &:hover { - background-color: ${theme.colors.grayscale.light3}; - } - `} + padding: 0; + cursor: pointer; + &:hover { + background-color: ${theme.colors.grayscale.light3}; + } & > span { white-space: nowrap; @@ -417,14 +407,10 @@ export default function DataSourcePanel({ key={m.metric_name + String(shouldForceUpdate)} className="column" > - {enableExploreDnd ? ( - - ) : ( - - )} + ))} {lists?.metrics?.length > DEFAULT_MAX_METRICS_LENGTH ? ( @@ -454,14 +440,10 @@ export default function DataSourcePanel({ key={col.column_name + String(shouldForceUpdate)} className="column" > - {enableExploreDnd ? ( - - ) : ( - - )} + ))} {lists.columns.length > DEFAULT_MAX_COLUMNS_LENGTH ? ( diff --git a/superset-frontend/src/explore/components/ExploreViewContainer/ExploreViewContainer.test.tsx b/superset-frontend/src/explore/components/ExploreViewContainer/ExploreViewContainer.test.tsx index 1681fdce0d..c58f8e04f5 100644 --- a/superset-frontend/src/explore/components/ExploreViewContainer/ExploreViewContainer.test.tsx +++ b/superset-frontend/src/explore/components/ExploreViewContainer/ExploreViewContainer.test.tsx @@ -123,7 +123,7 @@ const renderWithRouter = ({ , - { useRedux: true, initialState }, + { useRedux: true, useDnd: true, initialState }, ); }; diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.test.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.test.tsx index 8eb068c022..5ce772fb7a 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.test.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.test.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import { FeatureFlag } from '@superset-ui/core'; import React from 'react'; import { render, screen } from 'spec/helpers/testing-library'; import { @@ -32,14 +31,6 @@ const defaultProps: DndColumnSelectProps = { actions: { setControlValue: jest.fn() }, }; -beforeAll(() => { - window.featureFlags = { [FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP]: true }; -}); - -afterAll(() => { - window.featureFlags = {}; -}); - test('renders with default props', async () => { render(, { useDnd: true, diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.tsx index 673861458d..ef6d394868 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.tsx @@ -24,11 +24,7 @@ import { t, isAdhocColumn, } from '@superset-ui/core'; -import { - ColumnMeta, - isColumnMeta, - withDndFallback, -} from '@superset-ui/chart-controls'; +import { ColumnMeta, isColumnMeta } from '@superset-ui/chart-controls'; import { isEmpty } from 'lodash'; import DndSelectLabel from 'src/explore/components/controls/DndColumnSelectControl/DndSelectLabel'; import OptionWrapper from 'src/explore/components/controls/DndColumnSelectControl/OptionWrapper'; @@ -37,7 +33,6 @@ import { DatasourcePanelDndItem } from 'src/explore/components/DatasourcePanel/t import { DndItemType } from 'src/explore/components/DndItemType'; import ColumnSelectPopoverTrigger from './ColumnSelectPopoverTrigger'; import { DndControlProps } from './types'; -import SelectControl from '../SelectControl'; export type DndColumnSelectProps = DndControlProps & { options: ColumnMeta[]; @@ -216,9 +211,4 @@ function DndColumnSelect(props: DndColumnSelectProps) { ); } -const DndColumnSelectWithFallback = withDndFallback( - DndColumnSelect, - SelectControl, -); - -export { DndColumnSelectWithFallback as DndColumnSelect }; +export { DndColumnSelect }; diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.test.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.test.tsx index 3f662faea8..0a4606dcb1 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.test.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.test.tsx @@ -23,7 +23,6 @@ import configureStore from 'redux-mock-store'; import { ensureIsArray, - FeatureFlag, GenericDataType, QueryFormData, } from '@superset-ui/core'; @@ -58,14 +57,6 @@ const baseFormData = { datasource: 'table__1', }; -beforeAll(() => { - window.featureFlags = { [FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP]: true }; -}); - -afterAll(() => { - window.featureFlags = {}; -}); - const mockStore = configureStore([thunk]); const store = mockStore({}); diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.tsx index 387f484904..4f21201235 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndFilterSelect.tsx @@ -30,7 +30,6 @@ import { ColumnMeta, isColumnMeta, isTemporalColumn, - withDndFallback, } from '@superset-ui/chart-controls'; import Modal from 'src/components/Modal'; import { @@ -50,7 +49,6 @@ import { } from 'src/explore/components/DatasourcePanel/types'; import { DndItemType } from 'src/explore/components/DndItemType'; import { ControlComponentProps } from 'src/explore/components/Control'; -import AdhocFilterControl from '../FilterControl/AdhocFilterControl'; import DndAdhocFilterOption from './DndAdhocFilterOption'; import { useDefaultTimeFilter } from '../DateFilterControl/utils'; import { CLAUSES, EXPRESSION_TYPES } from '../FilterControl/types'; @@ -422,9 +420,4 @@ const DndFilterSelect = (props: DndFilterSelectProps) => { ); }; -const DndFilterSelectWithFallback = withDndFallback( - DndFilterSelect, - AdhocFilterControl, -); - -export { DndFilterSelectWithFallback as DndFilterSelect }; +export { DndFilterSelect }; diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.test.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.test.tsx index 82abc7c886..30be2cebb0 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.test.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.test.tsx @@ -18,7 +18,6 @@ */ import React from 'react'; import userEvent from '@testing-library/user-event'; -import { FeatureFlag } from '@superset-ui/core'; import { render, screen, @@ -68,14 +67,6 @@ const adhocMetricB = { optionName: 'def', }; -beforeAll(() => { - window.featureFlags = { [FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP]: true }; -}); - -afterAll(() => { - window.featureFlags = {}; -}); - test('renders with default props', () => { render(, { useDnd: true }); expect( diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.tsx index afa0a32f0c..eaf7acfe96 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.tsx @@ -28,7 +28,7 @@ import { t, tn, } from '@superset-ui/core'; -import { ColumnMeta, withDndFallback } from '@superset-ui/chart-controls'; +import { ColumnMeta } from '@superset-ui/chart-controls'; import AdhocMetric from 'src/explore/components/controls/MetricControl/AdhocMetric'; import AdhocMetricPopoverTrigger from 'src/explore/components/controls/MetricControl/AdhocMetricPopoverTrigger'; import MetricDefinitionValue from 'src/explore/components/controls/MetricControl/MetricDefinitionValue'; @@ -40,7 +40,6 @@ import { DndItemType } from 'src/explore/components/DndItemType'; import DndSelectLabel from 'src/explore/components/controls/DndColumnSelectControl/DndSelectLabel'; import { savedMetricType } from 'src/explore/components/controls/MetricControl/types'; import { AGGREGATES } from 'src/explore/constants'; -import MetricsControl from '../MetricControl/MetricsControl'; const EMPTY_OBJECT = {}; const DND_ACCEPTED_TYPES = [DndItemType.Column, DndItemType.Metric]; @@ -364,9 +363,4 @@ const DndMetricSelect = (props: any) => { ); }; -const DndMetricSelectWithFallback = withDndFallback( - DndMetricSelect, - MetricsControl, -); - -export { DndMetricSelectWithFallback as DndMetricSelect }; +export { DndMetricSelect }; diff --git a/superset/config.py b/superset/config.py index 37ed0004fe..3a5ee1856a 100644 --- a/superset/config.py +++ b/superset/config.py @@ -453,7 +453,6 @@ DEFAULT_FEATURE_FLAGS: dict[str, bool] = { # Enables Alerts and reports new implementation "ALERT_REPORTS": False, "DASHBOARD_RBAC": False, - "ENABLE_EXPLORE_DRAG_AND_DROP": True, # deprecated "ENABLE_ADVANCED_DATA_TYPES": False, # Enabling ALERTS_ATTACH_REPORTS, the system sends email and slack message # with screenshot and link