UX: Admin setting page consistency - Group permissions (#30528) (#30578)

* UX: Admin setting page consistency - Group permissions (#30528)

Followup c2282439b3 and
21470e4afd

Adds a new "Group permissions" page and group_permissions site
setting area, which shows every single group-based site setting
in the app and core plugins.

Also adds a "trust_levels" area to show on the already moved
admin "Trust level" settings page, since that previously was
showing a mix of trust level settings and allowed group settings.

* DEV: Review fixes
This commit is contained in:
Martin Brennan 2025-01-07 11:25:21 +10:00 committed by GitHub
parent fd909dd348
commit 30be75460f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 168 additions and 21 deletions

View File

@ -0,0 +1,3 @@
import AdminAreaSettingsBaseController from "admin/controllers/admin-area-settings-base";
export default class AdminConfigGroupPermissionsSettingsController extends AdminAreaSettingsBaseController {}

View File

@ -0,0 +1,8 @@
import DiscourseRoute from "discourse/routes/discourse";
import { i18n } from "discourse-i18n";
export default class AdminConfigGroupPermissionsRoute extends DiscourseRoute {
titleToken() {
return i18n("admin.community.sidebar_link.group_permissions");
}
}

View File

@ -241,6 +241,15 @@ export default function () {
path: "/",
});
});
this.route(
"groupPermissions",
{ path: "/group-permissions" },
function () {
this.route("settings", {
path: "/",
});
}
);
this.route("trustLevels", { path: "/trust-levels" }, function () {
this.route("settings", {
path: "/",

View File

@ -0,0 +1,31 @@
import RouteTemplate from "ember-route-template";
import DBreadcrumbsItem from "discourse/components/d-breadcrumbs-item";
import DPageHeader from "discourse/components/d-page-header";
import { i18n } from "discourse-i18n";
import AdminAreaSettings from "admin/components/admin-area-settings";
export default RouteTemplate(<template>
<DPageHeader
@titleLabel={{i18n "admin.config.group_permissions.title"}}
@descriptionLabel={{i18n
"admin.config.group_permissions.header_description"
}}
>
<:breadcrumbs>
<DBreadcrumbsItem @path="/admin" @label={{i18n "admin_title"}} />
<DBreadcrumbsItem
@path="/admin/config/group-permissions"
@label={{i18n "admin.config.group_permissions.title"}}
/>
</:breadcrumbs>
</DPageHeader>
<div class="admin-config-page__main-area">
<AdminAreaSettings
@area="group_permissions"
@path="/admin/config/group-permissions"
@filter={{@controller.filter}}
@adminSettingsFilterChangedCallback={{@controller.adminSettingsFilterChangedCallback}}
/>
</div>
</template>);

View File

@ -14,7 +14,7 @@
<div class="admin-config-page__main-area">
<AdminAreaSettings
@categories="trust"
@area="trust_levels"
@path="/admin/config/trust-levels"
@filter={{this.filter}}
@adminSettingsFilterChangedCallback={{this.adminSettingsFilterChangedCallback}}

View File

@ -64,6 +64,12 @@ export const ADMIN_NAV_MAP = [
label: "admin.community.sidebar_link.trust_levels",
icon: "user-shield",
},
{
name: "admin_group_permissions",
route: "adminConfig.groupPermissions.settings",
label: "admin.community.sidebar_link.group_permissions",
icon: "user-gear",
},
{
name: "admin_user_fields",
route: "adminUserFields",

View File

@ -1,7 +1,19 @@
# frozen_string_literal: true
class SiteSetting < ActiveRecord::Base
VALID_AREAS = %w[about embedding emojis flags fonts legal navigation notifications permalinks]
VALID_AREAS = %w[
about
embedding
emojis
flags
fonts
group_permissions
legal
navigation
notifications
permalinks
trust_levels
]
extend GlobalPath
extend SiteSettingExtension

View File

@ -5136,28 +5136,31 @@ en:
config:
font_style:
title: "Font style"
header_description: "Customize the font styles used by your themes."
header_description: "Customize the font styles used by your themes"
login_and_authentication:
title: "Login and authentication"
header_description: "Configure how users log in and authenticate, secrets and keys, OAuth2 providers, and more."
header_description: "Configure how users log in and authenticate, secrets and keys, OAuth2 providers, and more"
logo:
title: "Site logo"
header_description: "Customize the variations of your site logo."
header_description: "Customize the variations of your site logo"
navigation:
title: "Navigation"
header_description: "Configure the navigation links and menu items for your site. This includes the location and behaviour of the primary navigation menu, the quick links at the top of the homepage, as well as the admin sidebar."
notifications:
title: "Notifications"
header_description: "Configure how notifications are managed and delivered for users, including email preferences, push notifications, mention limits, and notification consolidation."
header_description: "Configure how notifications are managed and delivered for users, including email preferences, push notifications, mention limits, and notification consolidation"
search:
title: "Search"
header_description: "Configure search settings including logging and tokenization for Chinese and Japanese languages."
header_description: "Configure search settings including logging and tokenization for Chinese and Japanese languages"
legal:
title: "Legal"
header_description: "Configure legal settings, such as terms of service, privacy policy, contact details, and EU-specific considerations."
header_description: "Configure legal settings, such as terms of service, privacy policy, contact details, and EU-specific considerations"
trust_levels:
title: "Trust levels"
header_description: "Trust level settings allow you to fine-tune the requirements and notifications for your communitys progression system, which automatically promotes users to higher trust levels as they demonstrate consistent, positive engagement with your forum."
header_description: "Trust level settings allow you to fine-tune the requirements and notifications for your communitys progression system, which automatically promotes users to higher trust levels as they demonstrate consistent, positive engagement with your forum"
group_permissions:
title: "Group permissions"
header_description: "All group-based app permissions are managed here, which control access to various features within Discourse"
new_features:
title: "What's new?"
@ -5636,6 +5639,7 @@ en:
notifications: "Notifications"
permalinks: "Permalinks"
trust_levels: "Trust levels"
group_permissions: "Group permissions"
users: "Users"
groups: "Groups"
user_fields: "User fields"

View File

@ -401,6 +401,7 @@ Discourse::Application.routes.draw do
get "search" => "site_settings#index"
get "legal" => "site_settings#index"
get "trust-levels" => "site_settings#index"
get "group-permissions" => "site_settings#index"
resources :flags, only: %i[index new create update destroy] do
put "toggle"

View File

@ -367,12 +367,14 @@ basic:
default: ""
allow_any: false
refresh: true
area: "group_permissions"
hidden_post_visible_groups:
type: group_list
list_type: compact
default: "14"
allow_any: false
refresh: true
area: "group_permissions"
push_notifications_prompt:
default: true
client: true
@ -437,6 +439,7 @@ basic:
about_page_hidden_groups:
default: ""
type: group_list
area: "group_permissions"
adobe_analytics_tags_url:
default: ""
regex: "assets.adobedtm.com"
@ -784,6 +787,7 @@ users:
allow_any: false
refresh: true
validator: "AtLeastOneGroupValidator"
area: "group_permissions"
anonymous_account_duration_minutes:
default: 10080
max: 99000
@ -976,6 +980,7 @@ posting:
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
editing_grace_period: 300
editing_grace_period_max_diff: 100
editing_grace_period_max_diff_high_trust: 400
@ -993,6 +998,7 @@ posting:
allow_any: false
refresh: true
validator: "AtLeastOneGroupValidator"
area: "group_permissions"
post_edit_time_limit:
default: 1440
max: 10080
@ -1075,6 +1081,7 @@ posting:
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
title_max_word_length:
default: 30
locale_default:
@ -1190,6 +1197,7 @@ posting:
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
approve_new_topics_unless_trust_level:
default: 0
enum: "TrustLevelSetting"
@ -1200,6 +1208,7 @@ posting:
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
approve_suspect_users:
default: true
approve_unless_staged:
@ -1293,6 +1302,7 @@ posting:
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
blur_tl0_flagged_posts_media:
default: true
client: true
@ -1416,6 +1426,7 @@ email:
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
email_in_authserv_id:
default: ""
email_in_spam_header:
@ -1572,6 +1583,7 @@ email:
default: "1|2"
allow_any: false
refresh: true
area: "group_permissions"
files:
max_image_size_kb:
@ -1723,10 +1735,11 @@ files:
enum: "TrustLevelAndStaffAndDisabledSetting"
hidden: true
uploaded_avatars_allowed_groups:
default: 10
default: "10"
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
default_avatars:
default: ""
type: url_list
@ -1844,9 +1857,11 @@ trust:
default_trust_level:
default: 0
enum: "TrustLevelSetting"
area: "trust_levels"
default_invitee_trust_level:
default: 1
enum: "TrustLevelSetting"
area: "trust_levels"
min_trust_to_create_topic:
default: 0
enum: "TrustLevelSetting"
@ -1857,6 +1872,7 @@ trust:
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
min_trust_to_edit_wiki_post:
default: 1
enum: "TrustLevelSetting"
@ -1867,6 +1883,7 @@ trust:
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
min_trust_to_edit_post:
default: 0
enum: "TrustLevelSetting"
@ -1877,6 +1894,7 @@ trust:
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
min_trust_to_allow_self_wiki:
default: 3
enum: "TrustLevelSetting"
@ -1887,6 +1905,7 @@ trust:
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
min_trust_to_send_email_messages:
default: "4"
enum: "TrustLevelAndStaffSetting"
@ -1897,6 +1916,7 @@ trust:
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
min_trust_to_flag_posts:
default: 1
enum: "TrustLevelSetting"
@ -1907,6 +1927,7 @@ trust:
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
min_trust_to_post_links:
default: 0
enum: "TrustLevelSetting"
@ -1917,6 +1938,7 @@ trust:
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
min_trust_to_post_embedded_media:
default: 0
enum: "TrustLevelSetting"
@ -1927,6 +1949,7 @@ trust:
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
min_trust_level_to_allow_profile_background:
default: 0
client: true
@ -1938,6 +1961,7 @@ trust:
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
min_trust_level_to_allow_user_card_background:
default: 0
client: true
@ -1949,6 +1973,7 @@ trust:
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
min_trust_level_to_allow_invite:
default: 2
enum: "TrustLevelSetting"
@ -1959,6 +1984,7 @@ trust:
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
min_trust_level_to_allow_ignore:
default: 2
enum: "TrustLevelSetting"
@ -1970,74 +1996,111 @@ trust:
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
allow_flagging_staff: true
send_tl1_welcome_message: true
send_tl2_promotion_message: true
tl1_requires_topics_entered: 5
tl1_requires_topics_entered:
default: 5
area: "trust_levels"
tl1_requires_read_posts:
default: 30
client: true
tl1_requires_time_spent_mins: 10
tl2_requires_topics_entered: 20
tl2_requires_read_posts: 100
tl2_requires_time_spent_mins: 60
area: "trust_levels"
tl1_requires_time_spent_mins:
default: 10
area: "trust_levels"
tl2_requires_topics_entered:
default: 20
area: "trust_levels"
tl2_requires_read_posts:
default: 100
area: "trust_levels"
tl2_requires_time_spent_mins:
default: 60
area: "trust_levels"
tl2_requires_days_visited:
default: 15
max: 36500
tl2_requires_likes_received: 1
tl2_requires_likes_given: 1
tl2_requires_topic_reply_count: 3
area: "trust_levels"
tl2_requires_likes_received:
default: 1
area: "trust_levels"
tl2_requires_likes_given:
default: 1
area: "trust_levels"
tl2_requires_topic_reply_count:
default: 3
area: "trust_levels"
tl3_time_period:
default: 100
min: 1
max: 1000000
area: "trust_levels"
tl3_requires_days_visited:
default: 50
max: 36500
area: "trust_levels"
tl3_requires_topics_replied_to:
default: 10
area: "trust_levels"
tl3_requires_topics_viewed:
default: 25
max: 100
area: "trust_levels"
tl3_requires_topics_viewed_cap:
default: 500
area: "trust_levels"
tl3_requires_posts_read:
default: 25
max: 100
area: "trust_levels"
tl3_requires_posts_read_cap:
default: 20000
max: 99000
area: "trust_levels"
tl3_requires_topics_viewed_all_time:
default: 200
area: "trust_levels"
tl3_requires_posts_read_all_time:
default: 500
area: "trust_levels"
tl3_requires_max_flagged:
default: 5
area: "trust_levels"
tl3_promotion_min_duration:
default: 14
max: 10000
area: "trust_levels"
tl3_requires_likes_given:
default: 30
area: "trust_levels"
tl3_requires_likes_received:
default: 20
area: "trust_levels"
tl3_links_no_follow:
default: false
client: true
area: "trust_levels"
tl4_delete_posts_and_topics:
default: false
client: true
hidden: true
area: "trust_levels"
delete_all_posts_and_topics_allowed_groups:
default: ""
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
edit_all_topic_groups:
default: "13"
type: group_list
area: "group_permissions"
edit_all_post_groups:
default: "14"
type: group_list
area: "group_permissions"
security:
detailed_404: false
@ -2188,6 +2251,7 @@ security:
allow_any: false
refresh: true
hidden: true
area: "group_permissions"
onebox:
post_onebox_maxlength:
@ -2508,7 +2572,7 @@ developer:
default: "1|2"
allow_any: false
refresh: true
area: "navigation"
area: "group_permissions|navigation"
warn_critical_js_deprecations:
default: true
client: true
@ -3220,6 +3284,7 @@ user_api:
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
allowed_user_api_push_urls:
default: ""
type: list
@ -3281,6 +3346,7 @@ tags:
type: group_list
allow_any: false
refresh: true
area: "group_permissions"
min_trust_level_to_tag_topics:
default: "0"
enum: "TrustLevelAndStaffSetting"
@ -3293,6 +3359,7 @@ tags:
allow_any: false
refresh: true
client: true
area: "group_permissions"
max_tag_search_results:
client: true
default: 5
@ -3315,6 +3382,7 @@ tags:
default: ""
allow_any: false
refresh: true
area: "group_permissions"
suppress_overlapping_tags_in_list:
default: false
client: true
@ -3400,7 +3468,7 @@ experimental:
default: ""
allow_any: false
refresh: true
area: "navigation"
area: "group_permissions|navigation"
glimmer_topic_list_mode:
client: true
type: enum
@ -3431,3 +3499,4 @@ experimental:
default: ""
type: group_list
list_type: compact
area: "group_permissions"

View File

@ -12,6 +12,7 @@ chat:
mandatory_values: "1|2" # @admins, @moderators
allow_any: false
refresh: true
area: "group_permissions"
chat_threads_enabled:
client: true
default: false
@ -101,13 +102,14 @@ chat:
allow_any: false
refresh: true
validator: "Chat::DirectMessageEnabledGroupsValidator"
area: "group_permissions"
chat_message_flag_allowed_groups:
default: "1|2|11" # @admins, @moderators, @trust_level_1
mandatory_values: "1|2" # @admins, @moderators
type: group_list
allow_any: false
refresh: true
area: "flags"
area: "flags|group_permissions"
max_mentions_per_chat_message:
client: true
type: integer

View File

@ -22,6 +22,7 @@ plugins:
allow_any: false
refresh: true
validator: "AtLeastOneGroupValidator"
area: "group_permissions"
poll_groupable_user_fields:
default: ""
type: list

View File

@ -11,3 +11,4 @@ plugins:
allow_any: false
refresh: true
validator: "AtLeastOneGroupValidator"
area: "group_permissions"