-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Conversation
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
There was a problem hiding this 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
superproject = project.superprojects.first().parent | ||
data["addons"]["search"]["filters"].append( | ||
[ | ||
"Include subprojects", |
There was a problem hiding this comment.
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.
"Include subprojects", | |
"Include sibling projects", |
There was a problem hiding this comment.
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.
Co-authored-by: Manuel Kaufmann <[email protected]>
f"subprojects:{project.slug}/{version.slug}", | ||
] | ||
) | ||
if project.superprojects.exists(): |
There was a problem hiding this comment.
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.
if project.superprojects.exists(): | |
elif project.superprojects.exists(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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