mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
DEV: Introduce enable_new_notifications_menu
site setting (#19860)
The `enable_new_notifications_menu` site setting allows sites that have `navigation_menu` set to `legacy` to use the redesigned notifications menu before switching to the new sidebar navigation menu.
This commit is contained in:

committed by
GitHub

parent
9ed4550b86
commit
f72875c729
15
lib/validators/enable_new_notifications_menu_validator.rb
Normal file
15
lib/validators/enable_new_notifications_menu_validator.rb
Normal file
@ -0,0 +1,15 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class EnableNewNotificationsMenuValidator
|
||||
def initialize(opts = {})
|
||||
end
|
||||
|
||||
def valid_value?(value)
|
||||
return true if value == "f"
|
||||
SiteSetting.navigation_menu == "legacy"
|
||||
end
|
||||
|
||||
def error_message
|
||||
I18n.t("site_settings.errors.enable_new_notifications_menu_not_legacy_navigation_menu")
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user