FIX: Topic list nav items count not respecting tracked filter. (#16935)

This commit seeks to only handle the `f=tracked` and `filter=tracked`
query params for a topic list. There are other "hidden" filters for a
topic list which can be activated by passing the right query param to
the request. However, they are hidden because there is no way to
activate those filters via the UI. We are handling the `f=tracked`
filter because we will soon be adding a link that allows a user to
quickly view their tracked topics.
This commit is contained in:
Alan Guo Xiang Tan
2022-06-01 14:54:42 +08:00
committed by GitHub
parent 098bea19de
commit 1e9f132b15
13 changed files with 582 additions and 51 deletions

View File

@ -345,6 +345,9 @@ class TopicQuery
regular: TopicUser.notification_levels[:regular], tracking: TopicUser.notification_levels[:tracking])
end
# Any changes here will need to be reflected in `lib/topic-list-tracked-filter.js` for the `isTrackedTopic` function on
# the client side. The `f=tracked` query param is not heavily used so we do not want to be querying for a topic's
# tracked status by default. Instead, the client will handle the filtering when the `f=tracked` query params is present.
def self.tracked_filter(list, user_id)
tracked_category_ids_sql = <<~SQL
SELECT cd.category_id FROM category_users cd