Skip to content

Commit

Permalink
fix type and add null to test fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro committed May 20, 2022
1 parent b7cab89 commit cd9d795
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,10 @@ export const getControlConfig = function getControlConfig(
vizType: string,
) {
const controlPanelConfig = getChartControlPanelRegistry().get(vizType) || {};
return getMemoizedControlConfig(controlKey, controlPanelConfig);
return getMemoizedControlConfig(
controlKey,
// TODO: the ChartControlPanelRegistry is incorrectly typed and needs to
// be fixed
controlPanelConfig as ControlPanelConfig,
);
};
78 changes: 40 additions & 38 deletions superset-frontend/src/explore/fixtures.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,47 +26,49 @@ import {
ControlPanelSectionConfig,
} from '@superset-ui/chart-controls';

export const controlPanelSectionsChartOptions: ControlPanelSectionConfig[] = [
{
label: t('Chart Options'),
expanded: true,
controlSetRows: [
[
'color_scheme',
{
name: 'rose_area_proportion',
config: {
type: 'CheckboxControl',
label: t('Use Area Proportions'),
description: t(
'Check if the Rose Chart should use segment area instead of ' +
'segment radius for proportioning',
),
default: false,
renderTrigger: true,
export const controlPanelSectionsChartOptions: (ControlPanelSectionConfig | null)[] =
[
null,
{
label: t('Chart Options'),
expanded: true,
controlSetRows: [
[
'color_scheme',
{
name: 'rose_area_proportion',
config: {
type: 'CheckboxControl',
label: t('Use Area Proportions'),
description: t(
'Check if the Rose Chart should use segment area instead of ' +
'segment radius for proportioning',
),
default: false,
renderTrigger: true,
},
},
},
],
[
{
name: 'stacked_style',
config: {
type: 'SelectControl',
label: t('Stacked Style'),
renderTrigger: true,
choices: [
['stack', 'stack'],
['stream', 'stream'],
['expand', 'expand'],
],
default: 'stack',
description: '',
],
[
{
name: 'stacked_style',
config: {
type: 'SelectControl',
label: t('Stacked Style'),
renderTrigger: true,
choices: [
['stack', 'stack'],
['stream', 'stream'],
['expand', 'expand'],
],
default: 'stack',
description: '',
},
},
},
],
],
],
},
];
},
];

export const controlPanelSectionsChartOptionsOnlyColorScheme: ControlPanelSectionConfig[] =
[
Expand Down

0 comments on commit cd9d795

Please sign in to comment.