You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/12/21 19:05:45 UTC

[GitHub] [incubator-superset] michael-s-molina commented on pull request #11997: refactor: Explore SaveModal to typescript

michael-s-molina commented on pull request #11997:
URL: https://github.com/apache/incubator-superset/pull/11997#issuecomment-749143062


   @etr2460 @maloun96 
   
   This change in `saveModalActions.js`:
   
    ```
   return SupersetClient.post({ url, postPayload: { form_data: formData } })
         .then(response => {
           dispatch(saveSliceSuccess(response.json));
           return response;
         })
         .catch(() => dispatch(saveSliceFailed()));
   ```
   
   broke this code in `SaveModal.tsx`:
   
    ```
   this.props.actions
         .saveSlice(this.props.form_data, sliceParams)
         .then(({ data }: JsonObject) => { // HERE WE ARE EXPECTING AN OBJECT WITH DATA PROP BUT GOT RESPONSE
           if (data.dashboard_id === null) {
             sessionStorage.removeItem(SK_DASHBOARD_ID);
           } else {
             sessionStorage.setItem(SK_DASHBOARD_ID, data.dashboard_id);
           }
           // Go to new slice url or dashboard url
           const url = gotodash ? data.dashboard_url : data.slice.slice_url;
           window.location.assign(url);
         });
   ```
   
   That's why Cypress test `explore/link.test.js` is failing. 
   
   This was a nice contribution. One step closer to full typescript! :smiley:
   
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org