-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Download table data #848
Download table data #848
Conversation
...components/table-controls/components/table-actions/components/download-data/DownloadData.tsx
Outdated
Show resolved
Hide resolved
src/content/app/tools/blast/blast-download/submissionDownload.ts
Outdated
Show resolved
Hide resolved
...t/views/blast-submission-results/components/single-blast-job-result/SingleBlastJobResult.tsx
Outdated
Show resolved
Hide resolved
...components/table-controls/components/table-actions/components/download-data/DownloadData.tsx
Outdated
Show resolved
Hide resolved
...t/views/blast-submission-results/components/single-blast-job-result/SingleBlastJobResult.tsx
Outdated
Show resolved
Hide resolved
...components/table-controls/components/table-actions/components/download-data/DownloadData.tsx
Outdated
Show resolved
Hide resolved
...components/table-controls/components/table-actions/components/download-data/DownloadData.tsx
Outdated
Show resolved
Hide resolved
...components/table-controls/components/table-actions/components/download-data/DownloadData.tsx
Outdated
Show resolved
Hide resolved
...components/table-controls/components/table-actions/components/download-data/DownloadData.tsx
Outdated
Show resolved
Hide resolved
...components/table-controls/components/table-actions/components/download-data/DownloadData.tsx
Outdated
Show resolved
Hide resolved
...components/table-controls/components/table-actions/components/download-data/DownloadData.tsx
Show resolved
Hide resolved
Reviewed the PR again and haven't got much to add |
}) | ||
: cell; | ||
|
||
dataForExport[rowIndex + 1].push(getReactNodeText(cellExportData)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you want to check here if cellExportData
is a primitive (string / number), in which case you could push it into dataForExport
directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's done. Previously it was getting checked inside getReactNodeText
but not since we updated it.
}); | ||
} | ||
}, 1000); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, we messed up. There is now a second's delay when you click on "Cancel", which shouldn't be there.
Screen.Recording.2022-10-13.at.08.29.39.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is now fixed.
return ( | ||
<div className={styles.downloadData}> | ||
<span>{downloadFileName ?? 'table.csv'}</span> | ||
<LoadingButton onClick={handleDownload}>Download</LoadingButton> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is super minor, but since all data is already on the client, the download completes before the spinner stops:
Screen.Recording.2022-10-13.at.08.47.54.mov
It can be addressed by changing from LoadingButton to ControlledLoadingButton, and driving the state of that button from the DownloadData
component. Or we can ignore this for now, and see how #841 pans out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have addressed this issue in the latest commit.
The downloaded table isn't default-sorted (by e-value). Is this correct? @ens-st3 ? |
This is because I used |
setTimeout(restoreDefaults, 1000); | ||
} catch { | ||
setDownloadState(LoadingState.ERROR); | ||
setTimeout(() => setDownloadState(LoadingState.NOT_REQUESTED), 2000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should probably also check for allowComponentResetRef.current
in the callback to this setTimeout function. You are changing component's state here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's done
setTimeout(() => setDownloadState(LoadingState.NOT_REQUESTED), 2000); | ||
} | ||
|
||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is unnecessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not returning within the try block so this return here is required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry, didn't see where the function ends 🙂
Description
The DataTable can either handle the download by itself by generating a csv or it can give the control over to the parent component using the
downloadHandler
prop.Related JIRA Issue(s)
https://www.ebi.ac.uk/panda/jira/browse/ENSWBSITES-1736
Deployment URL(s)
http://datatable-export.review.ensembl.org