biothings / discovery-app

The Data Discovery Engine project by the CD2H Data working-group
http://discovery.biothings.io
Apache License 2.0
4 stars 9 forks source link

Suggestion for /portals infrastructure #203

Closed flaneuse closed 1 year ago

flaneuse commented 1 year ago

When defining a new /portal, there's a couple of places where things are hardcoded which could be refactored to be a bit more robust.

  1. Routing relies on the order within the array of portals. If you're like me, and you just copy the entry above, you can get the sort order out of whack. Would suggest switching this to a name-based lookup to avoid having to know the precise number within the array. You could either switch to a dictionary object ("ctsa": {name: ....}) or do a filter / get first element logic.
  2. Between portal.html and portals.html, values such as color/icons are defined twice -- regardless if the property is needed in that file. If I were designing it, I'd probably create a portals.json file that both routes access, so you can define one set of names/defs rather than having to maintain them in two places.

Thanks!

flaneuse commented 1 year ago

Also have to manually add to the Nav bar dropdown in header.html.

marcodarko commented 1 year ago

This is already refactored in the new website, I do think it was annoying as well. Hopefully the new way is a lot smoother and easier only having to make edits in one place. Right now this is not possible because I can't share data across multiple pages so duplication is an issue. Closing this as this will be taken care of soon but can't do much about it on the current version.