Fixes #12751 - Usability improvements for object selector (#14387)

* Usability improvements for object selector:
* Adds preselected filters
* Applies the filter on selection instead of requiring the search button to be pushed

* Declare selector_fields on base form class

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
kkthxbye
2023-12-15 22:07:15 +01:00
committed by GitHub
parent c81869c795
commit 8d39181842
9 changed files with 27 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -264,6 +264,11 @@ export class APISelect {
switch (this.trigger) {
case 'collapse':
if (collapse !== null) {
// If the element is collapsible but already shown, load the data immediately.
if (collapse.classList.contains('show')) {
Promise.all([this.loadData()]);
}
// If this element is part of a collapsible element, only load the data when the
// collapsible element is shown.
// See: https://getbootstrap.com/docs/5.0/components/collapse/#events