Skip to content

Commit a5c8107

Browse files
authored
Addons: disable search filters for now (#11638)
* 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
1 parent 16c57fe commit a5c8107

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

readthedocs/proxito/tests/responses/v1.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,7 @@
156156
"search": {
157157
"enabled": true,
158158
"default_filter": "project:project/latest",
159-
"filters": [
160-
["Include subprojects", "subprojects:project/latest"]
161-
]
159+
"filters": []
162160
}
163161
}
164162
}

readthedocs/proxito/views/hosting.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -477,12 +477,22 @@ def _v1(self, project, version, build, filename, url, request):
477477
},
478478
"search": {
479479
"enabled": project.addons.search_enabled,
480-
# TODO: figure it out where this data comes from
480+
# TODO: figure it out where this data comes from.
481+
#
482+
# Originally, this was thought to be customizable by the user
483+
# adding these filters from the Admin UI.
484+
#
485+
# I'm removing this feature for now until we implement it correctly.
481486
"filters": [
482-
[
483-
"Include subprojects",
484-
f"subprojects:{project.slug}/{version.slug}",
485-
],
487+
# NOTE: this is an example of the structure of the this object.
488+
# It contains the name of the filter and the search syntax to prepend
489+
# to the user's query.
490+
# It uses "Search query sintax":
491+
# https://docs.readthedocs.io/en/stable/server-side-search/syntax.html
492+
# [
493+
# "Include subprojects",
494+
# f"subprojects:{project.slug}/{version.slug}",
495+
# ],
486496
]
487497
if version
488498
else [],

0 commit comments

Comments
 (0)