aminghadersohi commented on code in PR #40804:
URL: https://github.com/apache/superset/pull/40804#discussion_r3382841242
##########
superset-frontend/plugins/preset-chart-deckgl/src/utilities/Shared_DeckGL.tsx:
##########
@@ -702,7 +775,7 @@ export const deckGLBreakpointMetric: CustomControlItem = {
// mapStateToProps: (state: ControlPanelState) => ({
// datasource: state.datasource,
// }),
- visibility: ({ controls }: { controls: any }) =>
+ visibility: ({ controls }: MapStyleVisibilityProps) =>
Review Comment:
`MapStyleVisibilityProps` makes `controls` optional (`controls?: {...}`),
but `isColorSchemeTypeVisible` at line 779 expects `ControlStateMapping`
(non-optional) — causes TS2345 in CI. Add a guard: `if (!controls) return
false;` before the call, or remove the `?` from `controls` in
`MapStyleVisibilityProps`.
##########
superset-frontend/plugins/preset-chart-deckgl/src/utilities/Shared_DeckGL.tsx:
##########
@@ -555,7 +628,7 @@ export const tooltipContents = {
),
ghostButtonText: t('Drop columns/metrics here or click'),
disabledTabs: new Set(['saved', 'sqlExpression']),
- mapStateToProps: (state: any) => {
+ mapStateToProps: (state: ControlPanelState) => {
Review Comment:
Changing `state: any` to `state: ControlPanelState` exposes a type error at
line 640: `datasource?.metrics` fails because `ControlPanelState.datasource` is
`Dataset | QueryResponse` and `QueryResponse` has no `metrics` property —
breaks `lint-frontend` and `validate-frontend` in CI. Fix with a type guard:
`savedMetrics: datasource && 'metrics' in datasource ? datasource.metrics : []`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]