mirror of https://github.com/apache/superset.git
refactor: restructure shared-contrls modules (#22224)
This commit is contained in:
parent
1831e8c927
commit
b2fcdc56c1
|
@ -30,12 +30,6 @@ export * from './components/ColumnOption';
|
|||
export * from './components/ColumnTypeLabel/ColumnTypeLabel';
|
||||
export * from './components/MetricOption';
|
||||
|
||||
// React control components
|
||||
export { default as sharedControls, withDndFallback } from './shared-controls';
|
||||
export { default as sharedControlComponents } from './shared-controls/components';
|
||||
export { legacySortBy } from './shared-controls/legacySortBy';
|
||||
export * from './shared-controls/emitFilterControl';
|
||||
export * from './shared-controls/components';
|
||||
export * from './shared-controls';
|
||||
export * from './types';
|
||||
export * from './shared-controls/mixins';
|
||||
export * from './fixtures';
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
import { ContributionType, hasGenericChartAxes, t } from '@superset-ui/core';
|
||||
import { ControlPanelSectionConfig } from '../types';
|
||||
import { emitFilterControl } from '../shared-controls/emitFilterControl';
|
||||
import { emitFilterControl } from '../shared-controls';
|
||||
|
||||
export const echartsTimeSeriesQuery: ControlPanelSectionConfig = {
|
||||
label: t('Query'),
|
||||
|
|
|
@ -19,9 +19,9 @@
|
|||
|
||||
import { FeatureFlag, isFeatureEnabled, t } from '@superset-ui/core';
|
||||
|
||||
const enableCrossFilter = isFeatureEnabled(FeatureFlag.DASHBOARD_CROSS_FILTERS);
|
||||
|
||||
export const emitFilterControl = enableCrossFilter
|
||||
export const emitFilterControl = isFeatureEnabled(
|
||||
FeatureFlag.DASHBOARD_CROSS_FILTERS,
|
||||
)
|
||||
? [
|
||||
{
|
||||
name: 'emit_filter',
|
|
@ -16,22 +16,10 @@
|
|||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
import { t } from '@superset-ui/core';
|
||||
import { ControlSetRow } from '../types';
|
||||
|
||||
export const legacySortBy: ControlSetRow[] = [
|
||||
['legacy_order_by'],
|
||||
[
|
||||
{
|
||||
name: 'order_desc',
|
||||
config: {
|
||||
type: 'CheckboxControl',
|
||||
label: t('Sort descending'),
|
||||
default: true,
|
||||
description: t(
|
||||
'Whether to sort descending or ascending. Takes effect only when "Sort by" is set',
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
];
|
||||
export { default as sharedControls } from './sharedControls';
|
||||
export { withDndFallback } from './dndControls';
|
||||
// React control components
|
||||
export { default as sharedControlComponents } from './components';
|
||||
export * from './components';
|
||||
export * from './customControls';
|
||||
export * from './mixins';
|
|
@ -30,8 +30,7 @@ import type {
|
|||
QueryFormMetric,
|
||||
QueryResponse,
|
||||
} from '@superset-ui/core';
|
||||
import sharedControls from './shared-controls';
|
||||
import sharedControlComponents from './shared-controls/components';
|
||||
import { sharedControls, sharedControlComponents } from './shared-controls';
|
||||
|
||||
export type { Metric } from '@superset-ui/core';
|
||||
export type { ControlFormItemSpec } from './components/ControlForm';
|
||||
|
|
|
@ -17,8 +17,7 @@
|
|||
* under the License.
|
||||
*/
|
||||
import React, { ReactElement } from 'react';
|
||||
import sharedControls from '../shared-controls';
|
||||
import sharedControlComponents from '../shared-controls/components';
|
||||
import { sharedControls, sharedControlComponents } from '../shared-controls';
|
||||
import {
|
||||
ControlType,
|
||||
ControlSetItem,
|
||||
|
|
Loading…
Reference in New Issue