DEV: Make lazy_load_categories setting use groups (#25282)

This allows certain users to test the new feature and avoid disruptions
in other's workflows.
This commit is contained in:
Bianca Nenciu
2024-01-17 20:26:51 +02:00
committed by GitHub
parent 719956f255
commit abad38c2e7
19 changed files with 79 additions and 33 deletions

View File

@@ -29,7 +29,7 @@ export default ComboBoxComponent.extend({
this._super(...arguments);
if (
this.siteSettings.lazy_load_categories &&
this.site.lazy_load_categories &&
!Category.hasAsyncFoundAll([this.value])
) {
// eslint-disable-next-line no-console
@@ -92,7 +92,7 @@ export default ComboBoxComponent.extend({
},
search(filter) {
if (this.siteSettings.lazy_load_categories) {
if (this.site.lazy_load_categories) {
return Category.asyncSearch(this._normalize(filter), {
scopedCategoryId: this.selectKit.options?.scopedCategoryId,
prioritizedCategoryId: this.selectKit.options?.prioritizedCategoryId,

View File

@@ -135,7 +135,7 @@ export default ComboBoxComponent.extend({
),
async search(filter) {
if (this.siteSettings.lazy_load_categories) {
if (this.site.lazy_load_categories) {
const results = await Category.asyncSearch(filter, {
parentCategoryId: this.options.parentCategory?.id || -1,
includeUncategorized: this.siteSettings.allow_uncategorized_topics,

View File

@@ -51,7 +51,7 @@ export default MultiSelectComponent.extend({
},
async search(filter) {
if (!this.siteSettings.lazy_load_categories) {
if (!this.site.lazy_load_categories) {
return this._super(filter);
}