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 comparison mutations tab not loading when no mutations selected #5090

Merged

Conversation

gblaih
Copy link
Contributor

@gblaih gblaih commented Jan 23, 2025

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:
image

Mutations Tab still shows (previously it would throw an error):
image

@gblaih gblaih added the bug label Jan 23, 2025
Copy link

netlify bot commented Jan 23, 2025

Deploy Preview for cbioportalfrontend ready!

Name Link
🔨 Latest commit 2b30ec1
🔍 Latest deploy log https://app.netlify.com/sites/cbioportalfrontend/deploys/67a27f8f97d1b10008d2231c
😎 Deploy Preview https://deploy-preview-5090.preview.cbioportal.org
📱 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.

@gblaih gblaih force-pushed the comparison-mutations-none-selected-error branch from f81db03 to a21cb61 Compare January 23, 2025 20:27
if (mutationMapperStore) {
return (
<div
data-test="ComparisonPageMutationsTabPlot"
style={{ marginTop: 20 }}
>
<h3>
{this.props.store.activeMutationMapperGene
?.hugoGeneSymbol +
{this.props.store.activeMutationMapperGene!
Copy link
Collaborator

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) {
Copy link
Collaborator

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?

Copy link
Contributor Author

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) {
Copy link
Collaborator

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,
Copy link
Collaborator

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.

Copy link
Member

@inodb inodb left a 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!

@alisman alisman force-pushed the comparison-mutations-none-selected-error branch from 347a675 to 2b30ec1 Compare February 4, 2025 20:58
@alisman alisman merged commit f2ba2b8 into cBioPortal:master Feb 5, 2025
12 of 15 checks passed
@gblaih gblaih deleted the comparison-mutations-none-selected-error branch February 5, 2025 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

comparison/mutations tab fails to load if mutations are not selected on genomic alterations tab
4 participants