gabotorresruiz commented on code in PR #43805:
URL: https://github.com/apache/superset/pull/43805#discussion_r3960705410
##########
superset-frontend/src/dashboard/components/menu/DownloadMenuItems/index.tsx:
##########
@@ -167,6 +211,75 @@ export const useDownloadMenuItems = (
}
};
+ const pollExportStatus = (jobId: string, pollState: ExportPollState) => {
+ if (unmountedRef.current) {
+ return;
+ }
+ SupersetClient.get({
+ endpoint: `/api/v1/dashboard/export_xlsx/status/${jobId}/`,
+ })
+ .then(({ json }) => {
+ // A response in flight when the component unmounts must not navigate
+ // (redirect) or toast on whatever page the user moved to.
+ if (unmountedRef.current) {
+ return;
+ }
+ const {
+ status,
+ download_url: downloadUrl,
+ message,
+ } = json as ExportStatusResponse;
+ if (status === 'ready') {
+ if (downloadUrl) {
+ redirect(downloadUrl);
Review Comment:
Agreed, that navigation was a bad ending for an embedded guest. Changed in
b80a6e02dd: the file is now fetched and saved through an anchor (same pattern
Export as Example already uses in this file), so a dead link just shows a
retryable error toast and the dashboard stays put. Added a jest test for that
path.
--
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]