-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Save Column Visibility & Add "Reset Columns" Button (#3846)
Fixes cBioPortal/cbioportal#8521, 3.1 Store user settings and 3.2 Add "reset to default" button based on app configuration in cBioPortal/cbioportal#8711, points 3 & 4 in cBioPortal/cbioportal#8716. Changes: Remembers active column selection when switching genes in Results View Mutation Table Adds "Reset Columns" button which resets the visible columns back to their initial configuration (i.e., according to the visible attribute in the column definition). Note, this button is only shown when the current column selection is different from the default configuration. (Feedback on its design is appreciated.) Fixes bug in cbioportal-frontend-commons where user-selection was prevented when passing columnVisibility prop to LazyMobXTable
- Loading branch information
1 parent
0115b34
commit 3a990bc
Showing
12 changed files
with
97 additions
and
16 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
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
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
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
17 changes: 16 additions & 1 deletion
17
src/shared/components/mutationMapper/MutationMapperUserSelectionStore.ts
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 |
---|---|---|
@@ -1,14 +1,29 @@ | ||
import { observable, makeObservable } from 'mobx'; | ||
import { action, observable, makeObservable } from 'mobx'; | ||
import { | ||
initDefaultTrackVisibility, | ||
TrackVisibility, | ||
} from 'react-mutation-mapper'; | ||
|
||
export default class MutationMapperUserSelectionStore { | ||
@observable trackVisibility: TrackVisibility; | ||
@observable columnVisibility: { | ||
[columnId: string]: boolean; | ||
}; | ||
|
||
constructor() { | ||
makeObservable(this); | ||
this.trackVisibility = initDefaultTrackVisibility(); | ||
} | ||
|
||
@action.bound | ||
public storeColumnVisibility(columnVisibility: { | ||
[columnId: string]: boolean; | ||
}) { | ||
if ( | ||
JSON.stringify(this.columnVisibility) !== | ||
JSON.stringify(columnVisibility) | ||
) { | ||
this.columnVisibility = columnVisibility; | ||
} | ||
} | ||
} |
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