rusackas opened a new pull request, #44154: URL: https://github.com/apache/superset/pull/44154
### SUMMARY Follow-up to #44031. @gabotorresruiz pointed out that `downloadAsPdf.ts` and `downloadAsImage.tsx` have the same bug that PR fixed for `downloadAsPivotExcel.ts`: both import the raw `addWarningToast` action creator from `actions.ts` and call it directly, but without a dispatch that only builds a plain Redux action object and never actually renders anything. So a failed PDF/image export was failing silently. Same fix here: both now take an optional trailing `addWarningToast` callback instead of importing the raw creator, and every call site threads through an already-bound callback from `useToasts()`/`bindActionCreators`, mirroring what the merged PR already did for `downloadAsPivotExcel`. ### TESTING INSTRUCTIONS Added tests for `downloadAsPdf` and `downloadAsImage` mirroring the ones `downloadAsPivotExcel.test.ts` added: assert the bound callback is called with the right message when the target element is missing, and that nothing throws when no callback is passed. To see it manually: trigger a PDF or image export (dashboard chart menu, or Explore's export screenshot menu) against a selector that can't resolve to an element. Before this, nothing happened. After, a warning toast shows up. ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: - [x] 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]
