Skip to content

Remove Archived contacts from connections field options #2775

@cairocoder01

Description

@cairocoder01

Is your feature request related to a problem? Please describe.
When adding a member to a group, searching through connections returns even archived contacts. When many contacts have been archived in a system either because of duplicates or other issues, the archived items fill up the list needlessly.

Image

Describe the solution you'd like
Since normal users don't have the ability to fully delete records, archiving is the equivalent, so those records shouldn't be shown in the connections list.

Technically, those fields use the /wp-json/dt-posts/v2/{post-type}/compact?s= endpoint. We should add a query parameter for whether to include archived posts or not. I would love if it did NOT include them by default and you had to add &archived=1 in order to include them, but I know there's a chance that breaks some other functionality. I'm option to have to add &archived=0 in order to remove them from the list.

Describe alternatives you've considered
Some sort of toggle on connection fields for archived posts, but that's complicated and I don't know a use case where users would want to get archived posts. If there is a case somewhere in a specific view, it's probably related to the context around that view/page and it could be adjusted programmatically. It might be helpful to have an attribute on the dt-connections component that would include/exclude archived items and that would map to the query parameter on the API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions