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

Selected genes list populates when there is only one group selected #4551

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

jfkonecn
Copy link
Contributor

@jfkonecn jfkonecn commented Mar 19, 2023

Fix cBioPortal/cbioportal#10088

Describe changes proposed in this pull request:

  • There was a guard in the makeEnrichmentDataPromise function that was preventing the gene list from being populated

Why no test?
This is a network request based issue so it'll be difficult to create a non-brittle test

Checks

  • Has tests or has a separate issue that describes the types of test that should be created. If no test is included it should explicitly be mentioned in the PR why there is no test.
  • The commit log is comprehensible. It follows 7 rules of great commit messages. For most PRs a single commit should suffice, in some cases multiple topical commits can be useful. During review it is ok to see tiny commits (e.g. Fix reviewer comments), but right before the code gets merged to master or rc branch, any such commits should be squashed since they are useless to the other developers. Definitely avoid merge commits, use rebase instead.
  • Is this PR adding logic based on one or more clinical attributes? If yes, please make sure validation for this attribute is also present in the data validation / data loading layers (in backend repo) and documented in File-Formats Clinical data section!

@alisman @onursumer

Comment on lines 1079 to 1080
(this.alterationsEnrichmentDataRequestGroups.result &&
this.alterationsEnrichmentDataRequestGroups.result.length >
Copy link
Member

Choose a reason for hiding this comment

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

Maybe simplify it this way?

Suggested change
(this.alterationsEnrichmentDataRequestGroups.result &&
this.alterationsEnrichmentDataRequestGroups.result.length >
this.alterationsEnrichmentDataRequestGroups.result?.length

Technically, we don't even need the check > 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Personally I prefer to have the > 0 since it's more explicit, but I'm happy to change it if you want me to.

Copy link
Member

Choose a reason for hiding this comment

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

We can keep the > 0. I don't have a strong preference.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, just realized if we keep the > 0 then the above simplification doesn't work. TypeScript complains if we do

this.alterationsEnrichmentDataRequestGroups.result?.length > 0

Copy link
Member

Choose a reason for hiding this comment

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

Sorry for dragging this out but if we really want to be explicit we can also do this:

!_.isEmpty(this.alterationsEnrichmentDataRequestGroups.result)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No worries I can do that

@inodb inodb added the bug label Mar 22, 2023
@inodb inodb merged commit cc356b3 into cBioPortal:master Mar 22, 2023
@inodb inodb added the gsoc label Mar 28, 2023
@jfkonecn jfkonecn deleted the hotfix branch April 1, 2023 17:46
This pull request was closed.
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.

Selected genes list is empty when there is only one group selected
3 participants