From 5711bf6f27dfc529dce0d74eb9253e821b6840f7 Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Thu, 2 Jan 2025 09:13:11 +1000 Subject: [PATCH] DEV: Move admin config pages out of /customize/ sub-route (#30511) The customize routes add CSS classes that make these admin config pages look different from the ones under /admin/config. We want all config routes to be under /admin/config as well. This commit moves the emoji, user fields, and permalinks pages out of customize and into config, updating all references and adding more rails routes as needed. Also renames admin emojis route to emoji, emoji is singular and plural. --- .../admin/addon/adapters/user-field.js | 9 ++- .../admin-config-areas/emojis-list.gjs | 2 +- .../admin-config-areas/emojis-new.gjs | 2 +- .../admin/addon/components/emoji-uploader.js | 2 +- .../admin/addon/routes/admin-route-map.js | 59 +++++++++---------- .../admin/addon/services/admin-emojis.js | 4 +- .../admin/addon/templates/emojis-settings.hbs | 2 +- .../admin/addon/templates/emojis.hbs | 8 +-- .../addon/templates/permalinks-settings.hbs | 2 +- .../admin/addon/templates/permalinks.hbs | 2 +- .../admin/addon/templates/user-fields.hbs | 2 +- .../tests/acceptance/admin-permalink-test.js | 4 +- .../components/emoji-uploader-test.js | 2 +- ...ojis_controller.rb => emoji_controller.rb} | 2 +- config/routes.rb | 33 +++++++---- docs/ADMIN-QUICK-START-GUIDE.md | 2 +- .../components/da-custom-field-test.js | 2 +- spec/requests/admin/emojis_controller_spec.rb | 38 ++++++------ .../admin/user_fields_controller_spec.rb | 26 ++++---- spec/system/page_objects/admin_emojis.rb | 6 +- .../page_objects/pages/admin_permalinks.rb | 2 +- .../page_objects/pages/admin_user_fields.rb | 2 +- 22 files changed, 112 insertions(+), 101 deletions(-) rename app/controllers/admin/{emojis_controller.rb => emoji_controller.rb} (97%) diff --git a/app/assets/javascripts/admin/addon/adapters/user-field.js b/app/assets/javascripts/admin/addon/adapters/user-field.js index f362b06fe1d..dd188480123 100644 --- a/app/assets/javascripts/admin/addon/adapters/user-field.js +++ b/app/assets/javascripts/admin/addon/adapters/user-field.js @@ -1,2 +1,7 @@ -import CustomizationBase from "admin/adapters/customization-base"; -export default CustomizationBase; +import RestAdapter from "discourse/adapters/rest"; + +export default class UserFieldAdapter extends RestAdapter { + basePath() { + return "/admin/config/"; + } +} diff --git a/app/assets/javascripts/admin/addon/components/admin-config-areas/emojis-list.gjs b/app/assets/javascripts/admin/addon/components/admin-config-areas/emojis-list.gjs index 40c1627514b..2f4a450c954 100644 --- a/app/assets/javascripts/admin/addon/components/admin-config-areas/emojis-list.gjs +++ b/app/assets/javascripts/admin/addon/components/admin-config-areas/emojis-list.gjs @@ -90,7 +90,7 @@ export default class AdminConfigAreasEmojisList extends Component { {{/if}} diff --git a/app/assets/javascripts/admin/addon/components/admin-config-areas/emojis-new.gjs b/app/assets/javascripts/admin/addon/components/admin-config-areas/emojis-new.gjs index 3e1688cd60e..6f187ec5116 100644 --- a/app/assets/javascripts/admin/addon/components/admin-config-areas/emojis-new.gjs +++ b/app/assets/javascripts/admin/addon/components/admin-config-areas/emojis-new.gjs @@ -29,7 +29,7 @@ export default class AdminConfigAreasEmojisNew extends Component {