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

   ### SUMMARY
   Follow-up to #39386. That PR added a guard in `exportPivotExcel` 
(`superset-frontend/src/utils/downloadAsPivotExcel.ts`) for when the pivot 
table element can't be found in the DOM (e.g. it was unmounted mid-export), but 
the guard only logs to the console and returns, giving the user zero feedback 
that their download didn't happen. CodeAnt flagged this on #39386 itself after 
merge (major/incomplete-implementation).
   
   The two sibling download utilities in the same directory, `downloadAsPdf.ts` 
and `downloadAsImage.tsx`, already handle their equivalent missing-element case 
by showing `addWarningToast(...)` in addition to logging. This PR brings 
`downloadAsPivotExcel.ts` in line with that existing convention, nothing else 
in `src/utils/download*.ts` needed the same fix.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   N/A, this only affects the rare failure path (table missing from the DOM at 
export time); no visual change to the normal export flow.
   
   ### TESTING INSTRUCTIONS
   ```
   npx jest superset-frontend/src/utils/downloadAsPivotExcel.test.ts
   ```
   The updated "table element is not found" test now also asserts 
`addWarningToast` fires with the same message wording used by 
`downloadAsPdf`/`downloadAsImage`.
   
   Manual: in Explore or a dashboard, trigger "Download as Excel" on a pivot 
table chart while the table is momentarily unmounted (e.g. mid-rerender); a 
warning toast should now appear instead of the download silently failing.
   
   ### ADDITIONAL INFORMATION
   - [ ] 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