Closed matkaczmarek closed 1 month ago
@tompollard @bemoody please take a look and let me know what you think about making the admin console more customizable.
Without thinking through the details, at a high-level this seems reasonable to me. A couple of quick questions:
view_args
?Those tabs, from the Physionet point of view, are useless and shouldn't be visible therefore, we decided not to put them in the codebase.
This is where I disagree. I'd say just put them in! Add them to the nav menu in a place that makes sense.
If the views require special user permissions, then use the console_permission_required decorator.
If the views require special site configuration, then we can use the enabled
keyword arg (see how this is done for the "GCP Logs" nav item.) (Could be improved by using a decorator instead.)
Either way, the nav items will then be hidden if the corresponding page is inaccessible.
This is where I disagree. I'd say just put them in! Add them to the nav menu in a place that makes sense.
Sure! So, I will create a PR containing custom HDN admin panel tabs resolving this issue.
When working on HDN we discovered a need for custom admin panel tabs displaying HDN specific content. For example, recently, we introduced two new admin console tabs, including Google Cloud Platform group management or custom dataset monitoring.
To do that, currently, we need to introduce this change into the
console/navbar.py
file:Those tabs, from the Physionet point of view, are useless and shouldn't be visible therefore, we decided not to put them in the codebase. From the HDN point of view, with every update to the Physionet codebase, we need to remember to apply those changes one more and potentially resolve conflicts in code leading to two major issues:
Potential solution:
Introduce
NavSubmenu
andNavLink
database models storing information abouttitle
,icon
,view_name
etc like:and construct an admin console view based on entries stored in the database. Views and paths necessary for specific admin panel tabs could be loaded from python packages like
hdn-research-environment
which would resolve the above issues and open the door for further customizations.