cbioportal-frontend icon indicating copy to clipboard operation
cbioportal-frontend copied to clipboard

Oncoprint config user session

Open BasLee opened this issue 2 years ago • 5 comments

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

Screenshot from 2022-04-21 11-37-38

Changes

  • Add save-to-session-button 'Save Tracks' to Tracks menu

  • Add PageUserSession to ResultsViewPageStore 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 the StudyViewPageStore 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

BasLee avatar Apr 13 '22 08:04 BasLee

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

BasLee avatar Apr 21 '22 09:04 BasLee

  1. Is it ok that we lose clinical track url state for logged out users because we no longer update url
  2. Same question for groups. Why are groups used in results view page

alisman avatar Aug 19 '22 15:08 alisman

  1. Is it ok that we lose clinical track url state for logged out users because we no longer update url
  2. Same question for groups. Why are groups used in results view page

alisman avatar Aug 19 '22 15:08 alisman

  1. Is it ok that we lose clinical track url state for logged out users because we no longer update url
  2. Same question for groups. Why are groups used in results view page

@alisman:

  1. this is ok, as discussed in slack
  2. groups were already used in results view page, not an issue of this PR

BasLee avatar Aug 22 '22 09:08 BasLee

Added userSettingsJson query param after hash to prevent it from being passed to the server in 14e17c4

BasLee avatar Aug 22 '22 12:08 BasLee