UX: Admin setting page consistency - Security (#30598)

Create a basic config page that only contains security-related settings, to replace the "security" category view linked to from "Security settings" in the admin sidebar.
This commit is contained in:
Gary Pendergast 2025-01-07 13:48:40 +11:00 committed by GitHub
parent 0f0b3a21e6
commit d9d1da82cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 53 additions and 8 deletions

View File

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

View File

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

View File

@ -300,6 +300,9 @@ export default function () {
this.route("navigation", function () { this.route("navigation", function () {
this.route("settings", { path: "/" }); this.route("settings", { path: "/" });
}); });
this.route("security", function () {
this.route("settings", { path: "/" });
});
} }
); );

View File

@ -0,0 +1,29 @@
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.security.title"}}
@descriptionLabel={{i18n "admin.config.security.header_description"}}
>
<:breadcrumbs>
<DBreadcrumbsItem @path="/admin" @label={{i18n "admin_title"}} />
<DBreadcrumbsItem
@path="/admin/config/security"
@label={{i18n "admin.config.security.title"}}
/>
</:breadcrumbs>
</DPageHeader>
<div class="admin-config-page__main-area">
<AdminAreaSettings
@categories="security"
@path="/admin/config/security"
@filter={{@controller.filter}}
@adminSettingsFilterChangedCallback={{@controller.adminSettingsFilterChangedCallback}}
/>
</div>
</template>);

View File

@ -181,9 +181,7 @@ export const ADMIN_NAV_MAP = [
links: [ links: [
{ {
name: "admin_security", name: "admin_security",
route: "adminSiteSettingsCategory", route: "adminConfig.security.settings",
routeModels: ["security"],
query: { filter: "" },
label: "admin.security.sidebar_link.security", label: "admin.security.sidebar_link.security",
icon: "lock", icon: "lock",
}, },

View File

@ -5140,6 +5140,9 @@ en:
font_style: font_style:
title: "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"
legal:
title: "Legal"
header_description: "Configure legal settings, such as terms of service, privacy policy, contact details, and EU-specific considerations"
login_and_authentication: login_and_authentication:
title: "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"
@ -5148,16 +5151,16 @@ en:
header_description: "Customize the variations of your site logo" header_description: "Customize the variations of your site logo"
navigation: navigation:
title: "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." 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: notifications:
title: "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: search:
title: "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: security:
title: "Legal" title: "Security"
header_description: "Configure legal settings, such as terms of service, privacy policy, contact details, and EU-specific considerations" header_description: "Configure security settings, including two-factor authentication, moderator priviledges, and content security policies"
trust_levels: trust_levels:
title: "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"

View File

@ -394,12 +394,13 @@ Discourse::Application.routes.draw do
resources :site_settings, only: %i[index] resources :site_settings, only: %i[index]
get "fonts" => "site_settings#index" get "fonts" => "site_settings#index"
get "legal" => "site_settings#index"
get "login-and-authentication" => "site_settings#index" get "login-and-authentication" => "site_settings#index"
get "logo" => "site_settings#index" get "logo" => "site_settings#index"
get "navigation" => "site_settings#index" get "navigation" => "site_settings#index"
get "notifications" => "site_settings#index" get "notifications" => "site_settings#index"
get "search" => "site_settings#index" get "search" => "site_settings#index"
get "legal" => "site_settings#index" get "security" => "site_settings#index"
get "experimental" => "site_settings#index" get "experimental" => "site_settings#index"
get "trust-levels" => "site_settings#index" get "trust-levels" => "site_settings#index"
get "group-permissions" => "site_settings#index" get "group-permissions" => "site_settings#index"