OHDSI Home | Forums | Wiki | Github

Atlas config-local.js - are the variables in scope for index.html?

I was asked to advise how turn off features on the Atlas home page for a data commons version of the app. I see that we can go to ./index.html ~line 44 and add this line of code in the line following ‘’ to list the features to be shown:

<!-- ko if: ko.unwrap($data.title) && (ko.unwrap($data.title) == 'Home' || ko.unwrap($data.title) == 'Data Sources' || ko.unwrap($data.title) == 'Search' || ko.unwrap($data.title) == 'Concept Sets' || ko.unwrap($data.title) == 'Cohort Definitions') -->

This works fine but I think that it would be preferred to add a configuration option to config-local.js with a list of features the could be hidden. This could benefit other Atlas sites where only some of the features are relevant to their users.

The thing that I can’t figure out it how to make the items in config-local.js in scope for the the code in index.html. I looked closely through the code and, while the config items are in scope for the JS code elsewhere, it was not apparent that they are in scope in index.html. It tested with JS in dev tools and also could not find where the config items are upon loading index.html.

Thoughts?

Yes, the config is available at the application scope (you can access anywhre you make a reference to it), and the index page does have a ‘view model’ that is storing state such as the page title, so it is certainly possible to set up the set of navs that should be visible/hidden in a config and display the left nav based on those settigns.

t