Skip to content

Object Selector View pre-selected filter choices #19718

@PaulLocksley

Description

@PaulLocksley

NetBox version

v4.3.2

Feature type

Change to existing functionality

Proposed functionality

I would like the Object Selector View to have configurable default search fields.

I believe this can be done via allowing admins to extend the selector_fields attributes in filterset_forms, similar to how admins can extend table default views.

This may be configured via a new setting such as DEFAULT_OBJECT_SELECTION_FIELDS
and look something like

DEFAULT_OBJECT_SELECTION_FIELDS = {
    'dcim.Site': [
        'filter_id'. 'q', 'region_id', 'group_id', 'cf_custom_field_name'
    ]
}

Resulting in the effective selection value:

class SiteFilterForm(TenancyFilterForm, ContactModelFilterForm, NetBoxModelFilterSetForm):
    model = Site
    ...
    selector_fields = ('filter_id', 'q', 'region_id', 'group_id','cf_custom_field_name')

and the ui presented to the user:

Image

Use case

My team has a custom field we use when selecting sites often, this would smooth out the workflow and let as add the 'cf_custom_field' selector as a default option improving user experience.

Database changes

None

External dependencies

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending closureRequires immediate attention to avoid being closed for inactivitystatus: revisions neededThis issue requires additional information to be actionabletype: featureIntroduction of new functionality to the application

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions