Skip to content

A platform for community discussion. Free, open, simple.

FIX: Back to themes page not working when theme has enabled components (#33048)

Alan Guo Xiang Tan1ba8c0dcdc73
diff --git a/app/assets/javascripts/admin/addon/controllers/admin-customize-themes-show.js b/app/assets/javascripts/admin/addon/controllers/admin-customize-themes-show.js
index cc57fada991..7151b08c62d 100644
--- a/app/assets/javascripts/admin/addon/controllers/admin-customize-themes-show.js
+++ b/app/assets/javascripts/admin/addon/controllers/admin-customize-themes-show.js
@@ -108,7 +108,7 @@ export default class AdminCustomizeThemesShowController extends Controller {
});
}
- @discourseComputed("model.parentThemes.[]")
+ @discourseComputed("model.childThemesNames.[]")
relativesSelectorSettingsForTheme() {
return SiteSetting.create({
list_type: "compact",
diff --git a/spec/system/admin_customize_themes_config_area_spec.rb b/spec/system/admin_customize_themes_config_area_spec.rb
index 6a8c6e38926..807d03416e3 100644
--- a/spec/system/admin_customize_themes_config_area_spec.rb
+++ b/spec/system/admin_customize_themes_config_area_spec.rb
@@ -3,6 +3,9 @@
describe "Admin Customize Themes Config Area Page", type: :system do
fab!(:admin)
fab!(:theme) { Theme.where(component: false).first }
+ fab!(:theme_child_theme) do
+ Fabricate(:theme, name: "Child theme", component: true, enabled: true, parent_themes: [theme])
+ end
fab!(:theme_2) { Fabricate(:theme, name: "Second theme") }
let(:config_area) { PageObjects::Pages::AdminCustomizeThemesConfigArea.new }
@@ -66,9 +69,12 @@ describe "Admin Customize Themes Config Area Page", type: :system do
it "has new look when edit theme is visited directly and can go back to themes" do
visit("/admin/customize/themes/#{theme.id}")
- expect(page).to have_css(".back-to-themes-and-components")
- expect(admin_customize_themes_page).to have_back_button_to_themes_page
+
admin_customize_themes_page.click_back_to_themes
+
expect(page).to have_current_path("/admin/config/customize/themes")
+ expect(page).to have_content(
+ I18n.t("admin_js.admin.config_areas.themes_and_components.themes.title"),
+ )
end
end
diff --git a/spec/system/admin_customize_themes_spec.rb b/spec/system/admin_customize_themes_spec.rb
index 127fd3ea32c..2a48ba21f93 100644
--- a/spec/system/admin_customize_themes_spec.rb
+++ b/spec/system/admin_customize_themes_spec.rb
@@ -145,15 +145,6 @@ describe "Admin Customize Themes", type: :system do
end
end
- # TODO(osama) unskip this test when the "Themes and components" link is
- # changed to the new config customize page
- context "when visting a theme's page" do
- xit "has a link to the themes page" do
- visit("/admin/customize/themes/#{theme.id}")
- expect(admin_customize_themes_page).to have_back_button_to_themes_page
- end
- end
-
context "when visting a component's page" do
fab!(:component) { Fabricate(:theme, component: true, name: "Cool component 493") }