@@ -18,12 +18,12 @@
diff --git a/app/assets/javascripts/admin/addon/templates/permalinks-settings.hbs b/app/assets/javascripts/admin/addon/templates/permalinks-settings.hbs
index a61041a4b0e..b55616ab720 100644
--- a/app/assets/javascripts/admin/addon/templates/permalinks-settings.hbs
+++ b/app/assets/javascripts/admin/addon/templates/permalinks-settings.hbs
@@ -1,6 +1,6 @@
\ No newline at end of file
diff --git a/app/assets/javascripts/admin/addon/templates/permalinks.hbs b/app/assets/javascripts/admin/addon/templates/permalinks.hbs
index 5873429d856..893db076511 100644
--- a/app/assets/javascripts/admin/addon/templates/permalinks.hbs
+++ b/app/assets/javascripts/admin/addon/templates/permalinks.hbs
@@ -7,7 +7,7 @@
<:breadcrumbs>
diff --git a/app/assets/javascripts/admin/addon/templates/user-fields.hbs b/app/assets/javascripts/admin/addon/templates/user-fields.hbs
index a53ef39ce07..7d89a1f74e6 100644
--- a/app/assets/javascripts/admin/addon/templates/user-fields.hbs
+++ b/app/assets/javascripts/admin/addon/templates/user-fields.hbs
@@ -8,7 +8,7 @@
<:breadcrumbs>
diff --git a/app/assets/javascripts/discourse/tests/acceptance/admin-permalink-test.js b/app/assets/javascripts/discourse/tests/acceptance/admin-permalink-test.js
index e5083df9725..95315870e93 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/admin-permalink-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/admin-permalink-test.js
@@ -34,7 +34,7 @@ acceptance("Admin - Permalinks", function (needs) {
});
test("search permalinks with result", async function (assert) {
- await visit("/admin/customize/permalinks");
+ await visit("/admin/config/permalinks");
await fillIn(".permalink-search input", "feature");
assert
.dom(".permalink-results span[title='c/feature/announcements']")
@@ -42,7 +42,7 @@ acceptance("Admin - Permalinks", function (needs) {
});
test("search permalinks without results", async function (assert) {
- await visit("/admin/customize/permalinks");
+ await visit("/admin/config/permalinks");
await fillIn(".permalink-search input", "garboogle");
assert
diff --git a/app/assets/javascripts/discourse/tests/integration/components/emoji-uploader-test.js b/app/assets/javascripts/discourse/tests/integration/components/emoji-uploader-test.js
index b7c129c81f7..787ae73d02b 100644
--- a/app/assets/javascripts/discourse/tests/integration/components/emoji-uploader-test.js
+++ b/app/assets/javascripts/discourse/tests/integration/components/emoji-uploader-test.js
@@ -17,7 +17,7 @@ module("Integration | Component | emoji-uploader", function (hooks) {
emojiGroups: ["default", "cool-emojis"],
});
- pretender.post("/admin/customize/emojis.json", () => {
+ pretender.post("/admin/config/emoji.json", () => {
requestNumber++;
if (requestNumber === 1) {
diff --git a/app/controllers/admin/emojis_controller.rb b/app/controllers/admin/emoji_controller.rb
similarity index 97%
rename from app/controllers/admin/emojis_controller.rb
rename to app/controllers/admin/emoji_controller.rb
index 7d51acba4f9..6631399464d 100644
--- a/app/controllers/admin/emojis_controller.rb
+++ b/app/controllers/admin/emoji_controller.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-class Admin::EmojisController < Admin::AdminController
+class Admin::EmojiController < Admin::AdminController
def index
render_serialized(Emoji.custom, EmojiSerializer, root: false)
end
diff --git a/config/routes.rb b/config/routes.rb
index ea34bf4be68..834a94f1df8 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -220,7 +220,7 @@ Discourse::Application.routes.draw do
get "customize/theme-components" => "themes#index", :constraints => AdminConstraint.new
get "customize/colors" => "color_schemes#index", :constraints => AdminConstraint.new
get "customize/colors/:id" => "color_schemes#index", :constraints => AdminConstraint.new
- get "customize/permalinks" => "permalinks#index", :constraints => AdminConstraint.new
+ get "config/permalinks" => "permalinks#index", :constraints => AdminConstraint.new
get "customize/embedding" => "embedding#show", :constraints => AdminConstraint.new
put "customize/embedding" => "embedding#update", :constraints => AdminConstraint.new
@@ -243,15 +243,6 @@ Discourse::Application.routes.draw do
end
scope "/customize", constraints: AdminConstraint.new do
- resources :user_fields,
- only: %i[index create update destroy],
- constraints: AdminConstraint.new
- get "user_fields/new" => "user_fields#index"
- get "user_fields/:id" => "user_fields#show"
- get "user_fields/:id/edit" => "user_fields#edit"
- resources :emojis, only: %i[index create destroy], constraints: AdminConstraint.new
- get "emojis/new" => "emojis#index"
- get "emojis/settings" => "emojis#index"
resources :form_templates, constraints: AdminConstraint.new, path: "/form-templates" do
collection { get "preview" => "form_templates#preview" }
end
@@ -304,8 +295,6 @@ Discourse::Application.routes.draw do
resource :email_style, only: %i[show update]
get "email_style/:field" => "email_styles#show", :constraints => { field: /html|css/ }
-
- resources :permalinks, only: %i[index new create show destroy]
end
resources :embeddable_hosts, only: %i[create update destroy], constraints: AdminConstraint.new
@@ -421,6 +410,26 @@ Discourse::Application.routes.draw do
end
end
+ scope "/config" do
+ resources :user_fields,
+ path: "user_fields",
+ only: %i[index create update destroy],
+ constraints: AdminConstraint.new
+ get "user-fields/new" => "user_fields#index"
+ get "user-fields/:id" => "user_fields#show"
+ get "user-fields/:id/edit" => "user_fields#edit"
+ get "user-fields" => "user_fields#index"
+
+ get "user_fields/new" => "user_fields#index"
+ get "user_fields/:id" => "user_fields#show"
+ get "user_fields/:id/edit" => "user_fields#edit"
+
+ resources :emoji, only: %i[index create destroy], constraints: AdminConstraint.new
+ get "emoji/new" => "emoji#index"
+ get "emoji/settings" => "emoji#index"
+ resources :permalinks, only: %i[index new create show destroy]
+ end
+
get "section/:section_id" => "section#show", :constraints => AdminConstraint.new
resources :admin_notices, only: %i[destroy], constraints: AdminConstraint.new
end # admin namespace
diff --git a/docs/ADMIN-QUICK-START-GUIDE.md b/docs/ADMIN-QUICK-START-GUIDE.md
index dd996933220..12c14138e60 100644
--- a/docs/ADMIN-QUICK-START-GUIDE.md
+++ b/docs/ADMIN-QUICK-START-GUIDE.md
@@ -71,7 +71,7 @@ To customize the look and feel of your community beyond what you configured in t
- [Font styles](%{base_url}/admin/site_settings/category/all_results?filter=font)
- [Site theme](%{base_url}/admin/customize/themes)
- [Navigation menu](%{base_url}/admin/site_settings/category/navigation)
-- [Custom user fields](%{base_url}/admin/customize/user_fields)
+- [Custom user fields](%{base_url}/admin/config/user-fields)
- [Terms of service and privacy policies](%{base_url}/admin/site_settings/category/legal)
[details="Advanced options"]
diff --git a/plugins/automation/test/javascripts/integration/components/da-custom-field-test.js b/plugins/automation/test/javascripts/integration/components/da-custom-field-test.js
index 6a9a8eeee0c..c470e4f1d62 100644
--- a/plugins/automation/test/javascripts/integration/components/da-custom-field-test.js
+++ b/plugins/automation/test/javascripts/integration/components/da-custom-field-test.js
@@ -13,7 +13,7 @@ module("Integration | Component | da-custom-field", function (hooks) {
hooks.beforeEach(function () {
this.automation = new AutomationFabricators(getOwner(this)).automation();
- pretender.get("/admin/customize/user_fields", () => {
+ pretender.get("/admin/config/user_fields", () => {
return response({
user_fields: [
{
diff --git a/spec/requests/admin/emojis_controller_spec.rb b/spec/requests/admin/emojis_controller_spec.rb
index 7ddda7f9b91..561dd05de3e 100644
--- a/spec/requests/admin/emojis_controller_spec.rb
+++ b/spec/requests/admin/emojis_controller_spec.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-RSpec.describe Admin::EmojisController do
+RSpec.describe Admin::EmojiController do
fab!(:admin)
fab!(:moderator)
fab!(:user)
@@ -10,11 +10,11 @@ RSpec.describe Admin::EmojisController do
context "when logged in as an admin" do
before { sign_in(admin) }
- it "returns a list of custom emojis" do
+ it "returns a list of custom emoji" do
CustomEmoji.create!(name: "osama-test-emoji", upload: upload, user: admin)
Emoji.clear_cache
- get "/admin/customize/emojis.json"
+ get "/admin/config/emoji.json"
expect(response.status).to eq(200)
json = response.parsed_body
@@ -24,9 +24,9 @@ RSpec.describe Admin::EmojisController do
end
end
- shared_examples "custom emojis inaccessible" do
+ shared_examples "custom emoji inaccessible" do
it "denies access with a 404 response" do
- get "/admin/customize/emojis.json"
+ get "/admin/config/emoji.json"
expect(response.status).to eq(404)
expect(response.parsed_body["errors"]).to include(I18n.t("not_found"))
@@ -36,13 +36,13 @@ RSpec.describe Admin::EmojisController do
context "when logged in as a moderator" do
before { sign_in(moderator) }
- include_examples "custom emojis inaccessible"
+ include_examples "custom emoji inaccessible"
end
context "when logged in as a non-staff user" do
before { sign_in(user) }
- include_examples "custom emojis inaccessible"
+ include_examples "custom emoji inaccessible"
end
end
@@ -52,7 +52,7 @@ RSpec.describe Admin::EmojisController do
context "when upload is invalid" do
it "should publish the right error" do
- post "/admin/customize/emojis.json",
+ post "/admin/config/emoji.json",
params: {
name: "test",
file: fixture_file_upload("#{Rails.root}/spec/fixtures/images/fake.jpg"),
@@ -68,7 +68,7 @@ RSpec.describe Admin::EmojisController do
it "should publish the right error" do
CustomEmoji.create!(name: "test", upload: upload)
- post "/admin/customize/emojis.json",
+ post "/admin/config/emoji.json",
params: {
name: "test",
file: fixture_file_upload("#{Rails.root}/spec/fixtures/images/logo.png"),
@@ -85,7 +85,7 @@ RSpec.describe Admin::EmojisController do
it "should allow an admin to add a custom emoji" do
Emoji.expects(:clear_cache)
- post "/admin/customize/emojis.json",
+ post "/admin/config/emoji.json",
params: {
name: "test",
file: fixture_file_upload("#{Rails.root}/spec/fixtures/images/logo.png"),
@@ -108,7 +108,7 @@ RSpec.describe Admin::EmojisController do
it "should log the action" do
Emoji.expects(:clear_cache)
- post "/admin/customize/emojis.json",
+ post "/admin/config/emoji.json",
params: {
name: "test",
file: fixture_file_upload("#{Rails.root}/spec/fixtures/images/logo.png"),
@@ -124,7 +124,7 @@ RSpec.describe Admin::EmojisController do
it "should allow an admin to add a custom emoji with a custom group" do
Emoji.expects(:clear_cache)
- post "/admin/customize/emojis.json",
+ post "/admin/config/emoji.json",
params: {
name: "test",
group: "Foo",
@@ -141,7 +141,7 @@ RSpec.describe Admin::EmojisController do
it "should fix up the emoji name" do
Emoji.expects(:clear_cache).times(3)
- post "/admin/customize/emojis.json",
+ post "/admin/config/emoji.json",
params: {
name: "test.png",
file: fixture_file_upload("#{Rails.root}/spec/fixtures/images/logo.png"),
@@ -154,7 +154,7 @@ RSpec.describe Admin::EmojisController do
expect(custom_emoji.name).to eq("test")
expect(response.status).to eq(200)
- post "/admin/customize/emojis.json",
+ post "/admin/config/emoji.json",
params: {
name: "st* onk$",
file: fixture_file_upload("#{Rails.root}/spec/fixtures/images/logo.png"),
@@ -164,7 +164,7 @@ RSpec.describe Admin::EmojisController do
expect(custom_emoji.name).to eq("st_onk_")
expect(response.status).to eq(200)
- post "/admin/customize/emojis.json",
+ post "/admin/config/emoji.json",
params: {
name: "PaRTYpaRrot",
file: fixture_file_upload("#{Rails.root}/spec/fixtures/images/logo.png"),
@@ -178,7 +178,7 @@ RSpec.describe Admin::EmojisController do
shared_examples "custom emoji creation not allowed" do
it "prevents creation with a 404 response" do
- post "/admin/customize/emojis.json",
+ post "/admin/config/emoji.json",
params: {
name: "test",
file: fixture_file_upload("#{Rails.root}/spec/fixtures/images/logo.png"),
@@ -211,7 +211,7 @@ RSpec.describe Admin::EmojisController do
Emoji.clear_cache
expect do
- delete "/admin/customize/emojis/#{custom_emoji.name}.json", params: { name: "test" }
+ delete "/admin/config/emoji/#{custom_emoji.name}.json", params: { name: "test" }
end.to change { CustomEmoji.count }.by(-1)
end
@@ -219,7 +219,7 @@ RSpec.describe Admin::EmojisController do
custom_emoji = CustomEmoji.create!(name: "test", upload: upload)
Emoji.clear_cache
- delete "/admin/customize/emojis/#{custom_emoji.name}.json", params: { name: "test" }
+ delete "/admin/config/emoji/#{custom_emoji.name}.json", params: { name: "test" }
last_log = UserHistory.last
@@ -234,7 +234,7 @@ RSpec.describe Admin::EmojisController do
custom_emoji = CustomEmoji.create!(name: "test", upload: upload)
Emoji.clear_cache
- delete "/admin/customize/emojis/#{custom_emoji.name}.json", params: { name: "test" }
+ delete "/admin/config/emoji/#{custom_emoji.name}.json", params: { name: "test" }
expect(response.status).to eq(404)
expect(response.parsed_body["errors"]).to include(I18n.t("not_found"))
diff --git a/spec/requests/admin/user_fields_controller_spec.rb b/spec/requests/admin/user_fields_controller_spec.rb
index 7ae56e25bb7..497cf8180d7 100644
--- a/spec/requests/admin/user_fields_controller_spec.rb
+++ b/spec/requests/admin/user_fields_controller_spec.rb
@@ -11,7 +11,7 @@ RSpec.describe Admin::UserFieldsController do
it "creates a user field" do
expect {
- post "/admin/customize/user_fields.json",
+ post "/admin/config/user_fields.json",
params: {
user_field: {
name: "hello",
@@ -27,7 +27,7 @@ RSpec.describe Admin::UserFieldsController do
it "creates a user field with options" do
expect do
- post "/admin/customize/user_fields.json",
+ post "/admin/config/user_fields.json",
params: {
user_field: {
name: "hello",
@@ -48,7 +48,7 @@ RSpec.describe Admin::UserFieldsController do
shared_examples "user field creation not allowed" do
it "prevents creation with a 404 response" do
expect do
- post "/admin/customize/user_fields.json",
+ post "/admin/config/user_fields.json",
params: {
user_field: {
name: "hello",
@@ -83,7 +83,7 @@ RSpec.describe Admin::UserFieldsController do
before { sign_in(admin) }
it "returns a list of user fields" do
- get "/admin/customize/user_fields.json"
+ get "/admin/config/user_fields.json"
expect(response.status).to eq(200)
json = response.parsed_body
expect(json["user_fields"]).to be_present
@@ -92,7 +92,7 @@ RSpec.describe Admin::UserFieldsController do
shared_examples "user fields inaccessible" do
it "denies access with a 404 response" do
- get "/admin/customize/user_fields.json"
+ get "/admin/config/user_fields.json"
expect(response.status).to eq(404)
expect(response.parsed_body["errors"]).to include(I18n.t("not_found"))
@@ -121,7 +121,7 @@ RSpec.describe Admin::UserFieldsController do
it "deletes the user field" do
expect {
- delete "/admin/customize/user_fields/#{user_field.id}.json"
+ delete "/admin/config/user_fields/#{user_field.id}.json"
expect(response.status).to eq(200)
}.to change(UserField, :count).by(-1)
end
@@ -129,7 +129,7 @@ RSpec.describe Admin::UserFieldsController do
shared_examples "user field deletion not allowed" do
it "prevents deletion with a 404 response" do
- expect do delete "/admin/customize/user_fields/#{user_field.id}.json" end.not_to change {
+ expect do delete "/admin/config/user_fields/#{user_field.id}.json" end.not_to change {
UserField.count
}
@@ -158,7 +158,7 @@ RSpec.describe Admin::UserFieldsController do
before { sign_in(admin) }
it "updates the user field" do
- put "/admin/customize/user_fields/#{user_field.id}.json",
+ put "/admin/config/user_fields/#{user_field.id}.json",
params: {
user_field: {
name: "fraggle",
@@ -177,7 +177,7 @@ RSpec.describe Admin::UserFieldsController do
end
it "updates the user field options" do
- put "/admin/customize/user_fields/#{user_field.id}.json",
+ put "/admin/config/user_fields/#{user_field.id}.json",
params: {
user_field: {
name: "fraggle",
@@ -195,7 +195,7 @@ RSpec.describe Admin::UserFieldsController do
end
it "keeps options when updating the user field" do
- put "/admin/customize/user_fields/#{user_field.id}.json",
+ put "/admin/config/user_fields/#{user_field.id}.json",
params: {
user_field: {
name: "fraggle",
@@ -210,7 +210,7 @@ RSpec.describe Admin::UserFieldsController do
user_field.reload
expect(user_field.user_field_options.size).to eq(2)
- put "/admin/customize/user_fields/#{user_field.id}.json",
+ put "/admin/config/user_fields/#{user_field.id}.json",
params: {
user_field: {
name: "fraggle",
@@ -234,7 +234,7 @@ RSpec.describe Admin::UserFieldsController do
position: next_position,
)
expect {
- put "/admin/customize/user_fields/#{user_field.id}.json",
+ put "/admin/config/user_fields/#{user_field.id}.json",
params: {
user_field: {
show_on_profile: false,
@@ -251,7 +251,7 @@ RSpec.describe Admin::UserFieldsController do
user_field.reload
original_name = user_field.name
- put "/admin/customize/user_fields/#{user_field.id}.json",
+ put "/admin/config/user_fields/#{user_field.id}.json",
params: {
user_field: {
name: "fraggle",
diff --git a/spec/system/page_objects/admin_emojis.rb b/spec/system/page_objects/admin_emojis.rb
index 7da253c9d80..423c0b17e3c 100644
--- a/spec/system/page_objects/admin_emojis.rb
+++ b/spec/system/page_objects/admin_emojis.rb
@@ -4,16 +4,16 @@ module PageObjects
module Pages
class AdminEmojis < PageObjects::Pages::Base
def visit_page
- page.visit "/admin/customize/emojis"
+ page.visit "/admin/config/emoji"
self
end
def click_tab(tab_name)
case tab_name
when "settings"
- find(".admin-emojis-tabs__settings").click
+ find(".admin-emoji-tabs__settings").click
when "index"
- find(".admin-emojis-tabs__emoji").click
+ find(".admin-emoji-tabs__emoji").click
end
end
diff --git a/spec/system/page_objects/pages/admin_permalinks.rb b/spec/system/page_objects/pages/admin_permalinks.rb
index 98fd4ff8a1f..0b9d0b8b248 100644
--- a/spec/system/page_objects/pages/admin_permalinks.rb
+++ b/spec/system/page_objects/pages/admin_permalinks.rb
@@ -4,7 +4,7 @@ module PageObjects
module Pages
class AdminPermalinks < PageObjects::Pages::Base
def visit
- page.visit("/admin/customize/permalinks")
+ page.visit("/admin/config/permalinks")
self
end
diff --git a/spec/system/page_objects/pages/admin_user_fields.rb b/spec/system/page_objects/pages/admin_user_fields.rb
index 5923465662c..c6967635b7a 100644
--- a/spec/system/page_objects/pages/admin_user_fields.rb
+++ b/spec/system/page_objects/pages/admin_user_fields.rb
@@ -4,7 +4,7 @@ module PageObjects
module Pages
class AdminUserFields < PageObjects::Pages::Base
def visit
- page.visit "admin/customize/user_fields"
+ page.visit "admin/config/user-fields"
self
end