From 20a6cfe5c540cb6e99b4010688671214348b3de2 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Mon, 11 Dec 2023 02:09:32 +0100 Subject: [PATCH 1/4] test --- test/acceptance/category-featured-image-test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/acceptance/category-featured-image-test.js b/test/acceptance/category-featured-image-test.js index f7411dc..e5a17fe 100644 --- a/test/acceptance/category-featured-image-test.js +++ b/test/acceptance/category-featured-image-test.js @@ -39,11 +39,11 @@ acceptance("Category featured image", function () { settings.hide_topic_list = "1"; await visit("/c/bug/1"); - assert.true( - document.body.classList.contains( - "category-featured-images--hide-topic-list-page" - ), - "body has the .category-featured-images--hide-topic-list-page class" - ); + assert + .dom(document.body) + .hasClass( + "category-featured-images--hide-topic-list-page", + "body has the .category-featured-images--hide-topic-list-page class" + ); }); }); From 395b91a3263990a5d01039e954593d37d70b6cb6 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Mon, 11 Dec 2023 02:09:36 +0100 Subject: [PATCH 2/4] getOwner --- .../header-list-container-bottom/category-featured-images.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/javascripts/discourse/connectors/header-list-container-bottom/category-featured-images.js b/javascripts/discourse/connectors/header-list-container-bottom/category-featured-images.js index e5ecf4d..bff3385 100644 --- a/javascripts/discourse/connectors/header-list-container-bottom/category-featured-images.js +++ b/javascripts/discourse/connectors/header-list-container-bottom/category-featured-images.js @@ -1,10 +1,11 @@ import Component from "@glimmer/component"; import { inject as service } from "@ember/service"; -import { getOwner } from "discourse-common/lib/get-owner"; +import { getOwner } from "@ember/application"; +import { getOwnerWithFallback } from "discourse-common/lib/get-owner"; export default class CategoryFeaturedImages extends Component { static shouldRender() { - const router = getOwner(this).lookup("service:router"); + const router = getOwnerWithFallback(this).lookup("service:router"); return router.currentRoute.name.includes("discovery.category"); } From abfc35cf06c5fe541a7eabb44db67091bec19175 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Mon, 11 Dec 2023 02:33:57 +0100 Subject: [PATCH 3/4] no need for footer stuff? --- .../category-featured-images.hbs | 11 ++++------- .../category-featured-images.js | 5 ----- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/javascripts/discourse/connectors/header-list-container-bottom/category-featured-images.hbs b/javascripts/discourse/connectors/header-list-container-bottom/category-featured-images.hbs index 36c0e08..75f3775 100644 --- a/javascripts/discourse/connectors/header-list-container-bottom/category-featured-images.hbs +++ b/javascripts/discourse/connectors/header-list-container-bottom/category-featured-images.hbs @@ -1,10 +1,7 @@ - +{{if + this.hideTopicList + (body-class "category-featured-images--hide-topic-list") +}} {{#each this.filteredSetting as |fs|}}