diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/types.ts b/superset-frontend/packages/superset-ui-chart-controls/src/types.ts index 73985bfc743b9..6434026d00cdd 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/types.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/src/types.ts @@ -341,7 +341,7 @@ export interface ControlPanelSectionConfig { } export interface ControlPanelConfig { - controlPanelSections: ControlPanelSectionConfig[]; + controlPanelSections: (ControlPanelSectionConfig | null)[]; controlOverrides?: ControlOverrides; sectionOverrides?: SectionOverrides; onInit?: (state: ControlStateMapping) => void; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx index 80920af06dabb..e39c023661696 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx @@ -278,6 +278,13 @@ function createAdvancedAnalyticsSection( const config: ControlPanelConfig = { controlPanelSections: [ sections.legacyTimeseriesTime, + isFeatureEnabled(FeatureFlag.GENERIC_CHART_AXES) + ? { + label: t('Shared query fields'), + expanded: true, + controlSetRows: [[xAxisControl]], + } + : null, createQuerySection(t('Query A'), ''), createAdvancedAnalyticsSection(t('Advanced analytics Query A'), ''), createQuerySection(t('Query B'), '_b'), @@ -447,12 +454,4 @@ const config: ControlPanelConfig = { ], }; -if (isFeatureEnabled(FeatureFlag.GENERIC_CHART_AXES)) { - config.controlPanelSections.splice(1, 0, { - label: t('Shared query fields'), - expanded: true, - controlSetRows: [[xAxisControl]], - }); -} - export default config;