Skip to content
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

Change version filter to allow substrings #11258

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ericholscher
Copy link
Member

This makes it a bit nicer to see more versions in an easy way.

This makes it a bit nicer to see more versions in an easy way.
@ericholscher ericholscher requested a review from a team as a code owner April 1, 2024 16:17
@agjohnson
Copy link
Contributor

What was the use case for this change? I'm curious where you are hitting this, as the version filters do already support substring lookup and always use the full slug for filtering.

I'm not opposed to allowing optional substring lookup for filtering, but we shouldn't use icontains by default for the filters because there are some UIs that link to the version/project listing view with a specific version in the filter. Using substring lookup would display unexpected versions in this case.

This particular filter does need to be updated and have the API interaction removed, but the UX will still be similar, and should already support substrings from the front end:

Screencast.from.2024-04-04.08-37-01.webm

@ericholscher
Copy link
Member Author

ericholscher commented Apr 4, 2024

I want to be able to send someone a link that filters the versions by a substring, or some other way of easily showing a set of versions to someone.

Something like: https://beta.readthedocs.org/projects/test-builds/?version=build-tools-

@agjohnson
Copy link
Contributor

Gotcha, yeah that would be handy. We can add a new filter for the separate lookup expression instead, ie:

https://beta.readthedocs.org/projects/test-builds/?version__icontains=build-tools-

I think either the project or build filters have multiple lookup expressions for a single field, but if not, it looks like the examples here:

https://django-filter.readthedocs.io/en/stable/guide/usage.html#declaring-filters

Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just marking this as request changes to not merge by mistake. It seems we want to add a new filter here version__icontains

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants