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 25, 2021
1 parent 5593887 commit 6f47277
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 6f47277

Please sign in to comment.