Skip to content

Commit

Permalink
Addons: disable search filters for now (#11638)
Browse files Browse the repository at this point in the history
* Addons: disable search filters for now

I'm disabling search filters until we implement the Admin UI page to customize
them.

It requires readthedocs/addons#391

* Update tests
  • Loading branch information
humitos authored Oct 8, 2024
1 parent 16c57fe commit a5c8107
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
4 changes: 1 addition & 3 deletions readthedocs/proxito/tests/responses/v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,7 @@
"search": {
"enabled": true,
"default_filter": "project:project/latest",
"filters": [
["Include subprojects", "subprojects:project/latest"]
]
"filters": []
}
}
}
20 changes: 15 additions & 5 deletions readthedocs/proxito/views/hosting.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,12 +477,22 @@ def _v1(self, project, version, build, filename, url, request):
},
"search": {
"enabled": project.addons.search_enabled,
# TODO: figure it out where this data comes from
# TODO: figure it out where this data comes from.
#
# Originally, this was thought to be customizable by the user
# adding these filters from the Admin UI.
#
# I'm removing this feature for now until we implement it correctly.
"filters": [
[
"Include subprojects",
f"subprojects:{project.slug}/{version.slug}",
],
# NOTE: this is an example of the structure of the this object.
# It contains the name of the filter and the search syntax to prepend
# to the user's query.
# It uses "Search query sintax":
# https://docs.readthedocs.io/en/stable/server-side-search/syntax.html
# [
# "Include subprojects",
# f"subprojects:{project.slug}/{version.slug}",
# ],
]
if version
else [],
Expand Down

0 comments on commit a5c8107

Please sign in to comment.