[PR #14387] [MERGED] Fixes #12751 - Usability improvements for object selector #14380

Closed
opened 2025-12-29 23:24:09 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/14387
Author: @kkthxbye-code
Created: 11/30/2023
Status: Merged
Merged: 12/15/2023
Merged by: @jeremystretch

Base: developHead: 12751-usability-improvements


📝 Commits (2)

  • b5e2ffb Usability improvements for object selector:
  • d788f44 Declare selector_fields on base form class

📊 Changes

9 files changed (+27 additions, -5 deletions)

View changed files

📝 netbox/circuits/forms/filtersets.py (+1 -0)
📝 netbox/dcim/forms/filtersets.py (+8 -0)
📝 netbox/ipam/forms/filtersets.py (+2 -0)
📝 netbox/netbox/forms/base.py (+4 -0)
📝 netbox/project-static/dist/netbox.js (+1 -1)
📝 netbox/project-static/dist/netbox.js.map (+1 -1)
📝 netbox/project-static/src/select/api/apiSelect.ts (+5 -0)
📝 netbox/templates/htmx/object_selector.html (+3 -3)
📝 netbox/virtualization/forms/filtersets.py (+2 -0)

📄 Description

Fixes: #12751

  • Adds preselected filters
  • Applies the filter on selection instead of requiring the search button to be clicked.

The typescript change was because of a bug that was also present for the Saved Filter field. If a collapsible field is defaulted to be shown, the list will not populate when opening like it is supposed to, but only when the user starts typing.

I was a bit uncertain about the selector_fields name, selector_default or selector_default_fields might be better. Feedback appreciated.

The default fields were taken from the initial PR adding selector fields. I looked at what fields were removed from the forms and added them as pre-selected fields.


🔄 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/14387 **Author:** [@kkthxbye-code](https://github.com/kkthxbye-code) **Created:** 11/30/2023 **Status:** ✅ Merged **Merged:** 12/15/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `12751-usability-improvements` --- ### 📝 Commits (2) - [`b5e2ffb`](https://github.com/netbox-community/netbox/commit/b5e2ffb67ebdcb7dcb8538d0641dc395a4a1dbbe) Usability improvements for object selector: - [`d788f44`](https://github.com/netbox-community/netbox/commit/d788f44ebf231a79268991b2004d67b3b9fb36e8) Declare selector_fields on base form class ### 📊 Changes **9 files changed** (+27 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `netbox/circuits/forms/filtersets.py` (+1 -0) 📝 `netbox/dcim/forms/filtersets.py` (+8 -0) 📝 `netbox/ipam/forms/filtersets.py` (+2 -0) 📝 `netbox/netbox/forms/base.py` (+4 -0) 📝 `netbox/project-static/dist/netbox.js` (+1 -1) 📝 `netbox/project-static/dist/netbox.js.map` (+1 -1) 📝 `netbox/project-static/src/select/api/apiSelect.ts` (+5 -0) 📝 `netbox/templates/htmx/object_selector.html` (+3 -3) 📝 `netbox/virtualization/forms/filtersets.py` (+2 -0) </details> ### 📄 Description ### Fixes: #12751 * Adds preselected filters * Applies the filter on selection instead of requiring the search button to be clicked. The typescript change was because of a bug that was also present for the Saved Filter field. If a collapsible field is defaulted to be shown, the list will not populate when opening like it is supposed to, but only when the user starts typing. I was a bit uncertain about the `selector_fields` name, `selector_default` or `selector_default_fields` might be better. Feedback appreciated. The default fields were taken from the initial PR adding selector fields. I looked at what fields were removed from the forms and added them as pre-selected fields. --- <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-29 23:24:09 +01:00
adam closed this issue 2025-12-29 23:24:09 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14380