Skip to content

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

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

Conversation

pheus
Copy link
Contributor

@pheus pheus commented Apr 14, 2025

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!

@jeremystretch jeremystretch self-requested a review April 15, 2025 12:05
pheus added 6 commits April 15, 2025 17:53
Introduces a new FilterSet for VLAN mode in CommonInterfaceFilterSet.
This allows filtering interfaces based on their VLAN mode using defined
choices.
Add a field to InterfaceFilterSet to filter interfaces by 802.1Q VLAN
mode.
Add a field to VMInterfaceFilterSet to filter interfaces by 802.1Q VLAN
mode.
Updates the `mode` filter parameter to accept a list instead of a single
value in `test_filtersets.py`. Ensures proper count assertion for
accurate test behavior.
Introduces tests to validate filtering by `mode` for VMInterface.
Ensures correct filtering for 802.1Q VLAN mode.
Splits the 'Attributes' FieldSet into two distinct FieldSets for better
clarity: 'Attributes' and 'Addressing'. This improves form organization
and makes it more intuitive for users.
@pheus pheus force-pushed the 18978-allow-filtering-of-interface-by-802-1q branch from f788ac7 to a8bb17f Compare April 15, 2025 16:03
@pheus
Copy link
Contributor Author

pheus commented Apr 15, 2025

I've removed the commits related to VLAN Translation Policy filtering and kept the split of the FieldSet as discussed.
Thank you very much for your time, review, and patience! I really appreciate it!

@pheus pheus requested a review from jeremystretch April 15, 2025 16:19
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.

Thanks @pheus!

@jeremystretch jeremystretch merged commit 1f93471 into netbox-community:main Apr 15, 2025
3 checks passed
@pheus pheus deleted the 18978-allow-filtering-of-interface-by-802-1q branch April 15, 2025 18:02
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

allow filtering of interfaces in the gui by 802.1Q Mode
2 participants