deepujain commented on code in PR #44559:
URL: https://github.com/apache/superset/pull/44559#discussion_r4080111325
##########
superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/sharedControls.tsx:
##########
@@ -519,4 +519,10 @@ const sharedControls: Record<string,
SharedControlConfig<any>> = {
...matrixifyControls,
};
+type RegisteredControl = (typeof controlConfigs)[keyof typeof controlConfigs];
+
+// Each control retains the option type accepted by its renderer.
+const sharedControls: typeof controlConfigs &
+ Record<string, RegisteredControl> = controlConfigs;
Review Comment:
Follow-up: CI lint-frontend disproved both the suggestion and my earlier
reply. A TS object spread does not propagate an index signature into the
inferred object type, so dropping the intersection collapsed keyof typeof
sharedControls from string to the literal key union and broke
SharedControlAlias assignments in matrixify.tsx sections. Restored the typeof
controlConfigs and Record<string, RegisteredControl> intersection in 871b9e6a,
which keeps per-control option types and the string key space.
--
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]