Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closes: #15239 - Allow adding/removing tagged VLANs in bulk editing of Interfaces #17524

Merged

Conversation

bctiemann
Copy link
Contributor

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

Copy link
Member

@jeremystretch jeremystretch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work with this @bctiemann, we just need to figure out a pattern for accommodating these non-model many-to-many fields generically.

netbox/netbox/views/generic/bulk_views.py Outdated Show resolved Hide resolved
netbox/dcim/views.py Outdated Show resolved Hide resolved
netbox/dcim/forms/bulk_edit.py Outdated Show resolved Hide resolved
netbox/netbox/views/generic/bulk_views.py Outdated Show resolved Hide resolved
@jeremystretch
Copy link
Member

CI failure is unrelated; see #17950.

@jeremystretch jeremystretch self-requested a review November 7, 2024 14:14
Copy link
Member

@jeremystretch jeremystretch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @bctiemann!

@jeremystretch jeremystretch merged commit f873735 into develop Nov 7, 2024
5 of 6 checks passed
@jeremystretch jeremystretch deleted the 15239-add-remove-tagged-vlans-bulk-editing-interfaces branch November 7, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow bulk assignment/unassignment of VLANs to interfaces
4 participants