FEATURE: Allow site settings to be edited throughout admin UI (#26154)

This commit makes it so the site settings filter controls and
the list of settings input editors themselves can be used elsewhere
in the admin UI outside of /admin/site_settings

This allows us to provide more targeted groups of settings in different
UI areas where it makes sense to provide them, such as on plugin pages.
You could open a single page for a plugin where you can see information
about that plugin, change settings, and configure it with custom UIs
in the one place.

In future we will do this in "config areas" for other parts of the
admin UI.
This commit is contained in:
Martin Brennan
2024-03-18 08:50:39 +10:00
committed by GitHub
parent d0d659e733
commit 78bafb331a
20 changed files with 532 additions and 262 deletions

View File

@ -0,0 +1,14 @@
# frozen_string_literal: true
RSpec.describe SiteSettingExtension do
describe "#all_settings" do
it "allows filtering settings by plugin via filter_plugin" do
settings = YAML.safe_load(File.read(Rails.root.join("plugins/chat/config/settings.yml")))
expect(
SiteSetting
.all_settings(include_hidden: true, filter_plugin: "chat")
.map { |s| s[:setting] },
).to match_array(settings["chat"].keys.map(&:to_sym))
end
end
end