[PR #19183] [MERGED] Fixes #18978 - Allow filtering of Interfaces in the GUI by 802.1Q Mode #15562

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/19183
Author: @pheus
Created: 4/14/2025
Status: Merged
Merged: 4/15/2025
Merged by: @jeremystretch

Base: mainHead: 18978-allow-filtering-of-interface-by-802-1q


📝 Commits (6)

  • 0b4bb13 feat(dcim): Add VLAN mode filter to CommonInterface
  • 76442b6 feat(dcim): Add VLAN mode filter to Interface FilterForm
  • 70aa3a2 feat(virtualization): Add VLAN mode filter to VMInterface
  • adb6b3a fix(dcim): Correct mode filter parameter type in tests
  • 9203f65 feat(virtualization): Add tests for VLAN mode filtering
  • a8bb17f refactor(virtualization): Reorganize FieldSets in FilterSets

📊 Changes

5 files changed (+26 additions, -2 deletions)

View changed files

📝 netbox/dcim/filtersets.py (+4 -0)
📝 netbox/dcim/forms/filtersets.py (+6 -0)
📝 netbox/dcim/tests/test_filtersets.py (+1 -1)
📝 netbox/virtualization/forms/filtersets.py (+9 -1)
📝 netbox/virtualization/tests/test_filtersets.py (+6 -0)

📄 Description

Fixes #18978 - Allow filtering of Interfaces in the GUI by 802.1Q Mode

This PR enhances VLAN filtering and filter form usability for the DCIM and Virtualization modules by adding VLAN mode filtering, updating tests, and refactoring field organization.

Changes

  • VLAN Mode Filtering:

    • Added filtering by 802.1Q VLAN mode to Common Interface (DCIM and VMInterface) FilterSets.
    • Updated tests to accept a list for the mode parameter.
  • Refactoring:

    • Split the 'Attributes' FieldSet into 'Attributes' and 'Addressing' for improved clarity.

Impact

These improvements allow users to efficiently filter interfaces by VLAN mode.
I opted for a MultipleChoiceFilter to maintain consistency with how PoE mode filtering is handled, even though this introduces a breaking change.

Thank you for reviewing this PR!


🔄 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/19183 **Author:** [@pheus](https://github.com/pheus) **Created:** 4/14/2025 **Status:** ✅ Merged **Merged:** 4/15/2025 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `main` ← **Head:** `18978-allow-filtering-of-interface-by-802-1q` --- ### 📝 Commits (6) - [`0b4bb13`](https://github.com/netbox-community/netbox/commit/0b4bb1370d5cfa3d09f1b4d06aea17a73c8a5581) feat(dcim): Add VLAN mode filter to CommonInterface - [`76442b6`](https://github.com/netbox-community/netbox/commit/76442b66b9935f0c686f7fcd51c16f5396539f87) feat(dcim): Add VLAN mode filter to Interface FilterForm - [`70aa3a2`](https://github.com/netbox-community/netbox/commit/70aa3a229b1b24ce7c7f037465fd2f1cbb375168) feat(virtualization): Add VLAN mode filter to VMInterface - [`adb6b3a`](https://github.com/netbox-community/netbox/commit/adb6b3aa1df6407e83bb985042fc8f4c1643dbda) fix(dcim): Correct mode filter parameter type in tests - [`9203f65`](https://github.com/netbox-community/netbox/commit/9203f65f986f644562b9bd5c9952de155278f920) feat(virtualization): Add tests for VLAN mode filtering - [`a8bb17f`](https://github.com/netbox-community/netbox/commit/a8bb17fc4a81aff3b1ea08fb6c534f42cf63d4da) refactor(virtualization): Reorganize FieldSets in FilterSets ### 📊 Changes **5 files changed** (+26 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `netbox/dcim/filtersets.py` (+4 -0) 📝 `netbox/dcim/forms/filtersets.py` (+6 -0) 📝 `netbox/dcim/tests/test_filtersets.py` (+1 -1) 📝 `netbox/virtualization/forms/filtersets.py` (+9 -1) 📝 `netbox/virtualization/tests/test_filtersets.py` (+6 -0) </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 opening a pull request. This helps avoid waste time and effort on a proposed change that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WILL BE CLOSED AUTOMATICALLY. Please specify your assigned issue number on the line below. --> ### Fixes #18978 - Allow filtering of Interfaces in the GUI by 802.1Q Mode This PR enhances VLAN filtering and filter form usability for the DCIM and Virtualization modules by adding VLAN mode filtering, updating tests, and refactoring field organization. #### Changes - **VLAN Mode Filtering:** - Added filtering by 802.1Q VLAN mode to Common Interface (DCIM and VMInterface) FilterSets. - Updated tests to accept a list for the mode parameter. - **Refactoring:** - Split the 'Attributes' FieldSet into 'Attributes' and 'Addressing' for improved clarity. #### Impact These improvements allow users to efficiently filter interfaces by VLAN mode. I opted for a `MultipleChoiceFilter` to maintain consistency with how PoE mode filtering is handled, even though this **introduces a breaking change**. Thank you for reviewing this PR! --- <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:22:44 +01:00
adam closed this issue 2025-12-30 00:22:44 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15562