-
Notifications
You must be signed in to change notification settings - Fork 1
[ALS-10197] Update to use configuration api data for features and settings #571
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
base: feature/configuration
Are you sure you want to change the base?
Conversation
* Change feature, setting, and branding variable import paths to new configutation.svelte.ts path that allows us it use state runes. * Pull in /picsure/configuration values and store on the server side once at start with light retry and serve locally on path /api/config. * Update tests to use mocked /api/config feature and setting values. * Update .env.example and README to use new configuration setting method. * Refactor configutation interfaces/types and add to new Configuration Model. * Add mapping methods and defaults for branding, settings, and features to Configuraiton model.
src/routes/(picsure)/(authorized)/explorer/genome-filter/+page.svelte
Outdated
Show resolved
Hide resolved
| export const PROJECT_HOSTNAME = | ||
| typeof window !== 'undefined' | ||
| ? `${window.location.origin}/picsure` | ||
| : import.meta.env?.VITE_PROJECT_HOSTNAME | ||
| ? `https://${import.meta.env?.VITE_PROJECT_HOSTNAME}/picsure` | ||
| : 'https://nhanes.hms.harvard.edu/picsure'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment: I need to take a pass at restoring SSR and fixing things like this. I am guessing there is a better way to do this.
| let filtersJson = sessionStorage.getItem('filters'); | ||
| if (filtersJson) { | ||
| let storedFilters = JSON.parse(filtersJson || '[]'); | ||
| filters.set(storedFilters); | ||
| // wait to delete from session storage, in case loading the filters in the line above triggers the session | ||
| // storage to be re-written | ||
| setTimeout(() => sessionStorage.setItem('filters', '[]'), 500); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was here to prevent users from having "bad" filters the didnt have access to in BDC and they would get stuck in a log out loop. @ramari16 might remember.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The OR feature is deployed in BDC Prod atm and this code is present and does not nothing - the filterTree is saved to sessionStorage under filterTree and genomif filters as genomicFilters so this will never get triggered. Probably should visit this in OH and see if we need a separate bugfix for this: what reason it was added for and can we replicate it now in BDC prod.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now I have added something similar that I think captures the spirit of what it was functionally doing.
JamesPeck
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lg2m, some minor suggestions and comments.
Note: I'm branching off of v3 to get the end-2-end folder structure and necause we will release this after the OR feature is merged to main. Will wait to merge until after all that settles and the inevitable merge conflicts are resolved.