FIX: `TagDrop` uses `currentCategory` now (#12786)

This commit is contained in:
Jarek Radosz 2021-04-21 21:46:52 +02:00 committed by GitHub
parent b9b4d2485b
commit 2dfa1a267e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 10 deletions

View File

@ -11,15 +11,11 @@ import { set } from "@ember/object";
function initTags(context) {
const categories = context.site.categoriesList;
const parentCategory = categories.findBy("id", 2);
const childCategories = categories.filter(
(c) => c.parentCategory === parentCategory
);
const category = categories.findBy("id", 2);
// top_tags
context.setProperties({
firstCategory: parentCategory,
secondCategory: childCategories.firstObject,
currentCategory: category,
tagId: "jeff",
});
}
@ -55,8 +51,7 @@ discourseModule(
componentTest("default", {
template: hbs`
{{tag-drop
firstCategory=firstCategory
secondCategory=secondCategory
currentCategory=currentCategory
tagId=tagId
options=(hash
tagId=tagId

View File

@ -115,8 +115,7 @@ export default ComboBoxComponent.extend(TagsMixin, {
}),
topTags: computed(
"firstCategory",
"secondCategory",
"currentCategory",
"site.category_top_tags.[]",
"site.top_tags.[]",
function () {