diff --git a/app/assets/javascripts/admin/addon/controllers/admin-config-fonts-settings.js b/app/assets/javascripts/admin/addon/controllers/admin-config-fonts-settings.js index 1c517c5c1f0..0a3a6183c1c 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-config-fonts-settings.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-config-fonts-settings.js @@ -1,3 +1,3 @@ import AdminAreaSettingsBaseController from "admin/controllers/admin-area-settings-base"; -export default class AdminConfigFontsController extends AdminAreaSettingsBaseController {} +export default class AdminConfigFontsSettingsController extends AdminAreaSettingsBaseController {} diff --git a/app/assets/javascripts/admin/addon/controllers/admin-config-navigation-settings.js b/app/assets/javascripts/admin/addon/controllers/admin-config-navigation-settings.js new file mode 100644 index 00000000000..7122b898f0e --- /dev/null +++ b/app/assets/javascripts/admin/addon/controllers/admin-config-navigation-settings.js @@ -0,0 +1,3 @@ +import AdminAreaSettingsBaseController from "admin/controllers/admin-area-settings-base"; + +export default class AdminConfigNavigationSettingsController extends AdminAreaSettingsBaseController {} diff --git a/app/assets/javascripts/admin/addon/routes/admin-config-navigation.js b/app/assets/javascripts/admin/addon/routes/admin-config-navigation.js new file mode 100644 index 00000000000..4e5d06e824a --- /dev/null +++ b/app/assets/javascripts/admin/addon/routes/admin-config-navigation.js @@ -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"); + } +} diff --git a/app/assets/javascripts/admin/addon/routes/admin-route-map.js b/app/assets/javascripts/admin/addon/routes/admin-route-map.js index d1afd32e71e..2f8e75d8d0f 100644 --- a/app/assets/javascripts/admin/addon/routes/admin-route-map.js +++ b/app/assets/javascripts/admin/addon/routes/admin-route-map.js @@ -283,6 +283,9 @@ export default function () { this.route("logo", function () { this.route("settings", { path: "/" }); }); + this.route("navigation", function () { + this.route("settings", { path: "/" }); + }); } ); diff --git a/app/assets/javascripts/admin/addon/templates/config-navigation-settings.hbs b/app/assets/javascripts/admin/addon/templates/config-navigation-settings.hbs new file mode 100644 index 00000000000..72666186866 --- /dev/null +++ b/app/assets/javascripts/admin/addon/templates/config-navigation-settings.hbs @@ -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> \ No newline at end of file diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/admin-nav-map.js b/app/assets/javascripts/discourse/app/lib/sidebar/admin-nav-map.js index 105ec58d3f2..e6a7bb0234c 100644 --- a/app/assets/javascripts/discourse/app/lib/sidebar/admin-nav-map.js +++ b/app/assets/javascripts/discourse/app/lib/sidebar/admin-nav-map.js @@ -122,9 +122,7 @@ export const ADMIN_NAV_MAP = [ }, { name: "admin_navigation", - route: "adminSiteSettingsCategory", - routeModels: ["all_results"], - query: { filter: "navigation" }, + route: "adminConfig.navigation.settings", label: "admin.appearance.sidebar_link.navigation", icon: "diagram-project", }, diff --git a/app/models/site_setting.rb b/app/models/site_setting.rb index 5699729e27d..938223a570f 100644 --- a/app/models/site_setting.rb +++ b/app/models/site_setting.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true 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 SiteSettingExtension diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 75d27c5e9ee..ee9301a09d0 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -5143,6 +5143,9 @@ en: logo: title: "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." diff --git a/config/routes.rb b/config/routes.rb index fb73361ba15..5b7d3435eb1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -396,6 +396,7 @@ Discourse::Application.routes.draw do get "fonts" => "site_settings#index" get "login-and-authentication" => "site_settings#index" get "logo" => "site_settings#index" + get "navigation" => "site_settings#index" get "notifications" => "site_settings#index" get "search" => "site_settings#index" get "legal" => "site_settings#index" diff --git a/config/site_settings.yml b/config/site_settings.yml index b5b27783dd3..3398f8524b2 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -216,6 +216,7 @@ basic: - posted - bookmarks - hot + area: "navigation" post_menu: client: true type: list @@ -283,10 +284,12 @@ basic: client: true enum: "CategoryPageStyle" default: "categories_and_latest_topics" + area: "navigation" mobile_category_page_style: client: true enum: "MobileCategoryPageStyle" default: "categories_with_featured_topics" + area: "navigation" category_colors: client: true type: list @@ -427,6 +430,7 @@ basic: choices: - spinner - slider + area: "navigation" show_user_menu_avatars: client: true default: false @@ -2504,6 +2508,7 @@ developer: default: "1|2" allow_any: false refresh: true + area: "navigation" warn_critical_js_deprecations: default: true client: true @@ -2523,14 +2528,17 @@ navigation: default: "sidebar" type: enum enum: "NavigationMenuSiteSetting" + area: "navigation" default_navigation_menu_categories: type: category_list default: "" client: true + area: "navigation" default_navigation_menu_tags: type: tag_list default: "" client: true + area: "navigation" default_sidebar_switch_panel_position: default: "bottom" type: enum @@ -2538,6 +2546,7 @@ navigation: choices: - "top" - "bottom" + area: "navigation" embedding: embed_by_username: @@ -2734,6 +2743,7 @@ uncategorized: header_dropdown_category_count: client: true default: 8 + area: "navigation" slug_generation_method: default: "ascii" @@ -3162,8 +3172,12 @@ user_preferences: enable_offline_indicator: default: false client: true - default_sidebar_link_to_filtered_list: false - default_sidebar_show_count_of_new_items: false + default_sidebar_link_to_filtered_list: + default: false + area: "navigation" + default_sidebar_show_count_of_new_items: + default: false + area: "navigation" api: retain_web_hook_events_period_days: @@ -3386,6 +3400,7 @@ experimental: default: "" allow_any: false refresh: true + area: "navigation" glimmer_topic_list_mode: client: true type: enum diff --git a/plugins/chat/config/settings.yml b/plugins/chat/config/settings.yml index 06179c87ae7..0bbb1cdbfe7 100644 --- a/plugins/chat/config/settings.yml +++ b/plugins/chat/config/settings.yml @@ -123,6 +123,7 @@ chat: default: "never" type: enum enum: "Chat::SeparateSidebarModeSiteSetting" + area: "navigation" chat_editing_grace_period: client: true type: integer