-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Force rerendering of study page filters when submitting
- Track submitted and queued filters in global stores - Submit queued filters when submitting or when changing submit mode - Keep global stores aligned using study view page store reaction
- Loading branch information
Bas Leenknegt
committed
Feb 28, 2023
1 parent
1a60217
commit 99c0f3c
Showing
7 changed files
with
179 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 5 additions & 52 deletions
57
.../studyView/menu/StudyViewPageGearMenu.tsx → ...pages/studyView/menu/AutosubmitToggle.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { StudyViewPageStore } from 'pages/studyView/StudyViewPageStore'; | ||
import * as React from 'react'; | ||
import { computed, makeObservable, observable } from 'mobx'; | ||
import classNames from 'classnames'; | ||
import styles from 'pages/studyView/styles.module.scss'; | ||
import { DefaultTooltip } from 'cbioportal-frontend-commons'; | ||
import { observer } from 'mobx-react'; | ||
import { AutosubmitToggle } from 'pages/studyView/menu/AutosubmitToggle'; | ||
|
||
export interface IStudyViewPageSettingsMenuProps { | ||
store: StudyViewPageStore; | ||
} | ||
|
||
@observer | ||
export default class StudyViewPageSettingsMenu extends React.Component< | ||
IStudyViewPageSettingsMenuProps, | ||
{} | ||
> { | ||
constructor(props: Readonly<IStudyViewPageSettingsMenuProps>) { | ||
super(props); | ||
makeObservable(this); | ||
} | ||
|
||
@observable visible = false; | ||
|
||
@computed get menu() { | ||
return ( | ||
<div> | ||
<AutosubmitToggle store={this.props.store} /> | ||
</div> | ||
); | ||
} | ||
|
||
render() { | ||
return ( | ||
<div className={classNames(styles.studyViewPageGearMenu)}> | ||
<DefaultTooltip | ||
trigger={'click'} | ||
placement="bottom" | ||
overlay={this.menu} | ||
visible={this.visible} | ||
onVisibleChange={visible => { | ||
this.visible = !!visible; | ||
}} | ||
> | ||
<button | ||
className={classNames('btn', 'btn-sm', 'btn-primary', { | ||
active: this.visible, | ||
})} | ||
> | ||
<i className="fa fa-cog" /> | ||
</button> | ||
</DefaultTooltip> | ||
</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.