A platform for community discussion. Free, open, simple.
FIX: wizard logo preview (#32543)
Krzysztof Kotlarek4cd5e7070b4f
diff --git a/app/assets/javascripts/discourse/app/static/wizard/components/fields/image.gjs b/app/assets/javascripts/discourse/app/static/wizard/components/fields/image.gjsindex 028140d2034..766e792b976 100644--- a/app/assets/javascripts/discourse/app/static/wizard/components/fields/image.gjs+++ b/app/assets/javascripts/discourse/app/static/wizard/components/fields/image.gjs@@ -1,6 +1,5 @@import Component from "@ember/component";import { warn } from "@ember/debug";-import { getOwner } from "@ember/owner";import { service } from "@ember/service";import { dasherize } from "@ember/string";import { classNames } from "@ember-decorators/component";@@ -21,8 +20,7 @@ export default class Image extends Component {@discourseComputed("field.id")previewComponent(id) {- const name = imagePreviews[dasherize(id)] ?? imagePreviews.generic;- return getOwner(this).resolveRegistration(`component:${name}`);+ return imagePreviews[dasherize(id)] ?? imagePreviews.generic;}didInsertElement() {diff --git a/docs/ADMIN-QUICK-START-GUIDE.md b/docs/ADMIN-QUICK-START-GUIDE.mdindex 54a4f08db78..8e80989609b 100644--- a/docs/ADMIN-QUICK-START-GUIDE.md+++ b/docs/ADMIN-QUICK-START-GUIDE.md@@ -67,9 +67,9 @@ To get you started, think about what you want new members to **know about your cTo customize the look and feel of your community beyond what you configured in the [setup wizard](%{base_url}/wizard), you can change the following settings in the [admin interface](%{base_url}/admin):-- [Logo images](%{base_url}/admin/config/logo)+- [Logo images](%{base_url}/admin/config/logo-and-fonts)- [Color palettes](%{base_url}/admin/customize/colors)-- [Font styles](%{base_url}/admin/config/fonts)+- [Font styles](%{base_url}/admin/config/logo-and-fonts)- [Site theme](%{base_url}/admin/customize/themes)- [Navigation menu](%{base_url}/admin/config/navigation)- [Custom user fields](%{base_url}/admin/config/user-fields)diff --git a/spec/system/page_objects/pages/wizard.rb b/spec/system/page_objects/pages/wizard.rbindex cab6d40bd8f..48e63a911cc 100644--- a/spec/system/page_objects/pages/wizard.rb+++ b/spec/system/page_objects/pages/wizard.rb@@ -86,6 +86,10 @@ class PageObjects::Pages::Wizard::BrandingStep < PageObjects::Pages::Wizard::Stedef has_upload?(field_id)wizard.find_field("image", field_id).has_css?(".wizard-container__button-upload.has-upload")end++ def has_preview?(field_id)+ wizard.find_field("image", field_id).has_css?(".wizard-container__preview")+ endendclass PageObjects::Pages::Wizard::StylingStep < PageObjects::Pages::Wizard::StepBasediff --git a/spec/system/wizard_spec.rb b/spec/system/wizard_spec.rbindex 6e2748eb6ab..1f3ca0f16d1 100644--- a/spec/system/wizard_spec.rb+++ b/spec/system/wizard_spec.rb@@ -67,8 +67,10 @@ describe "Wizard", type: :system doexpect(wizard_page).to be_on_step("branding")attach_file(file_path_1) { wizard_page.branding_step.click_upload_button("logo") }expect(wizard_page.branding_step).to have_upload("logo")+ expect(wizard_page.branding_step).to have_preview("logo")attach_file(file_path_2) { wizard_page.branding_step.click_upload_button("logo-small") }expect(wizard_page.branding_step).to have_upload("logo-small")+ expect(wizard_page.branding_step).to have_preview("logo-small")wizard_page.go_to_next_stepexpect(wizard_page).to be_on_step("ready")