Skip to content

Commit

Permalink
refactor: restructure shared-contrls modules
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyongjie committed Nov 25, 2022
1 parent 1831e8c commit 10eed70
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 10eed70

Please sign in to comment.