19073 allow plugins to be marked as hidden or disabled in plugins table #19087
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #19073
Defined a new config parameter PLUGINS_CATALOG_CONFIG, I kept it separate from PLUGINS_CONFIG as those settings are directly controlled by the plugin itself and I didn't want to potentially break it if there were overlap In the names or the plugin wasn't expecting additional params for some reason (probably very unlikely, but...)
With this config can see netbox_acls was removed from the list and netbox_bgp is not a clickable link anymore:
In netbox/core/views.py could unfold the
if q:
lines to make one loop through the list, but thought this was clearer and list comprehension is very fast (and a short list). I also wanted to keep the list with the hidden flags instead of removing them when it initially generates the list as we may potentially want to use the complete list for other things in the future (including hidden items).