[PR #10441] [MERGED] 9071 add header to plugin menu #13630

Closed
opened 2025-12-29 23:19:57 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/10441
Author: @arthanson
Created: 9/22/2022
Status: Merged
Merged: 9/28/2022
Merged by: @jeremystretch

Base: featureHead: 9071-plugin-menu


📝 Commits (8)

  • e074570 9071 add header to plugin menu
  • 36f3122 Merge branch 'feature' into 9071-plugin-menu
  • b134d2a 9071 fix test
  • 7deb9fd 9071 add documentation
  • 00d2dcd Refactor navigation resources and menu
  • db90b08 Enable plugins to create root-level navigation menus
  • d046524 Add documentation for PluginMenu
  • 3fbd514 Add test for plugin menu registration

📊 Changes

8 files changed (+211 additions, -122 deletions)

View changed files

📝 docs/development/adding-models.md (+1 -1)
📝 docs/plugins/development/navigation.md (+61 -17)
📝 netbox/extras/plugins/__init__.py (+26 -5)
📝 netbox/extras/tests/dummy_plugin/navigation.py (+8 -2)
📝 netbox/extras/tests/test_plugins.py (+10 -1)
netbox/netbox/navigation/__init__.py (+92 -0)
📝 netbox/netbox/navigation/menu.py (+12 -95)
📝 netbox/utilities/templatetags/navigation.py (+1 -1)

📄 Description

Fixes: #9071

Allows plugins to define a menu_heading (see below) that will make it a top-level menu. This still needs to edit the doc files for plugins. @jeremystretch the original issue had a request to allow items to be appended to existing menus, however this would require the menu.groups to be an array instead of an immutable tuple so items could be appended on - not sure if this is desired or not?

menu_heading = {
"title": "MyPlugin",
"icon": "mdi-puzzle"
}


🔄 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/10441 **Author:** [@arthanson](https://github.com/arthanson) **Created:** 9/22/2022 **Status:** ✅ Merged **Merged:** 9/28/2022 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `9071-plugin-menu` --- ### 📝 Commits (8) - [`e074570`](https://github.com/netbox-community/netbox/commit/e074570b8fd8eac213b49750360982199043153c) 9071 add header to plugin menu - [`36f3122`](https://github.com/netbox-community/netbox/commit/36f31228ffdeae589eb2dd765bef0ea7594dec6e) Merge branch 'feature' into 9071-plugin-menu - [`b134d2a`](https://github.com/netbox-community/netbox/commit/b134d2a7b0daa61aa20769390cfc9f797a440108) 9071 fix test - [`7deb9fd`](https://github.com/netbox-community/netbox/commit/7deb9fde9e3822c83076b08896de62b8ed578f7a) 9071 add documentation - [`00d2dcd`](https://github.com/netbox-community/netbox/commit/00d2dcda68be0935962c8e5d11a66d784638fb1e) Refactor navigation resources and menu - [`db90b08`](https://github.com/netbox-community/netbox/commit/db90b084cf779c109100a6688d0e16ec07cb1978) Enable plugins to create root-level navigation menus - [`d046524`](https://github.com/netbox-community/netbox/commit/d0465242a336061b5894299037a10125f0f8c438) Add documentation for PluginMenu - [`3fbd514`](https://github.com/netbox-community/netbox/commit/3fbd514417755f886d09a352b3fc1a4f7240430c) Add test for plugin menu registration ### 📊 Changes **8 files changed** (+211 additions, -122 deletions) <details> <summary>View changed files</summary> 📝 `docs/development/adding-models.md` (+1 -1) 📝 `docs/plugins/development/navigation.md` (+61 -17) 📝 `netbox/extras/plugins/__init__.py` (+26 -5) 📝 `netbox/extras/tests/dummy_plugin/navigation.py` (+8 -2) 📝 `netbox/extras/tests/test_plugins.py` (+10 -1) ➕ `netbox/netbox/navigation/__init__.py` (+92 -0) 📝 `netbox/netbox/navigation/menu.py` (+12 -95) 📝 `netbox/utilities/templatetags/navigation.py` (+1 -1) </details> ### 📄 Description <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be approved and assigned prior to filing a pull request. This helps avoid wasting time and effort on something that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WE BE CLOSED AUTOMATICALLY. Specify your assigned issue number on the line below. --> ### Fixes: #9071 <!-- Please include a summary of the proposed changes below. --> Allows plugins to define a menu_heading (see below) that will make it a top-level menu. This still needs to edit the doc files for plugins. @jeremystretch the original issue had a request to allow items to be appended to existing menus, however this would require the menu.groups to be an array instead of an immutable tuple so items could be appended on - not sure if this is desired or not? menu_heading = { "title": "MyPlugin", "icon": "mdi-puzzle" } --- <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-29 23:19:57 +01:00
adam closed this issue 2025-12-29 23:19:57 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13630