-
Notifications
You must be signed in to change notification settings - Fork 270
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
Add "View NG-CHM" button on OncoPrint Heatmap tab #2872
Conversation
@@ -3263,7 +3301,7 @@ export class ResultsViewPageStore { | |||
//this is only required to show study name and description on the results page | |||
//CancerStudy objects for all the cohortIds | |||
readonly queriedStudies = remoteData({ | |||
await: () => [this.studyIdToStudy, this.queriedVirtualStudies], | |||
await: () => [this.studyIdToStudy, this.queriedVirtualStudies, this.isThereRemoteNGCHM], |
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 will introduce a hard dependency on the mdanderson site for ALL portals. if it errors, or is slow, then whatever feature depends on queriesStudies will fail. i would make sure that ONLY the link/button depends on remoteNgchmUrl and that it is hidden if it fails. you will have to deal with loading and errors state then. don't worry about loading state. just hidden if it's loading. for error state, just put in some little error text.
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.
Removed the hard dependency. (Still on RC for now.)
|
||
export default class ConfirmNgchmModal extends React.Component { | ||
|
||
state: {show: boolean, callback: () => void } = { |
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.
for consistency sake, lets use mobx observable props to handle state instead of react state. so, the component gets @observer decorator and show and callback are properties that have @observable decorator.
There are many devs working on the project and I don't want them getting inconsistent message.
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.
Done, I think. react state is gone. (Still in RC)
@@ -471,6 +473,11 @@ export default class OncoprintControls extends React.Component< | |||
this.props.handlers.onClickClusterHeatmap && | |||
this.props.handlers.onClickClusterHeatmap(); | |||
break; | |||
case EVENT_KEY.viewNGCHM: | |||
if (this.props.state.ngchmButtonActive && this.props.handlers.onClickNGCHM) { | |||
this.confirmModal!.show(this.props.handlers.onClickNGCHM); |
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 a bit of a violation of state management practice. The state of this modal should really be kept by parent component and passed in as a prop (or dealt with entirely outside the modal.
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.
Passed as prop. See what you think now. (Still in RC)
@@ -0,0 +1,52 @@ | |||
import * as React from 'react'; |
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.
would be nice to have a comment here about what NGCHM is.
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.
Done. Have a look.
} | ||
}); | ||
|
||
readonly isThereRemoteNGCHM = remoteData<boolean>({ |
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.
rather than creating a wrapper promise to return boolean, just put what's in invoke logic down in ngchmButtonActive getter. We're trying to be more judicious about creating lots of wrapper remoteData (mobxpromise), by which i mean, remoteData instances that only exist to process other remoteData and don't actually make any async calls.
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.
Did as you suggested, and it seems to work, though it's not obvious to me why this doesn't cause a race condition other than ngchmButtonActive just happens to never be called before the remoteData is already resolved. (Still in RC for now.)
@jjgao is this an integration we want for all portals or should add a configuration flag for it |
@ChrisWakefield We spin up test instance for all PRs. Link to yours follows. Seems to work nicely. You can make this PR directly to master since it does not involve any backend work. So please rebase on master. |
It's just for public portal, so configuration would be good. The same configuration should also turn on/off (off by default) for the study view integration of NG-CHM. |
I think this can be for both private or public portals, but yes being able to configure it for a specific installation/deployment would be useful. Where is this configuration flag going to be, and what mechanism do you have in place to enable that? What's a good example? |
Thank you. |
@ChrisWakefield to "go to master":
|
@ChrisWakefield to add configuration, there are two steps:
Sorry this is more complicated than it should be. Happy to assist. |
@ChrisWakefield any word on this PR? |
@ChrisWakefield test this and it looks good. You can mock configuration options in browser window with by running this in console It works. I think we can take it from here. We will need to add the configuration to the backend, then turn it on for our production env. THEN, e2e tests will fail due to addition of this button. Then we need to update screenshots! Sound fun? Anyway, I'll have someone here take care of this. |
@alisman |
@ChrisWakefield it's a Heroku bug. I fix it by deleting app and then clicking "Create review app" again. |
@ChrisWakefield so, the property will now be available at AppConfig.serverConfig_show_mdacc_heatmap. We need to adjust this PR for that. Can you do that work? We should also hide the tab on study view based on that param. |
Ah. It's working now, both OncoPrint and Study view. I hope to demo this here this afternoon, just to show it works on more than just my machine. |
@ChrisWakefield this will be merged when the backend config change is merged (next patch release will be by end of week) |
@ChrisWakefield i was going to merge this today but i noticed there's a problem with commit history. We need to squash your commits into one and then rebase just those on master. We don't want all the merges from master to your branch. So, in the end this should just be one commit. |
@alisman |
Hi @ChrisWakefield thanks. I can take if from here! Probably best if I resolve the conflicts. I will probably push to your branch so that we can preserve the PR comment history. If that fails, I'll open one myself |
@alisman @adamabeshouse @inodb @jjgao |
@alisman @adamabeshouse this PR also seems to have missed product review. Let's discuss how to improve the process on engineering call |
Fix cBioPortal/cbioportal#6306
Describe changes proposed in this pull request:
Though this has the new visual feature of the added button and confirmation dialog, properties must be configured and the study must be selected to see the button. I don't know how to automate the complete scenario.
Checks
Any screenshots or GIFs?
If this is a new visual feature please add a before/after screenshot or gif
here with e.g. GifGrabber.
Notify reviewers
@zhx828 @alisman
Based on conversation with Rehan Akbani and Niki Schultz:
insert a fourth button in the Heatmap drop-down. Clicking on the button would show a disclaimer that the user is linking out to an external website and their gene and sample selections may not be the only ones represented in the map. Once the user acknowledges the disclaimer, NG-CHM would open up (perhaps in a new browser tab).