UX: Admin setting page consistency - Navigation (#30574)

Create a basic config page that only contains navigation-related settings, to replace the setting filtered view linked to from "Navigation" in the admin sidebar.
This commit is contained in:
Gary Pendergast 2025-01-06 17:44:33 +11:00 committed by GitHub
parent 7922e6bfc0
commit f5126199f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 60 additions and 7 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,21 @@
<DPageHeader
@titleLabel={{i18n "admin.config.navigation.title"}}
@descriptionLabel={{i18n "admin.config.navigation.header_description"}}
>
<:breadcrumbs>
<DBreadcrumbsItem @path="/admin" @label={{i18n "admin_title"}} />
<DBreadcrumbsItem
@path="/admin/config/navigation"
@label={{i18n "admin.config.navigation.title"}}
/>
</:breadcrumbs>
</DPageHeader>
<div class="admin-config-page__main-area">
<AdminAreaSettings
@area="navigation"
@path="/admin/config/navigation"
@filter={{this.filter}}
@adminSettingsFilterChangedCallback={{this.adminSettingsFilterChangedCallback}}
/>
</div>

View File

@ -122,9 +122,7 @@ export const ADMIN_NAV_MAP = [
}, },
{ {
name: "admin_navigation", name: "admin_navigation",
route: "adminSiteSettingsCategory", route: "adminConfig.navigation.settings",
routeModels: ["all_results"],
query: { filter: "navigation" },
label: "admin.appearance.sidebar_link.navigation", label: "admin.appearance.sidebar_link.navigation",
icon: "diagram-project", icon: "diagram-project",
}, },

View File

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

View File

@ -5143,6 +5143,9 @@ en:
logo: logo:
title: "Site 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: 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."

View File

@ -396,6 +396,7 @@ Discourse::Application.routes.draw do
get "fonts" => "site_settings#index" get "fonts" => "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 "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 "legal" => "site_settings#index"

View File

@ -216,6 +216,7 @@ basic:
- posted - posted
- bookmarks - bookmarks
- hot - hot
area: "navigation"
post_menu: post_menu:
client: true client: true
type: list type: list
@ -283,10 +284,12 @@ basic:
client: true client: true
enum: "CategoryPageStyle" enum: "CategoryPageStyle"
default: "categories_and_latest_topics" default: "categories_and_latest_topics"
area: "navigation"
mobile_category_page_style: mobile_category_page_style:
client: true client: true
enum: "MobileCategoryPageStyle" enum: "MobileCategoryPageStyle"
default: "categories_with_featured_topics" default: "categories_with_featured_topics"
area: "navigation"
category_colors: category_colors:
client: true client: true
type: list type: list
@ -427,6 +430,7 @@ basic:
choices: choices:
- spinner - spinner
- slider - slider
area: "navigation"
show_user_menu_avatars: show_user_menu_avatars:
client: true client: true
default: false default: false
@ -2504,6 +2508,7 @@ developer:
default: "1|2" default: "1|2"
allow_any: false allow_any: false
refresh: true refresh: true
area: "navigation"
warn_critical_js_deprecations: warn_critical_js_deprecations:
default: true default: true
client: true client: true
@ -2523,14 +2528,17 @@ navigation:
default: "sidebar" default: "sidebar"
type: enum type: enum
enum: "NavigationMenuSiteSetting" enum: "NavigationMenuSiteSetting"
area: "navigation"
default_navigation_menu_categories: default_navigation_menu_categories:
type: category_list type: category_list
default: "" default: ""
client: true client: true
area: "navigation"
default_navigation_menu_tags: default_navigation_menu_tags:
type: tag_list type: tag_list
default: "" default: ""
client: true client: true
area: "navigation"
default_sidebar_switch_panel_position: default_sidebar_switch_panel_position:
default: "bottom" default: "bottom"
type: enum type: enum
@ -2538,6 +2546,7 @@ navigation:
choices: choices:
- "top" - "top"
- "bottom" - "bottom"
area: "navigation"
embedding: embedding:
embed_by_username: embed_by_username:
@ -2734,6 +2743,7 @@ uncategorized:
header_dropdown_category_count: header_dropdown_category_count:
client: true client: true
default: 8 default: 8
area: "navigation"
slug_generation_method: slug_generation_method:
default: "ascii" default: "ascii"
@ -3162,8 +3172,12 @@ user_preferences:
enable_offline_indicator: enable_offline_indicator:
default: false default: false
client: true client: true
default_sidebar_link_to_filtered_list: false default_sidebar_link_to_filtered_list:
default_sidebar_show_count_of_new_items: false default: false
area: "navigation"
default_sidebar_show_count_of_new_items:
default: false
area: "navigation"
api: api:
retain_web_hook_events_period_days: retain_web_hook_events_period_days:
@ -3386,6 +3400,7 @@ experimental:
default: "" default: ""
allow_any: false allow_any: false
refresh: true refresh: true
area: "navigation"
glimmer_topic_list_mode: glimmer_topic_list_mode:
client: true client: true
type: enum type: enum

View File

@ -123,6 +123,7 @@ chat:
default: "never" default: "never"
type: enum type: enum
enum: "Chat::SeparateSidebarModeSiteSetting" enum: "Chat::SeparateSidebarModeSiteSetting"
area: "navigation"
chat_editing_grace_period: chat_editing_grace_period:
client: true client: true
type: integer type: integer