Conversation
arthanson
left a comment
There was a problem hiding this comment.
Failing test for some reason: django.db.utils.ProgrammingError: relation "netbox_custom_objects_customobjecttype" does not exist
arthanson
left a comment
There was a problem hiding this comment.
Couple issues:
I had two existing custom object types, I added a a1 group label to the first, b2 to the second one.
-
When I add b2 the custom object in the sidebar disappears - forcing you to restart. I know you stated that it requires a restart to show, but this forces a restart as soon as you add a group name. I don't think that is acceptable, or if okay with PM then should at least have a big warning on the field that you must restart if you change this item - IMHO I wouldn't ship with this restriction.
-
The ordering of the menu items is non-deterministic. Each time you restart the group a1 and b2 can shift places. a1 is first on some restarts, b1 is first on others.
-
Should probably add group-name to filters
I also think there should be some minimal tests:
- A test that a COT with group_name appears in the correct group in get_grouped_menu_items()
- A test that group_name is serialized in the API response
|
@claude /review |
Closes: #193
This adds a
group_namefield toCustomObjectTypewhich allows COTs to be grouped in the navigation menu. An unspecifiedgroup_nameresults in COTs being grouped under "Objects" as before.Note: This solution requires that NetBox be restarted in order to re-populate the groupings in the nav menu if they have changed. This is because only the list of items within a group is iterable; the groupings themselves are populated concretely at app startup time.