UX: Admin setting page consistency - Rate Limits (#30609)

Create a basic config page that only contains rate limiting-related settings, to replace the "rate_limits" category view linked to from "Rate limits" in the admin sidebar.
This commit is contained in:
Gary Pendergast 2025-01-07 15:46:40 +11:00 committed by GitHub
parent dc36bed7d3
commit 18a8ca38ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 48 additions and 3 deletions

View File

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

View File

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

View File

@ -303,6 +303,9 @@ export default function () {
this.route("navigation", function () {
this.route("settings", { path: "/" });
});
this.route("rate-limits", function () {
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.rate_limits.title"}}
@descriptionLabel={{i18n "admin.config.rate_limits.header_description"}}
>
<:breadcrumbs>
<DBreadcrumbsItem @path="/admin" @label={{i18n "admin_title"}} />
<DBreadcrumbsItem
@path="/admin/config/rate-limits"
@label={{i18n "admin.config.rate_limits.title"}}
/>
</:breadcrumbs>
</DPageHeader>
<div class="admin-config-page__main-area">
<AdminAreaSettings
@categories="rate_limits"
@path="/admin/config/rate-limits"
@filter={{@controller.filter}}
@adminSettingsFilterChangedCallback={{@controller.adminSettingsFilterChangedCallback}}
/>
</div>
</template>);

View File

@ -238,9 +238,7 @@ export const ADMIN_NAV_MAP = [
},
{
name: "admin_rate_limits",
route: "adminSiteSettingsCategory",
routeModels: ["rate_limits"],
query: { filter: "" },
route: "adminConfig.rate-limits.settings",
label: "admin.advanced.sidebar_link.rate_limits",
icon: "rocket",
},

View File

@ -5158,6 +5158,9 @@ en:
notifications:
title: "Notifications"
header_description: "Configure how notifications are managed and delivered for users, including email preferences, push notifications, mention limits, and notification consolidation"
rate_limits:
title: "Rate limits"
header_description: "Configure how often users can perform certain actions, such as creating topics, sending messages, and posting replies"
search:
title: "Search"
header_description: "Configure search settings including logging and tokenization for Chinese and Japanese languages"

View File

@ -400,6 +400,7 @@ Discourse::Application.routes.draw do
get "logo" => "site_settings#index"
get "navigation" => "site_settings#index"
get "notifications" => "site_settings#index"
get "rate-limits" => "site_settings#index"
get "search" => "site_settings#index"
get "security" => "site_settings#index"
get "spam" => "site_settings#index"