discourse/app/models/navigation_menu_site_setting.rb
Alan Guo Xiang Tan 832b3b9e60
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.
2023-10-09 07:24:10 +08:00

22 lines
461 B
Ruby

# frozen_string_literal: true
class NavigationMenuSiteSetting < EnumSiteSetting
SIDEBAR = "sidebar"
HEADER_DROPDOWN = "header dropdown"
def self.valid_value?(val)
values.any? { |v| v[:value] == val }
end
def self.values
@values ||= [
{ name: "admin.navigation_menu.sidebar", value: SIDEBAR },
{ name: "admin.navigation_menu.header_dropdown", value: HEADER_DROPDOWN },
]
end
def self.translate_names?
true
end
end