codyml opened a new pull request, #20498:
URL: https://github.com/apache/superset/pull/20498

   <!---
   Please write the PR title following the conventions at 
https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   When a user saves a chart in Explore, the client sends one `POST /explore` 
request, then the server creates/updates the chart and optionally adds it to a 
new/existing dashboard as indicated.  This PR updates Explore's `SaveModal` to 
instead use v1 API endpoints to accomplish the same.  Here's the updated 
sequence of API calls:
   - If user is creating a new dashboard: `POST /api/v1/dashboard/`
   - If user is adding to a new dashboard: `PUT 
/api/v1/dashboard/{dashboard_id}`
   - If user is saving as a new chart: `POST /api/v1/chart/`
     - If adding to new/existing dashboard: `{ dashboards: [..., dashboard_id] 
}`
   - If user is overwriting an existing chart: `PUT /api/v1/chart/{chart_id}`
     - If adding to new/existing dashboard: `{ dashboards: [..., dashboardId] }`
   
   **Notes:**
   - Currently a save is always followed by a full page reload, so Redux state 
is recreated from scratch.  Once Explore is in the SPA, we may need to manually 
update Redux state with new objects returned from API calls.
   
   **Issues still to be resolved:**
   - [ ] Fix broken Cypress test
   - [ ] Add new Jest tests to replace outdated ones removed
     - [ ] Include tests for possible API errors
   - [ ] Questionable change to page reload logic after successful save
   - [ ] Fix toasts: they're currently generated server-side and appear on the 
next page load, but when generated client-side they don't work because Explore 
isn't in the SPA
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   Try performing the following tasks with and without proposed update and 
ensure that interface and user experience are identical:
   - Create new chart from scratch, save as new chart, don't add to dashboard
   - Create new chart from scratch, save as new chart, add to existing dashboard
   - Create new chart from scratch, save as new chart, add to new dashboard
   - Edit existing chart, overwrite existing chart, don't add to dashboard
   - Edit existing chart, overwrite existing chart, add to existing dashboard
   - Edit existing chart, overwrite existing chart, add to new dashboard
   - Edit existing chart, save as new chart, don't add to dashboard
   - Edit existing chart, save as new chart, add to existing dashboard
   - Edit existing chart, save as new chart, add to new dashboard
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


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