-
Notifications
You must be signed in to change notification settings - Fork 317
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 comparison mutations tab not loading when no mutations selected #5090
Fix comparison mutations tab not loading when no mutations selected #5090
Conversation
✅ Deploy Preview for cbioportalfrontend ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
f81db03
to
a21cb61
Compare
if (mutationMapperStore) { | ||
return ( | ||
<div | ||
data-test="ComparisonPageMutationsTabPlot" | ||
style={{ marginTop: 20 }} | ||
> | ||
<h3> | ||
{this.props.store.activeMutationMapperGene | ||
?.hugoGeneSymbol + | ||
{this.props.store.activeMutationMapperGene! |
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.
maybe better to combine the condition at 160 with the condition at 155. then you wouldn't have to do this assertion.
@@ -55,8 +56,8 @@ export default class GroupComparisonMutationsTab extends React.Component< | |||
let activeTabId; | |||
if (this.props.store.userSelectedMutationMapperGene) { | |||
activeTabId = this.props.store.userSelectedMutationMapperGene; | |||
} else { | |||
activeTabId = this.props.store.activeMutationMapperGene! | |||
} else if (this.props.store.activeMutationMapperGene) { |
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.
is it possible for actigeMutationMapperGene and userSelectedMutationMapperGene to differ?
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.
yes there is a scenario where the userSelectedMutationMapperGene is undefined. i just changed this though as they should really be the same
@@ -368,6 +368,9 @@ export default class GroupComparisonStore extends ComparisonStore { | |||
readonly mutations = remoteData({ | |||
await: () => [this.samples, this.mutationEnrichmentProfiles], | |||
invoke: async () => { | |||
if (!this.activeMutationMapperGene) { |
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 kind of awkward. ideally, we would never reference this if there wasn't an activeMutationMapperGene. that's the way our code should be constructed
this.activeMutationMapperGene! | ||
.hugoGeneSymbol, | ||
this.activeMutationMapperGene | ||
?.hugoGeneSymbol, |
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 think you want to assert that yes there is a hugoGeneSymbol!
What the ! means is that you the developer certify that there will be a hugoGeneSymbol. maybe add a condition above for the negative case.
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.
Looks great! Thank you!
347a675
to
2b30ec1
Compare
Fix cBioPortal/cbioportal#10499. Changed the logic such that genomic alterations tab selections, do not affect Mutations Tab
With selection like this on genomics alteration tab:
Mutations Tab still shows (previously it would throw an error):