mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Remove support for legacy navigation menu (#23752)
Why this change? Back in May 17 2023 along with the release of Discourse 3.1, we announced on meta that the legacy hamburger dropdown navigation menu is deprecated and will be dropped in Discourse 3.2. This is the link to the announcement on meta: https://meta.discourse.org/t/removing-the-legacy-hamburger-navigation-menu-option/265274 ## What does this change do? This change removes the `legacy` option from the `navigation_menu` site setting and migrates existing sites on the `legacy` option to the `header dropdown` option. All references to the `legacy` option in code and tests have been removed as well.
This commit is contained in:
committed by
GitHub
parent
2c346a1ba6
commit
832b3b9e60
@@ -207,8 +207,7 @@ class AdminDashboardData
|
||||
:unreachable_themes,
|
||||
:watched_words_check,
|
||||
:google_analytics_version_check,
|
||||
:translation_overrides_check,
|
||||
:legacy_navigation_menu_check
|
||||
:translation_overrides_check
|
||||
|
||||
register_default_scheduled_problem_checks
|
||||
|
||||
@@ -368,12 +367,6 @@ class AdminDashboardData
|
||||
end
|
||||
end
|
||||
|
||||
def legacy_navigation_menu_check
|
||||
if SiteSetting.navigation_menu == "legacy"
|
||||
I18n.t("dashboard.legacy_navigation_menu_deprecated", base_path: Discourse.base_path)
|
||||
end
|
||||
end
|
||||
|
||||
def image_magick_check
|
||||
if SiteSetting.create_thumbnails && !system("command -v convert >/dev/null;")
|
||||
I18n.t("dashboard.image_magick_warning")
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
class NavigationMenuSiteSetting < EnumSiteSetting
|
||||
SIDEBAR = "sidebar"
|
||||
HEADER_DROPDOWN = "header dropdown"
|
||||
LEGACY = "legacy"
|
||||
|
||||
def self.valid_value?(val)
|
||||
values.any? { |v| v[:value] == val }
|
||||
@@ -13,7 +12,6 @@ class NavigationMenuSiteSetting < EnumSiteSetting
|
||||
@values ||= [
|
||||
{ name: "admin.navigation_menu.sidebar", value: SIDEBAR },
|
||||
{ name: "admin.navigation_menu.header_dropdown", value: HEADER_DROPDOWN },
|
||||
{ name: "admin.navigation_menu.legacy", value: LEGACY },
|
||||
]
|
||||
end
|
||||
|
||||
|
||||
@@ -257,10 +257,6 @@ class SiteSetting < ActiveRecord::Base
|
||||
c.present? && c.to_i != SiteSetting.uncategorized_category_id.to_i
|
||||
end
|
||||
|
||||
def self.legacy_navigation_menu?
|
||||
SiteSetting.navigation_menu == "legacy"
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def self.clear_cache!
|
||||
|
||||
@@ -43,7 +43,7 @@ class TopicTrackingState
|
||||
return unless topic.regular?
|
||||
|
||||
tag_ids, tags = nil
|
||||
tag_ids, tags = topic.tags.pluck(:id, :name).transpose if SiteSetting.tagging_enabled
|
||||
tag_ids, tags = topic.tags.pluck(:id, :name).transpose if include_tags_in_report?
|
||||
|
||||
payload = {
|
||||
last_read_post_number: nil,
|
||||
@@ -71,7 +71,7 @@ class TopicTrackingState
|
||||
return unless topic.regular?
|
||||
|
||||
tag_ids, tags = nil
|
||||
tag_ids, tags = topic.tags.pluck(:id, :name).transpose if SiteSetting.tagging_enabled
|
||||
tag_ids, tags = topic.tags.pluck(:id, :name).transpose if include_tags_in_report?
|
||||
|
||||
message = {
|
||||
topic_id: topic.id,
|
||||
@@ -276,11 +276,7 @@ class TopicTrackingState
|
||||
end
|
||||
|
||||
def self.include_tags_in_report?
|
||||
SiteSetting.tagging_enabled && (@include_tags_in_report || !SiteSetting.legacy_navigation_menu?)
|
||||
end
|
||||
|
||||
def self.include_tags_in_report=(v)
|
||||
@include_tags_in_report = v
|
||||
SiteSetting.tagging_enabled
|
||||
end
|
||||
|
||||
# Sam: this is a hairy report, in particular I need custom joins and fancy conditions
|
||||
@@ -340,7 +336,7 @@ class TopicTrackingState
|
||||
end
|
||||
|
||||
def self.tags_included_wrapped_sql(sql)
|
||||
return <<~SQL if SiteSetting.tagging_enabled && TopicTrackingState.include_tags_in_report?
|
||||
return <<~SQL if include_tags_in_report?
|
||||
WITH tags_included_cte AS (
|
||||
#{sql}
|
||||
)
|
||||
|
||||
@@ -2048,7 +2048,6 @@ class User < ActiveRecord::Base
|
||||
private
|
||||
|
||||
def set_default_sidebar_section_links(update: false)
|
||||
return if SiteSetting.legacy_navigation_menu?
|
||||
return if staged? || bot?
|
||||
|
||||
if SiteSetting.default_navigation_menu_categories.present?
|
||||
|
||||
Reference in New Issue
Block a user