cbioportal-frontend
cbioportal-frontend copied to clipboard
Oncoprint config user session
Store Oncoprint track config in user session
Uses new-oncoplot-property
to show changes: this branch will be removed when PR #4152 has been merged.
- When a user opens an oncoprint, clinical tracks will be restored from user session configuration.
- When user makes changed to clinical tracks, the 'save-to-session'-button becomes active.
- When a user clicks the oncoprint save-to-session-button, clinical track configuration of the current oncoprint will be stored to the user session.
Needs backend functionality of https://github.com/cBioPortal/cbioportal/pull/9450
Changes
-
Add save-to-session-button 'Save Tracks' to Tracks menu
-
Add
PageUserSession
toResultsViewPageStore
to manage changes in the user session. PageUserSession bundles all user session state management for the ResultViewPageStore, and prevents adding any additional complexity to an already quite complex store. From an architectural point of view this differs from theStudyViewPageStore
which handles all user session management itself. However the PageUserSession has been kept as generic as possible: we can use the same mechanism for the StudyViewPageStore in a followup PR. -
Add e2e-tests to
oncoprint.screenshot.spec.js
Oncoprint can now be configured in three ways: using the default settings, user session and url query params. When should we use which method?
- if no session service:
-> use url; or init with default
- if session service enabled:
-> load page:
- if url is default*:
-> initialize with session
- if url is non-default:
-> initialize with url (disregard user session)
-> enable save-session button
-> change clinicallist:
-> save to url
-> enable save-session button
-> change id:
-> fetch session at id
- if session is none:
-> init with default*
- if session is non-default:
-> save to url
-> initialize with clinicallist
-> click session-save button:
-> save clinicallist to session
-> disable save-session button
*default: as configured in oncoprint_clinical_tracks_show_by_default
Updates after community call 2022-04-20. To clarify the function of the button the following changes were made:
- Move the button to the 'add tracks' menu
- Rename the 'add tracks' menu to 'tracks'
- Add text 'save tracks' to button and change cloud to pin icon
- Is it ok that we lose clinical track url state for logged out users because we no longer update url
- Same question for groups. Why are groups used in results view page
- Is it ok that we lose clinical track url state for logged out users because we no longer update url
- Same question for groups. Why are groups used in results view page
- Is it ok that we lose clinical track url state for logged out users because we no longer update url
- Same question for groups. Why are groups used in results view page
@alisman:
- this is ok, as discussed in slack
- groups were already used in results view page, not an issue of this PR
Added userSettingsJson query param after hash to prevent it from being passed to the server in 14e17c4