mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 21:02:48 +08:00
DEV: Move sidebar site settings to the sidebar category (#18596)
Sidebar category is only shown in the admin panel when `enable_experimental_sidebar_hamburger` site setting is enabled
This commit is contained in:
parent
3d59f767ae
commit
d1304ecb46
|
@ -2033,6 +2033,18 @@ developer:
|
||||||
default: false
|
default: false
|
||||||
client: true
|
client: true
|
||||||
hidden: true
|
hidden: true
|
||||||
|
enable_new_user_profile_nav_groups:
|
||||||
|
client: true
|
||||||
|
type: group_list
|
||||||
|
list_type: compact
|
||||||
|
default: ""
|
||||||
|
allow_any: false
|
||||||
|
refresh: true
|
||||||
|
include_associated_account_ids:
|
||||||
|
default: false
|
||||||
|
hidden: true
|
||||||
|
|
||||||
|
sidebar:
|
||||||
enable_sidebar:
|
enable_sidebar:
|
||||||
default: true
|
default: true
|
||||||
client: true
|
client: true
|
||||||
|
@ -2044,16 +2056,6 @@ developer:
|
||||||
type: tag_list
|
type: tag_list
|
||||||
default: ""
|
default: ""
|
||||||
client: true
|
client: true
|
||||||
enable_new_user_profile_nav_groups:
|
|
||||||
client: true
|
|
||||||
type: group_list
|
|
||||||
list_type: compact
|
|
||||||
default: ""
|
|
||||||
allow_any: false
|
|
||||||
refresh: true
|
|
||||||
include_associated_account_ids:
|
|
||||||
default: false
|
|
||||||
hidden: true
|
|
||||||
|
|
||||||
embedding:
|
embedding:
|
||||||
embed_by_username:
|
embed_by_username:
|
||||||
|
|
|
@ -234,9 +234,15 @@ module SiteSettingExtension
|
||||||
}
|
}
|
||||||
|
|
||||||
defaults.all(default_locale)
|
defaults.all(default_locale)
|
||||||
.reject { |s, _| !include_hidden && hidden_settings.include?(s) }
|
.reject do |setting_name, _|
|
||||||
.map do |s, v|
|
if !include_hidden && hidden_settings.include?(setting_name)
|
||||||
|
true
|
||||||
|
elsif categories[setting_name].to_s == "sidebar" && !SiteSetting.enable_experimental_sidebar_hamburger
|
||||||
|
true
|
||||||
|
else
|
||||||
|
false
|
||||||
|
end
|
||||||
|
end.map do |s, v|
|
||||||
type_hash = type_supervisor.type_hash(s)
|
type_hash = type_supervisor.type_hash(s)
|
||||||
default = defaults.get(s, default_locale).to_s
|
default = defaults.get(s, default_locale).to_s
|
||||||
|
|
||||||
|
|
|
@ -832,4 +832,24 @@ RSpec.describe SiteSettingExtension do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'sidebar category site settings' do
|
||||||
|
describe '.all_settings' do
|
||||||
|
before do
|
||||||
|
settings.setting(:test_setting, 88, category: :sidebar)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'does not include the sidebar category setting when enable_experimental_sidebar_hamburger site setting is disabled' do
|
||||||
|
SiteSetting.enable_experimental_sidebar_hamburger = false
|
||||||
|
|
||||||
|
expect(settings.all_settings.detect { |s| s[:setting] == :test_setting }).to eq(nil)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'includes the sidebar category setting when enable_experimental_sidebar_hamburger site setting is enabled' do
|
||||||
|
SiteSetting.enable_experimental_sidebar_hamburger = true
|
||||||
|
|
||||||
|
expect(settings.all_settings.detect { |s| s[:setting] == :test_setting }[:setting]).to eq(:test_setting)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user