[PR #17524] [MERGED] Closes: #15239 - Allow adding/removing tagged VLANs in bulk editing of Interfaces #15112

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/17524
Author: @bctiemann
Created: 9/17/2024
Status: Merged
Merged: 11/7/2024
Merged by: @jeremystretch

Base: developHead: 15239-add-remove-tagged-vlans-bulk-editing-interfaces


📝 Commits (6)

  • e66695b Allow adding/removing tagged VLANs in bulk editing of Interfaces
  • c4aac4e Move vlan/interface-specific field operations to an overrideable method
  • 6fa295b Ensure interfaces are MODE_TAGGED before adding/removing tagged vlans
  • 8fe1b74 Add docstring for generic extra_object_field_operations
  • 00aae76 Merge branch 'refs/heads/develop' into 15239-add-remove-tagged-vlans-bulk-editing-interfaces
  • 56664ab Move tagging ops into post_save_operations and use a TabbedGroup in the form

📊 Changes

3 files changed (+68 additions, -23 deletions)

View changed files

📝 netbox/dcim/forms/bulk_edit.py (+45 -17)
📝 netbox/dcim/views.py (+11 -1)
📝 netbox/netbox/views/generic/bulk_views.py (+12 -5)

📄 Description

Closes: #15239

Adds "Add Tagged VLANs" and "Remove tagged VLANs" widgets to the bulk edit form of Interfaces, both when editing them standalone and when accessing them as components of a device. These fields operate in the same way as the existing "Add tags"/"Remove tags" and allow the user to add or remove the selected items to all selected objects regardless of their existing VLANs, rather than having to set all objects to the same VLAN settings in the edit operation.

Note that this PR also cleans up the __init__ function of InterfaceBulkEditForm, removing the after-the-fact modification of the widgets to add query parameters, as these params can be set in the field definitions directly using the $device token.

Screenshot 2024-09-17 at 4 01 39 PM

🔄 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/17524 **Author:** [@bctiemann](https://github.com/bctiemann) **Created:** 9/17/2024 **Status:** ✅ Merged **Merged:** 11/7/2024 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `15239-add-remove-tagged-vlans-bulk-editing-interfaces` --- ### 📝 Commits (6) - [`e66695b`](https://github.com/netbox-community/netbox/commit/e66695b0599cc87d8b46021f77e3a7cc41c3f432) Allow adding/removing tagged VLANs in bulk editing of Interfaces - [`c4aac4e`](https://github.com/netbox-community/netbox/commit/c4aac4ea42447d9a6217dd8cab767926041b9d4c) Move vlan/interface-specific field operations to an overrideable method - [`6fa295b`](https://github.com/netbox-community/netbox/commit/6fa295bc2f7fe646d958aa1138df0612679cd853) Ensure interfaces are MODE_TAGGED before adding/removing tagged vlans - [`8fe1b74`](https://github.com/netbox-community/netbox/commit/8fe1b745a646c85bc2aed7057b97ba9d79759021) Add docstring for generic extra_object_field_operations - [`00aae76`](https://github.com/netbox-community/netbox/commit/00aae7688dd2e2717ee96db271348c05804dfd79) Merge branch 'refs/heads/develop' into 15239-add-remove-tagged-vlans-bulk-editing-interfaces - [`56664ab`](https://github.com/netbox-community/netbox/commit/56664ab0fe262808df274fe4a98816f30d6f3300) Move tagging ops into post_save_operations and use a TabbedGroup in the form ### 📊 Changes **3 files changed** (+68 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/forms/bulk_edit.py` (+45 -17) 📝 `netbox/dcim/views.py` (+11 -1) 📝 `netbox/netbox/views/generic/bulk_views.py` (+12 -5) </details> ### 📄 Description ### Closes: #15239 Adds "Add Tagged VLANs" and "Remove tagged VLANs" widgets to the bulk edit form of Interfaces, both when editing them standalone and when accessing them as components of a device. These fields operate in the same way as the existing "Add tags"/"Remove tags" and allow the user to add or remove the selected items to all selected objects regardless of their existing VLANs, rather than having to set all objects to the same VLAN settings in the edit operation. Note that this PR also cleans up the `__init__` function of `InterfaceBulkEditForm`, removing the after-the-fact modification of the widgets to add query parameters, as these params can be set in the field definitions directly using the `$device` token. <img width="818" alt="Screenshot 2024-09-17 at 4 01 39 PM" src="https://github.com/user-attachments/assets/dbaf34aa-a73e-4802-a0cb-0d18d1b1ea6c"> --- <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:04 +01:00
adam closed this issue 2025-12-30 00:20:04 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15112