fix: Revert shared controls typing change. (#22014)

This commit is contained in:
Cody Leff 2022-11-02 21:58:38 -06:00 committed by GitHub
parent ba65f66897
commit 4cbd70db34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -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;

View File

@ -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],