diff --git a/app/assets/javascripts/discourse/app/components/bread-crumbs.hbs b/app/assets/javascripts/discourse/app/components/bread-crumbs.hbs index 93e1980f5b0..0562ed9eb97 100644 --- a/app/assets/javascripts/discourse/app/components/bread-crumbs.hbs +++ b/app/assets/javascripts/discourse/app/components/bread-crumbs.hbs @@ -24,13 +24,11 @@ @tagId={{this.tag.id}} @editingCategory={{this.editingCategory}} @editingCategoryTab={{this.editingCategoryTab}} - @filterType={{this.filterType}} @options={{hash parentCategory=breadcrumb.parentCategory subCategory=breadcrumb.isSubcategory noSubcategories=breadcrumb.noSubcategories autoFilterable=true - disableIfHasNoChildren=(eq this.filterType "categories") }} /> diff --git a/app/assets/javascripts/discourse/app/components/d-navigation.hbs b/app/assets/javascripts/discourse/app/components/d-navigation.hbs index b666d512fe9..50d1f7afe93 100644 --- a/app/assets/javascripts/discourse/app/components/d-navigation.hbs +++ b/app/assets/javascripts/discourse/app/components/d-navigation.hbs @@ -4,7 +4,6 @@ @noSubcategories={{this.noSubcategories}} @tag={{this.tag}} @additionalTags={{this.additionalTags}} - @filterType={{this.filterType}} /> {{#unless this.additionalTags}} diff --git a/app/assets/javascripts/discourse/tests/acceptance/subcategories-test.js b/app/assets/javascripts/discourse/tests/acceptance/subcategories-test.js deleted file mode 100644 index 2afc1b28b2b..00000000000 --- a/app/assets/javascripts/discourse/tests/acceptance/subcategories-test.js +++ /dev/null @@ -1,32 +0,0 @@ -import { currentRouteName, currentURL, visit } from "@ember/test-helpers"; -import { test } from "qunit"; -import { acceptance } from "discourse/tests/helpers/qunit-helpers"; -import selectKit from "discourse/tests/helpers/select-kit-helper"; - -acceptance("Subcategories", function (needs) { - needs.site({ - lazy_load_categories: true, - }); - - test("navigation can be used to navigate subcategories pages", async function (assert) { - await visit("/categories"); - - let categoryDrop = selectKit( - ".category-breadcrumb li:nth-of-type(1) .category-drop" - ); - await categoryDrop.expand(); - await categoryDrop.selectRowByValue("2"); // "feature" category - - assert.strictEqual(currentRouteName(), "discovery.subcategories"); - assert.strictEqual(currentURL(), "/c/feature/2/subcategories"); - - categoryDrop = selectKit( - ".category-breadcrumb li:nth-of-type(2) .category-drop" - ); - await categoryDrop.expand(); - await categoryDrop.selectRowByValue("26"); // "spec" category - - assert.strictEqual(currentRouteName(), "discovery.subcategories"); - assert.strictEqual(currentURL(), "/c/feature/spec/26/subcategories"); - }); -}); diff --git a/app/assets/javascripts/select-kit/addon/components/category-drop-more-collection.gjs b/app/assets/javascripts/select-kit/addon/components/category-drop-more-collection.gjs index 8783e28385b..42b6e4bb316 100644 --- a/app/assets/javascripts/select-kit/addon/components/category-drop-more-collection.gjs +++ b/app/assets/javascripts/select-kit/addon/components/category-drop-more-collection.gjs @@ -27,6 +27,12 @@ export default class CategoryDropMoreCollection extends Component { return this.args.selectKit.totalCount - currentCount; } + get slugPath() { + return this.args.selectKit.options.parentCategory.path.substring( + "/c/".length + ); + } +