betodealmeida opened a new pull request #15107:
URL: https://github.com/apache/superset/pull/15107


   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   
   Show a spinner while an export is being generated.
   
   This is tricky because when the user clicks "export" we immediately redirect 
them to `/api/v1/database/export/?q=${rison.encode([database.id])}` using 
`window.assign`. So while we can set a spinner, we don't know when the download 
is generated to stop the spinner.
   
   In order to stop the spinner the frontend generates a short ID, which is 
passed to the backend with the export request. Once the export is ready, the 
backend will set a cookie with the short ID as name. The frontend is constantly 
polling for that cookie, and when it finds the cookie it hides the spinner.
   
   The one problem with this solution is that the GIF stops animating while the 
export is being generated due to browser limitations. I'm not sure if we can 
overcome this.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   Before, no spinner.
   
   After:
   
   
   
https://user-images.githubusercontent.com/1534870/121611606-7dddb700-ca0d-11eb-9e2f-6a555d81b06f.mov
   
   
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] 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.

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