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 fcb19e702d85f..c2ec315274d8a 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/types.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/src/types.ts @@ -242,7 +242,7 @@ export interface BaseControlConfig< ) => boolean; mapStateToProps?: ( state: ControlPanelState, - controlState?: ControlState, + controlState: ControlState, // TODO: add strict `chartState` typing (see superset-frontend/src/explore/types) chartState?: AnyDict, ) => ExtraControlProps; diff --git a/superset-frontend/plugins/legacy-plugin-chart-histogram/src/controlPanel.ts b/superset-frontend/plugins/legacy-plugin-chart-histogram/src/controlPanel.ts index d976b16bd2420..08e315ba4058c 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-histogram/src/controlPanel.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-histogram/src/controlPanel.ts @@ -25,14 +25,15 @@ import { sections, getStandardizedControls, sharedControls, + ControlState, } from '@superset-ui/chart-controls'; const columnsConfig = { ...sharedControls.columns, label: t('Columns'), description: t('Select the numeric columns to draw the histogram'), - mapStateToProps: (state: ControlPanelState) => ({ - ...(sharedControls.columns.mapStateToProps?.(state) || {}), + mapStateToProps: (state: ControlPanelState, controlState: ControlState) => ({ + ...(sharedControls.columns.mapStateToProps?.(state, controlState) || {}), choices: columnChoices(state.datasource), }), validators: [validateNonEmpty],