mirror of
https://github.com/apache/superset.git
synced 2026-06-09 09:39:25 +00:00
chore(chart-controls): improve typing for mapStateToProps (#1171)
This commit is contained in:
committed by
Yongjie Zhao
parent
72ac9ab0ef
commit
11a52ea0fc
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user