From 5d00a97ae934b352194809121e33e4f7e7edf8e8 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Wed, 14 Feb 2018 11:03:33 +0100 Subject: [PATCH] FIX: regression preventing uncategorized badge to be shown --- .../select-kit/components/category-row.js.es6 | 5 ++++- .../select-kit/components/none-category-row.js.es6 | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/select-kit/components/category-row.js.es6 b/app/assets/javascripts/select-kit/components/category-row.js.es6 index ccd131c75d5..fe8584e3a78 100644 --- a/app/assets/javascripts/select-kit/components/category-row.js.es6 +++ b/app/assets/javascripts/select-kit/components/category-row.js.es6 @@ -43,7 +43,10 @@ export default SelectKitRowComponent.extend({ @computed("parentCategory") badgeForParentCategory(parentCategory) { - return categoryBadgeHTML(parentCategory, {link: false}).htmlSafe(); + return categoryBadgeHTML(parentCategory, { + link: this.get("categoryLink"), + allowUncategorized: this.get("allowUncategorized") + }).htmlSafe(); }, @computed("parentCategoryid") diff --git a/app/assets/javascripts/select-kit/components/none-category-row.js.es6 b/app/assets/javascripts/select-kit/components/none-category-row.js.es6 index 13636aa770c..b575a4c9cc2 100644 --- a/app/assets/javascripts/select-kit/components/none-category-row.js.es6 +++ b/app/assets/javascripts/select-kit/components/none-category-row.js.es6 @@ -1,9 +1,20 @@ import CategoryRowComponent from "select-kit/components/category-row"; +import { categoryBadgeHTML } from "discourse/helpers/category-link"; +import computed from "ember-addons/ember-computed-decorators"; export default CategoryRowComponent.extend({ layoutName: "select-kit/templates/components/category-row", classNames: "none category-row", + @computed("category") + badgeForCategory(category) { + return categoryBadgeHTML(category, { + link: this.get("categoryLink"), + allowUncategorized: true, + hideParent: this.get("hideParentCategory") + }).htmlSafe(); + }, + click() { this.sendAction("clearSelection"); }