From c2621aedf892cf75b922f1cf8debd777275bdd2c Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" Date: Fri, 22 Dec 2023 09:39:30 -0300 Subject: [PATCH 1/4] refactor: Removes the ENABLE_EXPLORE_DRAG_AND_DROP feature flag --- RESOURCES/FEATURE_FLAGS.md | 1 - UPDATING.md | 2 + .../e2e/dashboard/nativeFilters.test.ts | 2 +- .../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 ++++++------------- .../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, 42 insertions(+), 232 deletions(-) diff --git a/RESOURCES/FEATURE_FLAGS.md b/RESOURCES/FEATURE_FLAGS.md index d029ca6c3cbd6..49c0e75fc2789 100644 --- a/RESOURCES/FEATURE_FLAGS.md +++ b/RESOURCES/FEATURE_FLAGS.md @@ -92,7 +92,6 @@ These features flags currently default to True and **will be removed in a future - DASHBOARD_NATIVE_FILTERS - DASHBOARD_NATIVE_FILTERS_SET - DISABLE_DATASET_SOURCE_EDIT -- 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 b5c48924b727e..43499df43394d 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -29,6 +29,8 @@ 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. + ### Potential Downtime ### Other diff --git a/superset-frontend/cypress-base/cypress/e2e/dashboard/nativeFilters.test.ts b/superset-frontend/cypress-base/cypress/e2e/dashboard/nativeFilters.test.ts index 7683d7f87838d..4e0309a2daac1 100644 --- a/superset-frontend/cypress-base/cypress/e2e/dashboard/nativeFilters.test.ts +++ b/superset-frontend/cypress-base/cypress/e2e/dashboard/nativeFilters.test.ts @@ -414,7 +414,7 @@ describe('Native filters', () => { cy.createSampleDashboards([0]); }); - it.only('Verify that default value is respected after revisit', () => { + it('Verify that default value is respected after revisit', () => { prepareDashboardFilters([ { name: 'country_name', column: 'country_name', datasetId: 2 }, ]); 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 9a15f5c5c37e6..4fd069873cb04 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 acf3f3e8fdd51..ec769a871e999 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 57419b491899f..edb65a90ca458 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 @@ -85,8 +85,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 6bc77e0e87a1a..204419f00659f 100644 --- a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts +++ b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts @@ -42,7 +42,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 1b115a17e994a..44bb75cea221c 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 e0b65246097b5..f82701b5b0392 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 7c5b162d8dfb6..27ebb3be9755c 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 b0403b3596fb3..a11ca7f1ac61a 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 c336dd25befd1..490f87de4f285 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 46ef10fa2b922..4e5b5cd981546 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 447494714ce4b..9189c75e68a3a 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 5de81b5fbf323..67a55cff0d3af 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 80ed37a30170f..99f6b48b8927a 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/controls/DndColumnSelectControl/DndColumnSelect.test.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.test.tsx index 8eb068c022540..5ce772fb7a676 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 673861458d134..ef6d39486848e 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 3f662faea8b7d..0a4606dcb1da4 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 387f484904456..4f21201235e54 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 82abc7c8867a1..30be2cebb05c9 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 afa0a32f0c53c..eaf7acfe9632c 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 348baef5454af..93b5afa45f78d 100644 --- a/superset/config.py +++ b/superset/config.py @@ -454,7 +454,6 @@ class D3Format(TypedDict, total=False): # 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 From a9c371b9beefc903a4a6f23e816317ea285673ff Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" Date: Wed, 27 Dec 2023 08:08:32 -0300 Subject: [PATCH 2/4] Improves breaking change message --- UPDATING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UPDATING.md b/UPDATING.md index 43499df43394d..797aa84064186 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -29,7 +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. +- [26343](https://github.com/apache/superset/issues/26343): Removes the deprecated `ENABLE_EXPLORE_DRAG_AND_DROP` feature flag. The feature is now permanently enabled. ### Potential Downtime From a1475a6774332c4bb0fe41d2a5901f58ea03eada Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" Date: Wed, 27 Dec 2023 16:48:28 -0300 Subject: [PATCH 3/4] Fixes test --- .../ExploreViewContainer/ExploreViewContainer.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset-frontend/src/explore/components/ExploreViewContainer/ExploreViewContainer.test.tsx b/superset-frontend/src/explore/components/ExploreViewContainer/ExploreViewContainer.test.tsx index 1681fdce0d677..c58f8e04f5151 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 }, ); }; From e53f1e72d442f2ccef9fa71a70c78df7cbd1e075 Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Fri, 5 Jan 2024 10:46:12 -0300 Subject: [PATCH 4/4] Update UPDATING.md --- UPDATING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UPDATING.md b/UPDATING.md index 797aa84064186..982e81459d4a6 100644 --- a/UPDATING.md +++ b/UPDATING.md @@ -29,7 +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 feature is now permanently enabled. +- [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. ### Potential Downtime