mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 16:29:32 +08:00
FIX: Site's top tags not shown for anonymous user (#22219)
When a site does not have `default_navigation_menu_tags` site setting set, anonymous users should be shown the site's top tags as a default in the tags section. However, this regressed in 9fad71809c254752479b0faf4f23ba197e742e60 and we ended up showing anonymous users a tags section with only the `All Tags` section link. As part of this commit, I have also refactored the QUnit acceptance tests to system tests which are much easier to work with.
This commit is contained in:

committed by
GitHub

parent
547b520261
commit
f5af4936d4
@ -251,12 +251,14 @@ class SiteSerializer < ApplicationSerializer
|
||||
end
|
||||
|
||||
def anonymous_default_navigation_menu_tags
|
||||
SiteSetting.default_navigation_menu_tags.split("|") - DiscourseTagging.hidden_tag_names(scope)
|
||||
@anonymous_default_navigation_menu_tags ||=
|
||||
SiteSetting.default_navigation_menu_tags.split("|") - DiscourseTagging.hidden_tag_names(scope)
|
||||
end
|
||||
|
||||
def include_anonymous_default_navigation_menu_tags?
|
||||
scope.anonymous? && !SiteSetting.legacy_navigation_menu? && SiteSetting.tagging_enabled &&
|
||||
SiteSetting.default_navigation_menu_tags.present?
|
||||
SiteSetting.default_navigation_menu_tags.present? &&
|
||||
anonymous_default_navigation_menu_tags.present?
|
||||
end
|
||||
|
||||
def anonymous_sidebar_sections
|
||||
|
Reference in New Issue
Block a user