[PR #20931] [MERGED] Fixes #20759: Group object types by app in permission form #16089

Closed
opened 2025-12-30 00:25:43 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20931
Author: @jnovinger
Created: 12/5/2025
Status: Merged
Merged: 12/9/2025
Merged by: @jeremystretch

Base: mainHead: 20759-object-names-permissions


📝 Commits (2)

📊 Changes

8 files changed (+200 additions, -36 deletions)

View changed files

📝 netbox/project-static/dist/netbox.css (+1 -1)
📝 netbox/project-static/dist/netbox.js (+4 -4)
📝 netbox/project-static/dist/netbox.js.map (+3 -3)
📝 netbox/project-static/src/buttons/moveOptions.ts (+52 -11)
📝 netbox/project-static/styles/transitional/_forms.scss (+14 -0)
📝 netbox/users/forms/model_forms.py (+21 -4)
📝 netbox/utilities/forms/widgets/select.py (+36 -13)
📝 netbox/utilities/tests/test_forms.py (+69 -0)

📄 Description

Fixes: #20759

Modified the ObjectPermissionForm to use optgroups for organizing object types by application. This shortens the display names (e.g., "permission" instead of "Authentication and Authorization | permission") while maintaining clear organization through visual grouping.

Changes:

  • Updated get_object_types_choices() to return nested optgroup structure
  • Changed AvailableOptions and SelectedOptions widgets to handle optgroups
  • Modified TypeScript moveOptions to preserve optgroup structure
  • Added hover text showing full model names

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/20931 **Author:** [@jnovinger](https://github.com/jnovinger) **Created:** 12/5/2025 **Status:** ✅ Merged **Merged:** 12/9/2025 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `main` ← **Head:** `20759-object-names-permissions` --- ### 📝 Commits (2) - [`ef29acc`](https://github.com/netbox-community/netbox/commit/ef29acc21e964dc2e4cd1ef22f9c9fecbde8c3b0) Fixes #20759: Group object types by app in permission form - [`3fe366b`](https://github.com/netbox-community/netbox/commit/3fe366b4707421c268a0674eda66b25c15066144) Address PR feedback ### 📊 Changes **8 files changed** (+200 additions, -36 deletions) <details> <summary>View changed files</summary> 📝 `netbox/project-static/dist/netbox.css` (+1 -1) 📝 `netbox/project-static/dist/netbox.js` (+4 -4) 📝 `netbox/project-static/dist/netbox.js.map` (+3 -3) 📝 `netbox/project-static/src/buttons/moveOptions.ts` (+52 -11) 📝 `netbox/project-static/styles/transitional/_forms.scss` (+14 -0) 📝 `netbox/users/forms/model_forms.py` (+21 -4) 📝 `netbox/utilities/forms/widgets/select.py` (+36 -13) 📝 `netbox/utilities/tests/test_forms.py` (+69 -0) </details> ### 📄 Description ### Fixes: #20759 Modified the `ObjectPermissionForm` to use `optgroups` for organizing object types by application. This shortens the display names (e.g., "permission" instead of "Authentication and Authorization | permission") while maintaining clear organization through visual grouping. Changes: - Updated `get_object_types_choices()` to return nested `optgroup` structure - Changed `AvailableOptions` and `SelectedOptions` widgets to handle `optgroups` - Modified TypeScript `moveOptions` to preserve `optgroup` structure - Added hover text showing full model names --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:25:43 +01:00
adam closed this issue 2025-12-30 00:25:43 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#16089