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

Enable subproject filters for projects with subprojects #11674

Merged
merged 6 commits into from
Oct 15, 2024

Conversation

ericholscher
Copy link
Member

This at least shows the UI element if it makes sense to show.
Currently there's no way without knowing the query syntax to get subprojects,
which has caused confusion for a few of our users and broke existing behavior.

Refs #11638

This at least shows the UI element if it makes sense to show.
Currently there's no way without knowing the query syntax to get subprojects,
which has caused confusion for a few of our users and broke existing behavior.

Refs #11638
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.

Looks good for a temporary solution. It needs small tweaks before merging, tho.

readthedocs/proxito/views/hosting.py Outdated Show resolved Hide resolved
superproject = project.superprojects.first().parent
data["addons"]["search"]["filters"].append(
[
"Include subprojects",
Copy link
Member

Choose a reason for hiding this comment

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

If you are reading a subproject, you want to get results from sibling projects -- since subprojects don't have other subprojects, but sibling ones.

Suggested change
"Include subprojects",
"Include sibling projects",

Copy link
Member Author

@ericholscher ericholscher Oct 15, 2024

Choose a reason for hiding this comment

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

I think subprojects is fine for the text here to not confuse users. If I go from a parent project to a subproject, it will be weird to have the text copy change in that case -- they are still "subprojects" in a certain sense, and I think keeping the UX the same makes it clearer.

readthedocs/proxito/views/hosting.py Outdated Show resolved Hide resolved
@ericholscher ericholscher enabled auto-merge (squash) October 15, 2024 14:19
@ericholscher ericholscher merged commit 4f1f82f into main Oct 15, 2024
5 checks passed
@ericholscher ericholscher deleted the show-subproject-filter-if-subprojects branch October 15, 2024 14:20
f"subprojects:{project.slug}/{version.slug}",
]
)
if project.superprojects.exists():
Copy link
Member

Choose a reason for hiding this comment

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

This can save one query, since a project can't be both, a superproject and subproject.

Suggested change
if project.superprojects.exists():
elif project.superprojects.exists():

Copy link
Member Author

Choose a reason for hiding this comment

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

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.

3 participants