rusackas commented on code in PR #32958:
URL: https://github.com/apache/superset/pull/32958#discussion_r3717345103


##########
superset/dashboards/schemas.py:
##########
@@ -197,6 +197,7 @@ class DashboardJSONMetadataSchema(Schema):
     # deprecated wrt dashboard-native filters
     filter_scopes = fields.Dict()
     expanded_slices = fields.Dict()
+    expand_all_slices = fields.Boolean()

Review Comment:
   validate_json_metadata only validates the incoming JSON against the schema, 
it doesn't use the coerced result, so this is true for every boolean field in 
here, not just this one. Bigger fix than this PR should take on.



##########
superset/dashboards/schemas.py:
##########
@@ -196,6 +196,7 @@ class DashboardJSONMetadataSchema(Schema):
     # deprecated wrt dashboard-native filters
     filter_scopes = fields.Dict()
     expanded_slices = fields.Dict()
+    expand_all_slices = fields.Boolean()

Review Comment:
   None of the other fields in this schema have type annotations either, 
matching the existing style here.



##########
superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.tsx:
##########
@@ -207,7 +207,10 @@ const Chart = (props: ChartProps) => {
   );
   const isExpanded = useSelector(
     (state: RootState) =>
-      !!(state.dashboardState as JsonObject).expandedSlices?.[props.id],
+      !!(
+        (state.dashboardState as JsonObject).expandedSlices?.[props.id] ??
+        (state.dashboardState as JsonObject).expandAllSlices
+      ),

Review Comment:
   Good catch. Fixed the toggle in the reducer so it flips the effective state 
(per-slice override falling back to expandAllSlices) instead of just the raw 
override.



-- 
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]

Reply via email to