From 68312dd197d430ae4876e46335ff4be541367f03 Mon Sep 17 00:00:00 2001 From: Guillaume Poirier-Morency Date: Mon, 11 Dec 2023 13:43:05 -0500 Subject: [PATCH] Unconditionally exclude free-text categories --- src/views/Browser.vue | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/views/Browser.vue b/src/views/Browser.vue index a392bfd..f40fe68 100644 --- a/src/views/Browser.vue +++ b/src/views/Browser.vue @@ -400,7 +400,7 @@ export default { updateDatasetsAnnotationsPromise = this.updateAvailableCategories(browsingOptions.query, browsingOptions.filter); } else { updateDatasetsAnnotationsPromise = Promise.all([compressArg(excludedCategories.join(",")), compressArg(excludedTerms.join(","))]) - .then(([excludedCategories, excludedTerms]) => this.updateAvailableCategories(browsingOptions.query, browsingOptions.filter, excludedCategories, true, excludedTerms)); + .then(([excludedCategories, excludedTerms]) => this.updateAvailableCategories(browsingOptions.query, browsingOptions.filter, excludedCategories, excludedTerms)); } let updateDatasetsPlatformsPromise = this.updateAvailablePlatforms(browsingOptions.query, browsingOptions.filter); let updateDatasetsTaxaPromise = this.updateAvailableTaxa(browsingOptions.query, browsingOptions.filter); @@ -426,7 +426,7 @@ export default { /** * Update available categories. */ - updateAvailableCategories(query, filter, excludedCategories, excludeFreeTextCategories, excludedTerms) { + updateAvailableCategories(query, filter, excludedCategories, excludedTerms) { let disallowedPrefixes = [ "allCharacteristics.", "characteristics.", @@ -449,9 +449,7 @@ export default { if (excludedCategories !== undefined) { payload["excludedCategories"] = excludedCategories; } - if (excludeFreeTextCategories) { - payload["excludeFreeTextCategories"] = excludeFreeTextCategories; - } + payload["excludeFreeTextCategories"] = ""; if (excludedTerms !== undefined) { payload["excludedTerms"] = excludedTerms; } @@ -626,7 +624,7 @@ export default { this.updateOpenApiSpecification(), this.updateAvailableTaxa(query, filter), this.updateAvailablePlatforms(query, filter), - this.updateAvailableCategories(query, filter, excludedCategories, true, excludedTerms), + this.updateAvailableCategories(query, filter, excludedCategories, excludedTerms), this.browse(this.browsingOptions)]) .catch(swallowCancellation) .catch(err => console.error(`Error while loading initial data: ${err.message}.`, err)); @@ -666,7 +664,7 @@ export default { promise = this.updateAvailableCategories(newVal.query, newVal.filter); } else { promise = Promise.all([compressArg(excludedCategories.join(",")), compressArg(excludedTerms.join(","))]) - .then(([excludedCategories, excludedTerms]) => this.updateAvailableCategories(newVal.query, newVal.filter, excludedCategories, true, excludedTerms)); + .then(([excludedCategories, excludedTerms]) => this.updateAvailableCategories(newVal.query, newVal.filter, excludedCategories, excludedTerms)); } } else { promise = Promise.resolve();