Skip to content
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

UX: Feasible to have a webpage option make content agile to PHI/non-PHI content #51

Closed
HenrikBengtsson opened this issue Apr 12, 2022 · 4 comments
Labels

Comments

@HenrikBengtsson
Copy link
Contributor

More and more users are getting PHI accounts. Most pages on the website are targeted for non-PHI users, e.g. examples and inline code instructions.

Can we provide an option to the viewer of the website;

  • Adjust content for Wynton PHI account

at the top of each page, or in settings menu in the navigation bar? It should then use cookies so it's sticky. When checked, content such as ssh alice@log1.wynton.ucsf.edu should become ssh alice@plog1.wynton.ucsf.edu and so on. We could also have paragraphs and alert banners that are only visible to PHI viewers.

@HenrikBengtsson
Copy link
Contributor Author

HenrikBengtsson commented Jun 15, 2022

More thoughts:

  • Constraint: Note that our website is static, i.e. content cannot be changed by via GET/POST requests. To keep it simple, we should keep it this way, if possible
  • UX: use an HTML switch/toggle widget Non-PHI <-> PHI to control what is displayed
  • Storage: Use the HTML Web Storage API to store the setting(s) across sessions locally in the user's web browser, e.g. in JavaScript localStorage.phi = true (set) and localStorage.phi (get).
  • Content update: If localStorage.phi == true, then (a) enable PHI-specific CSS, and (b) enable PHI-specific DIVs, and disable non-PHI-specific DIVs. For remaining content, (c) walk the HTML DOM tree and use search-replace to update content from non-PHI to PHI. For example, replace all occurrences dev1 with pdev1. This can be done via a searchReplaceEverything() JavaScript function.

@HenrikBengtsson
Copy link
Contributor Author

I've added a Non-PHI/PHI toggle to the navbar. It uses Javascript to search-replace on plain text to adjust the content to PHI.

@HenrikBengtsson
Copy link
Contributor Author

Closing. Implemented most of the things here. Created new issues #103 and #104 for the remaining things

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant