From 0ad1c02932314585aa3ab751e9df043c359cc3c9 Mon Sep 17 00:00:00 2001 From: Osama Sayegh Date: Thu, 31 Oct 2024 10:04:31 +0300 Subject: [PATCH] FEATURE: Add 'Community title' field to about config page (#29500) This commit adds a new "Community title" field to the about config page. This field controls the `short_site_description` setting, which is shown in the browser tab for key pages such categories pages and topic lists. Internal topic: t/140812. --- .../about/general-settings.gjs | 12 ++++++++++++ .../addon/components/admin-config-areas/about.gjs | 1 + .../admin/addon/routes/admin-config-about.js | 1 + app/controllers/admin/config/about_controller.rb | 1 + config/locales/client.en.yml | 2 ++ spec/system/admin_about_config_area_spec.rb | 8 ++++++++ .../admin_about_config_area_general_settings_card.rb | 4 ++++ 7 files changed, 29 insertions(+) diff --git a/app/assets/javascripts/admin/addon/components/admin-config-area-cards/about/general-settings.gjs b/app/assets/javascripts/admin/addon/components/admin-config-area-cards/about/general-settings.gjs index 744162d95ac..7ba26e0b715 100644 --- a/app/assets/javascripts/admin/addon/components/admin-config-area-cards/about/general-settings.gjs +++ b/app/assets/javascripts/admin/addon/components/admin-config-area-cards/about/general-settings.gjs @@ -23,6 +23,7 @@ export default class AdminConfigAreasAboutGeneralSettings extends Component { summary: this.args.generalSettings.siteDescription.value, extendedDescription: this.args.generalSettings.extendedSiteDescription.value, + communityTitle: this.args.generalSettings.communityTitle.value, aboutBannerImage: this.args.generalSettings.aboutBannerImage.value, }; } @@ -38,6 +39,7 @@ export default class AdminConfigAreasAboutGeneralSettings extends Component { name: data.name, summary: data.summary, extended_description: data.extendedDescription, + community_title: data.communityTitle, about_banner_image: data.aboutBannerImage, }, }, @@ -95,6 +97,16 @@ export default class AdminConfigAreasAboutGeneralSettings extends Component { + + + + here’s an extended description for the community

", ) + expect(SiteSetting.short_site_description).to eq("here's a title for my site") expect(SiteSetting.about_banner_image.sha1).to eq(Upload.generate_digest(image_file)) end diff --git a/spec/system/page_objects/components/admin_about_config_area_general_settings_card.rb b/spec/system/page_objects/components/admin_about_config_area_general_settings_card.rb index 6e8b70add32..08840640916 100644 --- a/spec/system/page_objects/components/admin_about_config_area_general_settings_card.rb +++ b/spec/system/page_objects/components/admin_about_config_area_general_settings_card.rb @@ -15,6 +15,10 @@ module PageObjects form.field("extendedDescription") end + def community_title_input + form.field("communityTitle") + end + def banner_image_uploader PageObjects::Components::UppyImageUploader.new(card.find(".image-uploader")) end