zhaoyongjie commented on code in PR #21163:
URL: https://github.com/apache/superset/pull/21163#discussion_r961259026
##########
superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/index.tsx:
##########
@@ -323,6 +325,21 @@ const time_grain_sqla:
SharedControlConfig<'SelectControl'> = {
mapStateToProps: ({ datasource }) => ({
choices: (datasource as Dataset)?.time_grain_sqla || null,
}),
+ visibility: ({ controls }) => {
+ if (!isFeatureEnabled(FeatureFlag.GENERIC_CHART_AXES)) {
+ return true;
+ }
+
+ const xAxisValue = controls?.x_axis?.value;
Review Comment:
imo, avoiding redundant local variables is for performance and readability,
performance refers to every variable needed to create memory space, and
readability refers to the **one-time** intermediate variables that do not bring
benefits but add cognitive load.
--
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]