refactor: Removes the deprecated ENABLE_EXPLORE_DRAG_AND_DROP feature flag (#26343)

This commit is contained in:
Michael S. Molina 2024-01-16 10:47:52 -03:00 committed by GitHub
parent b2ad74f94f
commit 6063f4ff04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 41 additions and 232 deletions

View File

@ -91,7 +91,6 @@ These features flags currently default to True and **will be removed in a future
- DASHBOARD_FILTERS_EXPERIMENTAL - DASHBOARD_FILTERS_EXPERIMENTAL
- DASHBOARD_NATIVE_FILTERS - DASHBOARD_NATIVE_FILTERS
- DASHBOARD_NATIVE_FILTERS_SET - DASHBOARD_NATIVE_FILTERS_SET
- ENABLE_EXPLORE_DRAG_AND_DROP
- ENABLE_EXPLORE_JSON_CSRF_PROTECTION - ENABLE_EXPLORE_JSON_CSRF_PROTECTION
- ENABLE_TEMPLATE_REMOVE_FILTERS - ENABLE_TEMPLATE_REMOVE_FILTERS
- GENERIC_CHART_AXES - GENERIC_CHART_AXES

View File

@ -29,6 +29,7 @@ assists people when migrating to a new version.
### Breaking Changes ### 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. - [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 ### Potential Downtime

View File

@ -17,14 +17,8 @@
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
import React, { useMemo } from 'react'; import React from 'react';
import { import { QueryColumn, t, validateNonEmpty } from '@superset-ui/core';
FeatureFlag,
isFeatureEnabled,
QueryColumn,
t,
validateNonEmpty,
} from '@superset-ui/core';
import { import {
ExtraControlProps, ExtraControlProps,
SharedControlConfig, SharedControlConfig,
@ -266,21 +260,3 @@ export const dndXAxisControl: typeof dndGroupByControl = {
...dndGroupByControl, ...dndGroupByControl,
...xAxisMixin, ...xAxisMixin,
}; };
export function withDndFallback(
DndComponent: React.ComponentType<any>,
FallbackComponent: React.ComponentType<any>,
) {
return function DndControl(props: any) {
const enableExploreDnd = useMemo(
() => isFeatureEnabled(FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP),
[],
);
return enableExploreDnd ? (
<DndComponent {...props} />
) : (
<FallbackComponent {...props} />
);
};
}

View File

@ -17,7 +17,6 @@
* under the License. * under the License.
*/ */
export { default as sharedControls } from './sharedControls'; export { default as sharedControls } from './sharedControls';
export { withDndFallback } from './dndControls';
// React control components // React control components
export { default as sharedControlComponents } from './components'; export { default as sharedControlComponents } from './components';
export * from './components'; export * from './components';

View File

@ -86,8 +86,6 @@ import {
dndXAxisControl, dndXAxisControl,
} from './dndControls'; } from './dndControls';
export { withDndFallback } from './dndControls';
const categoricalSchemeRegistry = getCategoricalSchemeRegistry(); const categoricalSchemeRegistry = getCategoricalSchemeRegistry();
const sequentialSchemeRegistry = getSequentialSchemeRegistry(); const sequentialSchemeRegistry = getSequentialSchemeRegistry();

View File

@ -41,7 +41,6 @@ export enum FeatureFlag {
EMBEDDABLE_CHARTS = 'EMBEDDABLE_CHARTS', EMBEDDABLE_CHARTS = 'EMBEDDABLE_CHARTS',
EMBEDDED_SUPERSET = 'EMBEDDED_SUPERSET', EMBEDDED_SUPERSET = 'EMBEDDED_SUPERSET',
ENABLE_ADVANCED_DATA_TYPES = 'ENABLE_ADVANCED_DATA_TYPES', 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_JAVASCRIPT_CONTROLS = 'ENABLE_JAVASCRIPT_CONTROLS',
ENABLE_TEMPLATE_PROCESSING = 'ENABLE_TEMPLATE_PROCESSING', ENABLE_TEMPLATE_PROCESSING = 'ENABLE_TEMPLATE_PROCESSING',
ENABLE_TEMPLATE_REMOVE_FILTERS = 'ENABLE_TEMPLATE_REMOVE_FILTERS', ENABLE_TEMPLATE_REMOVE_FILTERS = 'ENABLE_TEMPLATE_REMOVE_FILTERS',

View File

@ -17,16 +17,9 @@
* under the License. * under the License.
*/ */
import React from 'react'; import React from 'react';
import { t } from '@superset-ui/core';
import { import {
FeatureFlag,
isFeatureEnabled,
t,
validateNonEmpty,
} from '@superset-ui/core';
import {
columnChoices,
ControlPanelConfig, ControlPanelConfig,
ControlPanelState,
formatSelectOptionsForRange, formatSelectOptionsForRange,
sections, sections,
sharedControls, sharedControls,
@ -41,25 +34,11 @@ const sortAxisChoices = [
['value_desc', t('Metric descending')], ['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 = { const dndAllColumns = {
...sharedControls.entity, ...sharedControls.entity,
description: t('Columns to display'), description: t('Columns to display'),
}; };
const columnsConfig = isFeatureEnabled(FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP)
? dndAllColumns
: allColumns;
const config: ControlPanelConfig = { const config: ControlPanelConfig = {
controlPanelSections: [ controlPanelSections: [
sections.legacyRegularTime, sections.legacyRegularTime,
@ -71,7 +50,7 @@ const config: ControlPanelConfig = {
{ {
name: 'all_columns_x', name: 'all_columns_x',
config: { config: {
...columnsConfig, ...dndAllColumns,
label: t('X Axis'), label: t('X Axis'),
}, },
}, },
@ -80,7 +59,7 @@ const config: ControlPanelConfig = {
{ {
name: 'all_columns_y', name: 'all_columns_y',
config: { config: {
...columnsConfig, ...dndAllColumns,
label: t('Y Axis'), label: t('Y Axis'),
}, },
}, },

View File

@ -16,33 +16,17 @@
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
import { import { t, validateMapboxStylesUrl } from '@superset-ui/core';
FeatureFlag,
isFeatureEnabled,
t,
validateMapboxStylesUrl,
} from '@superset-ui/core';
import { import {
columnChoices, columnChoices,
ControlPanelConfig, ControlPanelConfig,
ControlPanelState,
formatSelectOptions, formatSelectOptions,
sections, sections,
sharedControls, sharedControls,
getStandardizedControls, getStandardizedControls,
} from '@superset-ui/chart-controls'; } from '@superset-ui/chart-controls';
const allColumns = { const columnsConfig = sharedControls.entity;
type: 'SelectControl',
default: null,
mapStateToProps: (state: ControlPanelState) => ({
choices: columnChoices(state.datasource),
}),
};
const columnsConfig = isFeatureEnabled(FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP)
? sharedControls.entity
: allColumns;
const colorChoices = [ const colorChoices = [
['rgb(0, 139, 139)', t('Dark Cyan')], ['rgb(0, 139, 139)', t('Dark Cyan')],

View File

@ -17,12 +17,7 @@
* under the License. * under the License.
*/ */
import { ControlPanelConfig, sections } from '@superset-ui/chart-controls'; import { ControlPanelConfig, sections } from '@superset-ui/chart-controls';
import { import { t, legacyValidateInteger } from '@superset-ui/core';
t,
legacyValidateInteger,
isFeatureEnabled,
FeatureFlag,
} from '@superset-ui/core';
import { formatSelectOptions } from '../../utilities/utils'; import { formatSelectOptions } from '../../utilities/utils';
import { import {
filterNulls, filterNulls,
@ -37,16 +32,11 @@ import {
extruded, extruded,
viewport, viewport,
mapboxStyle, mapboxStyle,
geojsonColumn,
autozoom, autozoom,
lineWidth, lineWidth,
} from '../../utilities/Shared_DeckGL'; } from '../../utilities/Shared_DeckGL';
import { dndGeojsonColumn } from '../../utilities/sharedDndControls'; import { dndGeojsonColumn } from '../../utilities/sharedDndControls';
const geojson = isFeatureEnabled(FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP)
? dndGeojsonColumn
: geojsonColumn;
const config: ControlPanelConfig = { const config: ControlPanelConfig = {
controlPanelSections: [ controlPanelSections: [
sections.legacyRegularTime, sections.legacyRegularTime,
@ -54,7 +44,7 @@ const config: ControlPanelConfig = {
label: t('Query'), label: t('Query'),
expanded: true, expanded: true,
controlSetRows: [ controlSetRows: [
[geojson], [dndGeojsonColumn],
['row_limit'], ['row_limit'],
[filterNulls], [filterNulls],
['adhoc_filters'], ['adhoc_filters'],

View File

@ -17,7 +17,7 @@
* under the License. * under the License.
*/ */
import { ControlPanelConfig, sections } from '@superset-ui/chart-controls'; import { ControlPanelConfig, sections } from '@superset-ui/chart-controls';
import { FeatureFlag, isFeatureEnabled, t } from '@superset-ui/core'; import { t } from '@superset-ui/core';
import { import {
filterNulls, filterNulls,
autozoom, autozoom,
@ -25,7 +25,6 @@ import {
jsDataMutator, jsDataMutator,
jsTooltip, jsTooltip,
jsOnclickHref, jsOnclickHref,
lineColumn,
viewport, viewport,
lineWidth, lineWidth,
lineType, lineType,
@ -41,11 +40,7 @@ const config: ControlPanelConfig = {
label: t('Query'), label: t('Query'),
expanded: true, expanded: true,
controlSetRows: [ controlSetRows: [
[ [dndLineColumn],
isFeatureEnabled(FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP)
? dndLineColumn
: lineColumn,
],
[ [
{ {
...lineType, ...lineType,

View File

@ -21,7 +21,7 @@ import {
getStandardizedControls, getStandardizedControls,
sections, sections,
} from '@superset-ui/chart-controls'; } 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 timeGrainSqlaAnimationOverrides from '../../utilities/controls';
import { formatSelectOptions } from '../../utilities/utils'; import { formatSelectOptions } from '../../utilities/utils';
import { import {
@ -33,7 +33,6 @@ import {
jsOnclickHref, jsOnclickHref,
legendFormat, legendFormat,
legendPosition, legendPosition,
lineColumn,
fillColorPicker, fillColorPicker,
strokeColorPicker, strokeColorPicker,
filled, filled,
@ -49,10 +48,6 @@ import {
} from '../../utilities/Shared_DeckGL'; } from '../../utilities/Shared_DeckGL';
import { dndLineColumn } from '../../utilities/sharedDndControls'; import { dndLineColumn } from '../../utilities/sharedDndControls';
const lines = isFeatureEnabled(FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP)
? dndLineColumn
: lineColumn;
const config: ControlPanelConfig = { const config: ControlPanelConfig = {
controlPanelSections: [ controlPanelSections: [
sections.legacyRegularTime, sections.legacyRegularTime,
@ -62,9 +57,9 @@ const config: ControlPanelConfig = {
controlSetRows: [ controlSetRows: [
[ [
{ {
...lines, ...dndLineColumn,
config: { config: {
...lines.config, ...dndLineColumn.config,
label: t('Polygon Column'), label: t('Polygon Column'),
}, },
}, },

View File

@ -17,7 +17,7 @@
* under the License. * under the License.
*/ */
import React from 'react'; import React from 'react';
import { FeatureFlag, isFeatureEnabled, t } from '@superset-ui/core'; import { t } from '@superset-ui/core';
import { import {
ControlPanelConfig, ControlPanelConfig,
ControlSubSectionHeader, ControlSubSectionHeader,
@ -93,9 +93,7 @@ const controlPanel: ControlPanelConfig = {
name: 'metric', name: 'metric',
config: { config: {
...optionalEntity, ...optionalEntity,
type: isFeatureEnabled(FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP) type: 'DndMetricSelect',
? 'DndMetricSelect'
: 'MetricsControl',
label: t('Metric'), label: t('Metric'),
description: t('Metric for node values'), description: t('Metric for node values'),
}, },

View File

@ -17,46 +17,15 @@
* under the License. * under the License.
*/ */
import { import {
ColumnOption,
ControlSetItem, ControlSetItem,
ExtraControlProps, ExtraControlProps,
sharedControls, sharedControls,
Dataset, Dataset,
ColumnMeta, ColumnMeta,
} from '@superset-ui/chart-controls'; } from '@superset-ui/chart-controls';
import { import { ensureIsArray, t } from '@superset-ui/core';
ensureIsArray,
FeatureFlag,
isFeatureEnabled,
t,
} from '@superset-ui/core';
import React from 'react';
import { getQueryMode, isRawMode } from './shared'; 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 => <ColumnOption showType column={c} />,
valueRenderer: c => <ColumnOption column={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 = { const dndAllColumns: typeof sharedControls.groupby = {
type: 'DndColumnSelect', type: 'DndColumnSelect',
label: t('Columns'), label: t('Columns'),
@ -84,7 +53,5 @@ const dndAllColumns: typeof sharedControls.groupby = {
export const allColumnsControlSetItem: ControlSetItem = { export const allColumnsControlSetItem: ControlSetItem = {
name: 'all_columns', name: 'all_columns',
config: isFeatureEnabled(FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP) config: dndAllColumns,
? dndAllColumns
: allColumns,
}; };

View File

@ -25,7 +25,7 @@ import {
ColumnMeta, ColumnMeta,
defineSavedMetrics, defineSavedMetrics,
} from '@superset-ui/chart-controls'; } 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'; import { getQueryMode, isAggMode, validateAggControlValues } from './shared';
const percentMetrics: typeof sharedControls.metrics = { const percentMetrics: typeof sharedControls.metrics = {
@ -64,9 +64,7 @@ const dndPercentMetrics = {
export const percentMetricsControlSetItem: ControlSetItem = { export const percentMetricsControlSetItem: ControlSetItem = {
name: 'percent_metrics', name: 'percent_metrics',
config: { config: {
...(isFeatureEnabled(FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP) ...dndPercentMetrics,
? dndPercentMetrics
: percentMetrics),
}, },
}; };

View File

@ -20,15 +20,13 @@ import React, { useEffect, useMemo, useRef, useState } from 'react';
import { import {
css, css,
DatasourceType, DatasourceType,
isFeatureEnabled,
FeatureFlag,
Metric, Metric,
QueryFormData, QueryFormData,
styled, styled,
t, t,
} from '@superset-ui/core'; } 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 { debounce, isArray } from 'lodash';
import { matchSorter, rankings } from 'match-sorter'; 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 Control from 'src/explore/components/Control';
import DatasourcePanelDragOption from './DatasourcePanelDragOption'; import DatasourcePanelDragOption from './DatasourcePanelDragOption';
import { DndItemType } from '../DndItemType'; import { DndItemType } from '../DndItemType';
import { StyledColumnOption, StyledMetricOption } from '../optionRenderers';
import { DndItemValue } from './types'; import { DndItemValue } from './types';
interface DatasourceControl extends ControlConfig { interface DatasourceControl extends ControlConfig {
@ -83,10 +80,6 @@ export interface Props {
formData?: QueryFormData; formData?: QueryFormData;
} }
const enableExploreDnd = isFeatureEnabled(
FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP,
);
const Button = styled.button` const Button = styled.button`
background: none; background: none;
border: none; border: none;
@ -151,14 +144,11 @@ const LabelWrapper = styled.div`
margin-bottom: 0; margin-bottom: 0;
} }
${enableExploreDnd && padding: 0;
css` cursor: pointer;
padding: 0; &:hover {
cursor: pointer; background-color: ${theme.colors.grayscale.light3};
&:hover { }
background-color: ${theme.colors.grayscale.light3};
}
`}
& > span { & > span {
white-space: nowrap; white-space: nowrap;
@ -417,14 +407,10 @@ export default function DataSourcePanel({
key={m.metric_name + String(shouldForceUpdate)} key={m.metric_name + String(shouldForceUpdate)}
className="column" className="column"
> >
{enableExploreDnd ? ( <DatasourcePanelDragOption
<DatasourcePanelDragOption value={m}
value={m} type={DndItemType.Metric}
type={DndItemType.Metric} />
/>
) : (
<StyledMetricOption metric={m} showType />
)}
</LabelContainer> </LabelContainer>
))} ))}
{lists?.metrics?.length > DEFAULT_MAX_METRICS_LENGTH ? ( {lists?.metrics?.length > DEFAULT_MAX_METRICS_LENGTH ? (
@ -454,14 +440,10 @@ export default function DataSourcePanel({
key={col.column_name + String(shouldForceUpdate)} key={col.column_name + String(shouldForceUpdate)}
className="column" className="column"
> >
{enableExploreDnd ? ( <DatasourcePanelDragOption
<DatasourcePanelDragOption value={col as DndItemValue}
value={col as DndItemValue} type={DndItemType.Column}
type={DndItemType.Column} />
/>
) : (
<StyledColumnOption column={col as ColumnMeta} showType />
)}
</LabelContainer> </LabelContainer>
))} ))}
{lists.columns.length > DEFAULT_MAX_COLUMNS_LENGTH ? ( {lists.columns.length > DEFAULT_MAX_COLUMNS_LENGTH ? (

View File

@ -123,7 +123,7 @@ const renderWithRouter = ({
<ExploreViewContainer /> <ExploreViewContainer />
</Route> </Route>
</MemoryRouter>, </MemoryRouter>,
{ useRedux: true, initialState }, { useRedux: true, useDnd: true, initialState },
); );
}; };

View File

@ -16,7 +16,6 @@
* specific language governing permissions and limitations * specific language governing permissions and limitations
* under the License. * under the License.
*/ */
import { FeatureFlag } from '@superset-ui/core';
import React from 'react'; import React from 'react';
import { render, screen } from 'spec/helpers/testing-library'; import { render, screen } from 'spec/helpers/testing-library';
import { import {
@ -32,14 +31,6 @@ const defaultProps: DndColumnSelectProps = {
actions: { setControlValue: jest.fn() }, actions: { setControlValue: jest.fn() },
}; };
beforeAll(() => {
window.featureFlags = { [FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP]: true };
});
afterAll(() => {
window.featureFlags = {};
});
test('renders with default props', async () => { test('renders with default props', async () => {
render(<DndColumnSelect {...defaultProps} />, { render(<DndColumnSelect {...defaultProps} />, {
useDnd: true, useDnd: true,

View File

@ -24,11 +24,7 @@ import {
t, t,
isAdhocColumn, isAdhocColumn,
} from '@superset-ui/core'; } from '@superset-ui/core';
import { import { ColumnMeta, isColumnMeta } from '@superset-ui/chart-controls';
ColumnMeta,
isColumnMeta,
withDndFallback,
} from '@superset-ui/chart-controls';
import { isEmpty } from 'lodash'; import { isEmpty } from 'lodash';
import DndSelectLabel from 'src/explore/components/controls/DndColumnSelectControl/DndSelectLabel'; import DndSelectLabel from 'src/explore/components/controls/DndColumnSelectControl/DndSelectLabel';
import OptionWrapper from 'src/explore/components/controls/DndColumnSelectControl/OptionWrapper'; 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 { DndItemType } from 'src/explore/components/DndItemType';
import ColumnSelectPopoverTrigger from './ColumnSelectPopoverTrigger'; import ColumnSelectPopoverTrigger from './ColumnSelectPopoverTrigger';
import { DndControlProps } from './types'; import { DndControlProps } from './types';
import SelectControl from '../SelectControl';
export type DndColumnSelectProps = DndControlProps<QueryFormColumn> & { export type DndColumnSelectProps = DndControlProps<QueryFormColumn> & {
options: ColumnMeta[]; options: ColumnMeta[];
@ -216,9 +211,4 @@ function DndColumnSelect(props: DndColumnSelectProps) {
); );
} }
const DndColumnSelectWithFallback = withDndFallback( export { DndColumnSelect };
DndColumnSelect,
SelectControl,
);
export { DndColumnSelectWithFallback as DndColumnSelect };

View File

@ -23,7 +23,6 @@ import configureStore from 'redux-mock-store';
import { import {
ensureIsArray, ensureIsArray,
FeatureFlag,
GenericDataType, GenericDataType,
QueryFormData, QueryFormData,
} from '@superset-ui/core'; } from '@superset-ui/core';
@ -58,14 +57,6 @@ const baseFormData = {
datasource: 'table__1', datasource: 'table__1',
}; };
beforeAll(() => {
window.featureFlags = { [FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP]: true };
});
afterAll(() => {
window.featureFlags = {};
});
const mockStore = configureStore([thunk]); const mockStore = configureStore([thunk]);
const store = mockStore({}); const store = mockStore({});

View File

@ -30,7 +30,6 @@ import {
ColumnMeta, ColumnMeta,
isColumnMeta, isColumnMeta,
isTemporalColumn, isTemporalColumn,
withDndFallback,
} from '@superset-ui/chart-controls'; } from '@superset-ui/chart-controls';
import Modal from 'src/components/Modal'; import Modal from 'src/components/Modal';
import { import {
@ -50,7 +49,6 @@ import {
} from 'src/explore/components/DatasourcePanel/types'; } from 'src/explore/components/DatasourcePanel/types';
import { DndItemType } from 'src/explore/components/DndItemType'; import { DndItemType } from 'src/explore/components/DndItemType';
import { ControlComponentProps } from 'src/explore/components/Control'; import { ControlComponentProps } from 'src/explore/components/Control';
import AdhocFilterControl from '../FilterControl/AdhocFilterControl';
import DndAdhocFilterOption from './DndAdhocFilterOption'; import DndAdhocFilterOption from './DndAdhocFilterOption';
import { useDefaultTimeFilter } from '../DateFilterControl/utils'; import { useDefaultTimeFilter } from '../DateFilterControl/utils';
import { CLAUSES, EXPRESSION_TYPES } from '../FilterControl/types'; import { CLAUSES, EXPRESSION_TYPES } from '../FilterControl/types';
@ -422,9 +420,4 @@ const DndFilterSelect = (props: DndFilterSelectProps) => {
); );
}; };
const DndFilterSelectWithFallback = withDndFallback( export { DndFilterSelect };
DndFilterSelect,
AdhocFilterControl,
);
export { DndFilterSelectWithFallback as DndFilterSelect };

View File

@ -18,7 +18,6 @@
*/ */
import React from 'react'; import React from 'react';
import userEvent from '@testing-library/user-event'; import userEvent from '@testing-library/user-event';
import { FeatureFlag } from '@superset-ui/core';
import { import {
render, render,
screen, screen,
@ -68,14 +67,6 @@ const adhocMetricB = {
optionName: 'def', optionName: 'def',
}; };
beforeAll(() => {
window.featureFlags = { [FeatureFlag.ENABLE_EXPLORE_DRAG_AND_DROP]: true };
});
afterAll(() => {
window.featureFlags = {};
});
test('renders with default props', () => { test('renders with default props', () => {
render(<DndMetricSelect {...defaultProps} />, { useDnd: true }); render(<DndMetricSelect {...defaultProps} />, { useDnd: true });
expect( expect(

View File

@ -28,7 +28,7 @@ import {
t, t,
tn, tn,
} from '@superset-ui/core'; } 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 AdhocMetric from 'src/explore/components/controls/MetricControl/AdhocMetric';
import AdhocMetricPopoverTrigger from 'src/explore/components/controls/MetricControl/AdhocMetricPopoverTrigger'; import AdhocMetricPopoverTrigger from 'src/explore/components/controls/MetricControl/AdhocMetricPopoverTrigger';
import MetricDefinitionValue from 'src/explore/components/controls/MetricControl/MetricDefinitionValue'; 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 DndSelectLabel from 'src/explore/components/controls/DndColumnSelectControl/DndSelectLabel';
import { savedMetricType } from 'src/explore/components/controls/MetricControl/types'; import { savedMetricType } from 'src/explore/components/controls/MetricControl/types';
import { AGGREGATES } from 'src/explore/constants'; import { AGGREGATES } from 'src/explore/constants';
import MetricsControl from '../MetricControl/MetricsControl';
const EMPTY_OBJECT = {}; const EMPTY_OBJECT = {};
const DND_ACCEPTED_TYPES = [DndItemType.Column, DndItemType.Metric]; const DND_ACCEPTED_TYPES = [DndItemType.Column, DndItemType.Metric];
@ -364,9 +363,4 @@ const DndMetricSelect = (props: any) => {
); );
}; };
const DndMetricSelectWithFallback = withDndFallback( export { DndMetricSelect };
DndMetricSelect,
MetricsControl,
);
export { DndMetricSelectWithFallback as DndMetricSelect };

View File

@ -453,7 +453,6 @@ DEFAULT_FEATURE_FLAGS: dict[str, bool] = {
# Enables Alerts and reports new implementation # Enables Alerts and reports new implementation
"ALERT_REPORTS": False, "ALERT_REPORTS": False,
"DASHBOARD_RBAC": False, "DASHBOARD_RBAC": False,
"ENABLE_EXPLORE_DRAG_AND_DROP": True, # deprecated
"ENABLE_ADVANCED_DATA_TYPES": False, "ENABLE_ADVANCED_DATA_TYPES": False,
# Enabling ALERTS_ATTACH_REPORTS, the system sends email and slack message # Enabling ALERTS_ATTACH_REPORTS, the system sends email and slack message
# with screenshot and link # with screenshot and link