[PR #18016] [MERGED] Closes #5858: Implement a quick-add UI widget for related objects #15251

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/18016
Author: @jeremystretch
Created: 11/14/2024
Status: Merged
Merged: 11/18/2024
Merged by: @jeremystretch

Base: featureHead: 5858-quick-add


📝 Commits (3)

📊 Changes

17 files changed (+235 additions, -75 deletions)

View changed files

📝 netbox/circuits/forms/model_forms.py (+10 -4)
📝 netbox/dcim/forms/model_forms.py (+14 -7)
📝 netbox/ipam/forms/model_forms.py (+10 -4)
📝 netbox/netbox/views/generic/object_views.py (+29 -10)
📝 netbox/project-static/dist/netbox.js (+5 -5)
📝 netbox/project-static/dist/netbox.js.map (+3 -3)
📝 netbox/project-static/src/buttons/reslug.ts (+23 -25)
📝 netbox/project-static/src/htmx.ts (+8 -3)
netbox/project-static/src/quickAdd.ts (+39 -0)
netbox/templates/htmx/quick_add.html (+28 -0)
netbox/templates/htmx/quick_add_created.html (+22 -0)
📝 netbox/tenancy/forms/forms.py (+1 -0)
📝 netbox/utilities/forms/fields/dynamic.py (+11 -1)
📝 netbox/utilities/templates/widgets/apiselect.html (+20 -7)
📝 netbox/virtualization/forms/model_forms.py (+4 -2)
📝 netbox/vpn/forms/model_forms.py (+6 -3)
📝 netbox/wireless/forms/model_forms.py (+2 -1)

📄 Description

Closes: #5858

  • Extend the APISelect widget to support a "quick add" button, which launches an embedded modal
  • Extend ObjectEditView to support a new "quick add" workflow (designated by the _quickadd=True URL query parameter)
  • Adapt initReslug() to accommodate multiple "reslug" buttons on the page
  • Add quick_add=True to various form fields as appropriate

Peek 2024-11-13 14-57


🔄 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/18016 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 11/14/2024 **Status:** ✅ Merged **Merged:** 11/18/2024 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `5858-quick-add` --- ### 📝 Commits (3) - [`284cf8f`](https://github.com/netbox-community/netbox/commit/284cf8f82c2521b7f1ea3ed025b2c7df445c714e) WIP - [`0670559`](https://github.com/netbox-community/netbox/commit/06705595b618e1dfc8d1bb9094c16a975441692d) Misc cleanup - [`13236a7`](https://github.com/netbox-community/netbox/commit/13236a778240c02de3b4d38db280cde585b8d583) Add warning re: nested quick-adds ### 📊 Changes **17 files changed** (+235 additions, -75 deletions) <details> <summary>View changed files</summary> 📝 `netbox/circuits/forms/model_forms.py` (+10 -4) 📝 `netbox/dcim/forms/model_forms.py` (+14 -7) 📝 `netbox/ipam/forms/model_forms.py` (+10 -4) 📝 `netbox/netbox/views/generic/object_views.py` (+29 -10) 📝 `netbox/project-static/dist/netbox.js` (+5 -5) 📝 `netbox/project-static/dist/netbox.js.map` (+3 -3) 📝 `netbox/project-static/src/buttons/reslug.ts` (+23 -25) 📝 `netbox/project-static/src/htmx.ts` (+8 -3) ➕ `netbox/project-static/src/quickAdd.ts` (+39 -0) ➕ `netbox/templates/htmx/quick_add.html` (+28 -0) ➕ `netbox/templates/htmx/quick_add_created.html` (+22 -0) 📝 `netbox/tenancy/forms/forms.py` (+1 -0) 📝 `netbox/utilities/forms/fields/dynamic.py` (+11 -1) 📝 `netbox/utilities/templates/widgets/apiselect.html` (+20 -7) 📝 `netbox/virtualization/forms/model_forms.py` (+4 -2) 📝 `netbox/vpn/forms/model_forms.py` (+6 -3) 📝 `netbox/wireless/forms/model_forms.py` (+2 -1) </details> ### 📄 Description ### Closes: #5858 - Extend the APISelect widget to support a "quick add" button, which launches an embedded modal - Extend ObjectEditView to support a new "quick add" workflow (designated by the `_quickadd=True` URL query parameter) - Adapt `initReslug()` to accommodate multiple "reslug" buttons on the page - Add `quick_add=True` to various form fields as appropriate ![Peek 2024-11-13 14-57](https://github.com/user-attachments/assets/03e587cb-4538-4644-ba7d-a92111a0f88d) --- <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:20:53 +01:00
adam closed this issue 2025-12-30 00:20:53 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15251