Skip to content

Commit

Permalink
simplify control panel
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro committed May 18, 2022
1 parent 00755eb commit 60e7ba0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export interface ControlPanelSectionConfig {
}

export interface ControlPanelConfig {
controlPanelSections: ControlPanelSectionConfig[];
controlPanelSections: (ControlPanelSectionConfig | null)[];
controlOverrides?: ControlOverrides;
sectionOverrides?: SectionOverrides;
onInit?: (state: ControlStateMapping) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down Expand Up @@ -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;

0 comments on commit 60e7ba0

Please sign in to comment.