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

This commit is contained in:
Joffrey JAFFEUX 2020-03-06 20:11:21 +01:00 committed by GitHub
parent 763a065df9
commit 29c9d8a133
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 9 deletions

View File

@ -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
);

View File

@ -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);
},