Vovch commented on code in PR #28312:
URL: https://github.com/apache/superset/pull/28312#discussion_r1603518891


##########
superset-frontend/src/explore/reducers/exploreReducer.js:
##########
@@ -245,6 +246,30 @@ export default function exploreReducer(state = {}, action) 
{
         can_overwrite: action.can_overwrite,
       };
     },
+    [actions.SET_STASH_FORM_DATA]() {
+      const { form_data, hiddenFormData } = state;
+      const { fieldNames, isHidden } = action;
+      if (isHidden) {
+        return {
+          ...state,
+          hiddenFormData: {
+            ...hiddenFormData,
+            ...pick(form_data, fieldNames),
+          },
+          form_data: omit(form_data, fieldNames),
+        };
+      }
+
+      const restoredField = pick(hiddenFormData, fieldNames);
+      return {
+        ...state,
+        form_data: {
+          ...form_data,
+          ...restoredField,
+        },
+        hiddenFormData,

Review Comment:
   A bit too late, but I guess there should be `omit(hiddenFormData, 
fieldNames)`, otherwise it seems to break any field that was hidden once.



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