-
Notifications
You must be signed in to change notification settings - Fork 3
Refactor drs individual overview #502
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
base: master
Are you sure you want to change the base?
Conversation
davidlougheed
left a comment
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.
first pass
davidlougheed
left a comment
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.
looking better than before! I think there's more work to be done here to eliminate duplicate code though, especially with experiments result extraction and DRS URL fetching.
|
|
||
| useEffect(() => { | ||
| if (viewableExperimentResultsForIgv.length > 0) { | ||
| dispatch(getIgvUrlsFromDrs(viewableExperimentResultsForIgv)).catch(console.error); |
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 pretty sure this action + getFileDownloadUrlsFromDrs basically do the same thing, and so can be combined (both in action and state, by just creating a single state object called urlsByFilename)
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 effect can also do everything useIndividualIgvViewableExperimentResults does instead of having a different hook, since useIndividualIgvViewableExperimentResults return value is only used 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 way, experiments don't have to be extracted twice from the biosamples data.
|
|
||
| export const explorerIndividualUrl = (individualID) => `/data/explorer/individuals/${individualID}`; | ||
|
|
||
| export const useIndividualIgvViewableExperimentResults = (individual) => { |
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 only used once, so this could be put in the useEffect I commented on above
Centralizes drs fetches in ExplorerIndividualContent, adds utils.js hook for IGV-viewable files; parent dispatches all downloads and IGV subset once; removes child dispatches