Skip to content
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

Fix plots tab related data loading on initial study view load #4958

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gblaih
Copy link
Contributor

@gblaih gblaih commented Aug 1, 2024

Copy link

netlify bot commented Aug 1, 2024

Deploy Preview for cbioportalfrontend ready!

Name Link
🔨 Latest commit 20a161a
🔍 Latest deploy log https://app.netlify.com/sites/cbioportalfrontend/deploys/66c659cbdcf03b000853b9bb
😎 Deploy Preview https://deploy-preview-4958--cbioportalfrontend.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -3750,7 +3754,7 @@ export default class PlotsTab extends React.Component<IPlotsTabProps, {}> {
options = options.filter(stringCompare).slice(0, 10);
const genes = await fetchGenes(options.map(o => o.label));
const coverageInformationPromise = getCoverageInformation(
this.props.genePanelDataForAllProfiles!,
this.props.genePanelDataForAllProfiles?.result || [],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make sure that we're awaiting result properly and then use ! to assert it isntead of ?. in other words, using ? implies that we aren't sure it's loaded yet, and we should be sure.

this.props.hugoGeneSymbols,
Array.isArray(this.props.hugoGeneSymbols)
? this.props.hugoGeneSymbols
: this.props.hugoGeneSymbols.result,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems strange. i guess this is due to fact that it's used differently in different places. but there should be a better way to handle this.

Copy link
Collaborator

@alisman alisman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets see if there's a nicer way to handle some of the conditionality here.

}
hugoGeneSymbols={
allHugoGeneSymbols={
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Bryan, sorry it took me SO long to respond. This is quite confusing to have a property hugeGeneSymbols AND allHugeGeneSymbols. Lets think if there's some better we can handle this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The basic problem is that we need to wait for the gene symbols to load but we only want to do that when the tab is actually showing. We can handle that more elegantly with some kind of loading wrapper. Maybe we can do a pair programming session and figure it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants