Skip to content

Commit

Permalink
chore(chart-controls): improve typing for mapStateToProps (apache#1171)
Browse files Browse the repository at this point in the history
  • Loading branch information
kgabryje authored and zhaoyongjie committed Nov 24, 2021
1 parent 1c4b2ae commit 1b772ea
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export interface BaseControlConfig<
*/
mapStateToProps?: (
state: ControlPanelState,
controlState: this & ExtraControlProps,
controlState: ControlState,
// TODO: add strict `chartState` typing (see superset-frontend/src/explore/types)
chartState?: AnyDict,
) => ExtraControlProps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ const config: ControlPanelConfig = {
mapStateToProps: (state: ControlPanelState, controlState: ControlState) => {
const { controls } = state;
const originalMapStateToProps = sharedControls?.groupby?.mapStateToProps;
// @ts-ignore
const newState = originalMapStateToProps?.(state, controlState) ?? {};
newState.externalValidationErrors = validateAggControlValues(controls, [
controls.metrics?.value,
Expand Down

0 comments on commit 1b772ea

Please sign in to comment.