mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 21:45:26 +08:00
DEV: the ability to define setting areas (#28570)
A new setting attribute is used to define the areas (separated by `|`). In addition, endpoint `/admin/config/site_settings.json` accepts new `filter_area` data.
This commit is contained in:

committed by
GitHub

parent
050c665160
commit
7577231ba2
@ -12,12 +12,15 @@ class Admin::Config::SiteSettingsController < Admin::AdminController
|
||||
# UI itself uses the Admin::SiteSettingsController#index endpoint,
|
||||
# which also supports a `category` and `plugin` filter.
|
||||
def index
|
||||
params.require(:filter_names)
|
||||
if params[:filter_names].blank? && SiteSetting::VALID_AREAS.exclude?(params[:filter_area])
|
||||
raise Discourse::InvalidParameters
|
||||
end
|
||||
|
||||
render_json_dump(
|
||||
site_settings:
|
||||
SiteSetting.all_settings(
|
||||
filter_names: params[:filter_names],
|
||||
filter_area: params[:filter_area],
|
||||
include_locale_setting: false,
|
||||
include_hidden: true,
|
||||
filter_allowed_hidden: ADMIN_CONFIG_AREA_ALLOWLISTED_HIDDEN_SETTINGS,
|
||||
|
Reference in New Issue
Block a user