mirror of
https://github.com/apache/superset.git
synced 2026-04-15 22:25:15 +00:00
refactor: Removes the deprecated ENABLE_EXPLORE_DRAG_AND_DROP feature flag (#26343)
This commit is contained in:
committed by
GitHub
parent
b2ad74f94f
commit
6063f4ff04
@@ -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 => <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 = {
|
||||
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,
|
||||
};
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user