Closes #11619: Include VLANs with a null site in query during bulk interface edit for Devices > DEVICE COMPONENTS > Interfaces #12659
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #11619
Summary
This Pull Request enables users to be to select VLANs without a site assignment during bulk interface edits under Devices > DEVICE COMPONENTS > Interfaces.
Background
Previously, only VLANs assigned to the same site as the filtered device were available for selection. However, since it is possible to create VLANs without a site assignment, this led to a subset of selectable VLANs being omitted from the VLAN filter dropdown. This Pull Request addresses this issue by enhancing the functionality to include all selectable VLANs in the filter dropdown.
Changes
This Pull Request updates the query parameters in the code behind the bulk edit to search for VLANs with the site set to null, allowing the selection of VLANs without a site assignment.
Benefits
By incorporating this change, NetBox's usability is improved as users can now assign VLANs with a null site during a bulk interface edit. Without this modification, each interface would need to be individually edited through a different section of the UI that already worked.
Test
To reproduce the bug described in issue #11619, follow these steps:
DEV_TESTin SiteSITE_TESTwith at least two interfaces. You can use the ISR 1111-8P defined in this GitHub repository, or alternatively, import the device using the following YAML:DEV_TESTdevice.Prior to this Pull Request
Edit multiple interfaces -> 802.1Q Switching Mode: Tagged -> Untagged VLAN includes only VLAN 10
Edit multiple interfaces -> 802.1Q Switching Mode: Tagged -> Tagged VLANs includes only VLAN 10
With this Pull Request
Edit multiple interfaces -> 802.1Q Switching Mode: Tagged -> Untagged VLAN includes VLAN 10 and VLAN 20
Edit multiple interfaces -> 802.1Q Switching Mode: Tagged -> Tagged VLANs includes VLAN 10 and VLAN 20