rusackas commented on code in PR #32958:
URL: https://github.com/apache/superset/pull/32958#discussion_r3717346381
##########
superset-frontend/src/dashboard/reducers/dashboardState.ts:
##########
@@ -258,11 +258,7 @@ export default function dashboardStateReducer(
const updatedExpandedSlices = { ...state.expandedSlices };
const { sliceId } = action;
if (sliceId !== undefined) {
- if (updatedExpandedSlices[sliceId]) {
- delete updatedExpandedSlices[sliceId];
- } else {
- updatedExpandedSlices[sliceId] = true;
- }
+ updatedExpandedSlices[sliceId] = !updatedExpandedSlices[sliceId];
Review Comment:
Fixed, TOGGLE_EXPAND_SLICE now falls back to expandAllSlices before negating
so the first click actually collapses it.
##########
tests/integration_tests/dashboards/api_tests.py:
##########
@@ -84,7 +84,7 @@ class TestDashboardApi(ApiOwnersTestCaseMixin,
InsertChartMixin, SupersetTestCas
"description": "desc_changed",
"position_json": '{"b": "B"}',
"css": "css_changed",
- "json_metadata": '{"refresh_frequency": 30,
"timed_refresh_immune_slices": [], "expanded_slices": {}, "color_scheme": "",
"label_colors": {}, "shared_label_colors": [], "map_label_colors": {},
"color_scheme_domain": [], "cross_filters_enabled": false}', # noqa: E501
+ "json_metadata": '{"refresh_frequency": 30,
"timed_refresh_immune_slices": [], "expanded_slices": {}, "expand_all_slices":
False, "color_scheme": "", "label_colors": {}, "shared_label_colors": [],
"map_label_colors": {}, "color_scheme_domain": [], "cross_filters_enabled":
false}', # noqa: E501
Review Comment:
Good catch, that was actually invalid JSON (a bare Python False instead of
false). Fixed.
--
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]