Skip to content

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

FIX: uses only global allow_uncategorized_topics for category drop (#9130)

Joffrey JAFFEUX29c9d8a13385
diff --git a/app/assets/javascripts/select-kit/components/category-drop.js.es6 b/app/assets/javascripts/select-kit/components/category-drop.js.es6
index 5ee9a6d12b9..c80f46bea96 100644
--- a/app/assets/javascripts/select-kit/components/category-drop.js.es6
+++ b/app/assets/javascripts/select-kit/components/category-drop.js.es6
@@ -28,7 +28,6 @@ export default ComboBoxComponent.extend({
subCategory: false,
clearable: false,
hideParentCategory: "hideParentCategory",
- allowUncategorized: true,
countSubcategories: false,
autoInsertNoneItem: false,
displayCategoryDescription: "displayCategoryDescription",
@@ -96,7 +95,7 @@ export default ComboBoxComponent.extend({
content.title = category.title;
content.label = categoryBadgeHTML(category, {
link: false,
- allowUncategorized: this.selectKit.options.allowUncategorized,
+ allowUncategorized: true,
hideParent: true
}).htmlSafe();
}
@@ -174,10 +173,7 @@ export default ComboBoxComponent.extend({
},
_filterUncategorized(content) {
- if (
- !this.siteSettings.allow_uncategorized_topics ||
- !this.selectKit.options.allowUncategorized
- ) {
+ if (!this.siteSettings.allow_uncategorized_topics) {
content = content.filter(
c => c.id !== this.site.uncategorized_category_id
);
diff --git a/test/javascripts/components/select-kit/category-drop-test.js.es6 b/test/javascripts/components/select-kit/category-drop-test.js.es6
index 2a3b7b6e562..5c45042cb93 100644
--- a/test/javascripts/components/select-kit/category-drop-test.js.es6
+++ b/test/javascripts/components/select-kit/category-drop-test.js.es6
@@ -187,10 +187,11 @@ componentTest("hideParentCategory (true)", {
}
});
-componentTest("allowUncategorized (default: true)", {
+componentTest("allow_uncategorized_topics (true)", {
template: template(),
beforeEach() {
+ this.siteSettings.allow_uncategorized_topics = true;
initCategories(this);
},
@@ -203,10 +204,11 @@ componentTest("allowUncategorized (default: true)", {
}
});
-componentTest("allowUncategorized (false)", {
- template: template(["allowUncategorized=false"]),
+componentTest("allow_uncategorized_topics (false)", {
+ template: template(),
beforeEach() {
+ this.siteSettings.allow_uncategorized_topics = false;
initCategories(this);
},