diff --git a/app/assets/javascripts/admin/addon/controllers/admin-config-login-and-authentication-settings.js b/app/assets/javascripts/admin/addon/controllers/admin-config-login-and-authentication-settings.js new file mode 100644 index 00000000000..12fc98c388e --- /dev/null +++ b/app/assets/javascripts/admin/addon/controllers/admin-config-login-and-authentication-settings.js @@ -0,0 +1,3 @@ +import AdminAreaSettingsBaseController from "admin/controllers/admin-area-settings-base"; + +export default class AdminConfigLoginAndAuthenticationSettingsController extends AdminAreaSettingsBaseController {} diff --git a/app/assets/javascripts/admin/addon/routes/admin-config-about.js b/app/assets/javascripts/admin/addon/routes/admin-config-about.js index 82ce7d5c955..0edc9da96db 100644 --- a/app/assets/javascripts/admin/addon/routes/admin-config-about.js +++ b/app/assets/javascripts/admin/addon/routes/admin-config-about.js @@ -1,7 +1,12 @@ -import Route from "@ember/routing/route"; import { ajax } from "discourse/lib/ajax"; +import DiscourseRoute from "discourse/routes/discourse"; +import { i18n } from "discourse-i18n"; + +export default class AdminConfigAboutRoute extends DiscourseRoute { + titleToken() { + return i18n("admin.community.sidebar_link.about_your_site"); + } -export default class AdminConfigAboutRoute extends Route { model() { return ajax("/admin/config/site_settings.json", { data: { diff --git a/app/assets/javascripts/admin/addon/routes/admin-config-login-and-authentication.js b/app/assets/javascripts/admin/addon/routes/admin-config-login-and-authentication.js new file mode 100644 index 00000000000..bb18d420331 --- /dev/null +++ b/app/assets/javascripts/admin/addon/routes/admin-config-login-and-authentication.js @@ -0,0 +1,8 @@ +import DiscourseRoute from "discourse/routes/discourse"; +import { i18n } from "discourse-i18n"; + +export default class AdminConfigLoginAndAuthenticationRoute extends DiscourseRoute { + titleToken() { + return i18n("admin.community.sidebar_link.login_and_authentication"); + } +} 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 3ba8d71e02d..5e5be006f7c 100644 --- a/app/assets/javascripts/admin/addon/routes/admin-route-map.js +++ b/app/assets/javascripts/admin/addon/routes/admin-route-map.js @@ -206,6 +206,11 @@ export default function () { }); this.route("about"); + this.route("loginAndAuthentication", { path: "/" }, function () { + this.route("settings", { + path: "/login-and-authentication", + }); + }); this.route("lookAndFeel", { path: "/look-and-feel" }, function () { this.route("themes"); }); diff --git a/app/assets/javascripts/admin/addon/templates/config-login-and-authentication-settings.hbs b/app/assets/javascripts/admin/addon/templates/config-login-and-authentication-settings.hbs new file mode 100644 index 00000000000..24adeec9b47 --- /dev/null +++ b/app/assets/javascripts/admin/addon/templates/config-login-and-authentication-settings.hbs @@ -0,0 +1,23 @@ + + <:breadcrumbs> + + + + + +
+ +
\ 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 8d496ba209f..72289eba9cd 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 @@ -42,9 +42,7 @@ export const ADMIN_NAV_MAP = [ }, { name: "admin_login_and_authentication", - route: "adminSiteSettingsCategory", - routeModels: ["login"], - query: { filter: "" }, + route: "adminConfig.loginAndAuthentication.settings", label: "admin.community.sidebar_link.login_and_authentication", icon: "unlock", }, @@ -301,8 +299,7 @@ export const ADMIN_NAV_MAP = [ { name: "admin_experimental", route: "adminSiteSettingsCategory", - routeModels: ["all_results"], - query: { filter: "experimental" }, + routeModels: ["experimental"], label: "admin.advanced.sidebar_link.experimental", icon: "discourse-sparkles", }, diff --git a/app/assets/javascripts/discourse/tests/acceptance/admin-sidebar-section-test.js b/app/assets/javascripts/discourse/tests/acceptance/admin-sidebar-section-test.js index 30ede349342..f130e91b340 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/admin-sidebar-section-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/admin-sidebar-section-test.js @@ -3,6 +3,7 @@ import { test } from "qunit"; import { AUTO_GROUPS } from "discourse/lib/constants"; import { withPluginApi } from "discourse/lib/plugin-api"; import PreloadStore from "discourse/lib/preload-store"; +import pretender, { response } from "discourse/tests/helpers/create-pretender"; import { acceptance } from "discourse/tests/helpers/qunit-helpers"; import I18n from "discourse-i18n"; @@ -24,6 +25,12 @@ acceptance("Admin Sidebar - Sections", function (needs) { }, }, ]); + + pretender.get("/admin/config/site_settings.json", () => + response({ + site_settings: [], + }) + ); }); test("default sections are loaded", async function (assert) { diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index f5517257e16..90fb65c76d8 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -5133,6 +5133,11 @@ en: sidebar_link: all: "All reports" + config: + login_and_authentication: + title: "Login and authentication" + header_description: "Configure how users log in and authenticate, secrets and keys, OAuth2 providers, and more." + new_features: title: "What's new?" check_for_updates: "Check for updates" diff --git a/config/routes.rb b/config/routes.rb index 834a94f1df8..c9aaf7a691b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -391,6 +391,9 @@ Discourse::Application.routes.draw do end namespace :config, constraints: StaffConstraint.new do resources :site_settings, only: %i[index] + resources :login_and_authentication, only: %i[index] + + get "login-and-authentication" => "site_settings#index" resources :flags, only: %i[index new create update destroy] do put "toggle"