From d10b1aaedd8c1d239daf1ab955020a77cd93b6f5 Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Fri, 23 Feb 2024 12:21:44 -0500 Subject: [PATCH] Revert "FIX: Show Uncategorized in category-chooser (#25794)" (#25843) This reverts commit 1df473b530c780c2c90dcddfd7c75da68afe0bc7. --- .../select-kit/addon/components/category-chooser.js | 9 +++++---- .../select-kit/addon/components/category-drop.js | 3 +-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/select-kit/addon/components/category-chooser.js b/app/assets/javascripts/select-kit/addon/components/category-chooser.js index 002995186b1..7b3fdd8a918 100644 --- a/app/assets/javascripts/select-kit/addon/components/category-chooser.js +++ b/app/assets/javascripts/select-kit/addon/components/category-chooser.js @@ -17,8 +17,7 @@ export default ComboBoxComponent.extend({ selectKitOptions: { filterable: true, - autoInsertNoneItem: false, - allowUncategorized: "allowUncategorizedTopics", + allowUncategorized: false, allowSubCategories: true, permissionType: PermissionType.FULL, excludeCategoryId: null, @@ -55,7 +54,10 @@ export default ComboBoxComponent.extend({ I18n.t(isString ? this.selectKit.options.none : "category.none") ) ); - } else if (this.selectKit.options.allowUncategorized) { + } else if ( + this.allowUncategorizedTopics || + this.selectKit.options.allowUncategorized + ) { return Category.findUncategorized(); } else { const defaultCategoryId = parseInt( @@ -92,7 +94,6 @@ export default ComboBoxComponent.extend({ search(filter) { if (this.site.lazy_load_categories) { return Category.asyncSearch(this._normalize(filter), { - includeUncategorized: this.allowUncategorizedTopics, scopedCategoryId: this.selectKit.options?.scopedCategoryId, prioritizedCategoryId: this.selectKit.options?.prioritizedCategoryId, }); diff --git a/app/assets/javascripts/select-kit/addon/components/category-drop.js b/app/assets/javascripts/select-kit/addon/components/category-drop.js index 4a9f3c5d073..a68aa893f86 100644 --- a/app/assets/javascripts/select-kit/addon/components/category-drop.js +++ b/app/assets/javascripts/select-kit/addon/components/category-drop.js @@ -24,7 +24,6 @@ export default ComboBoxComponent.extend({ navigateToEdit: false, editingCategory: false, editingCategoryTab: null, - allowUncategorizedTopics: setting("allow_uncategorized_topics"), selectKitOptions: { filterable: true, @@ -41,7 +40,7 @@ export default ComboBoxComponent.extend({ displayCategoryDescription: "displayCategoryDescription", headerComponent: "category-drop/category-drop-header", parentCategory: false, - allowUncategorized: "allowUncategorizedTopics", + allowUncategorized: setting("allow_uncategorized_topics"), }, modifyComponentForRow() {