Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: restructure shared-contrls modules #22224

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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