Skip to content

Commit

Permalink
Unconditionally exclude free-text categories
Browse files Browse the repository at this point in the history
  • Loading branch information
arteymix committed Dec 11, 2023
1 parent 0c7dcaa commit 68312dd
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/views/Browser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -426,7 +426,7 @@ export default {
/**
* Update available categories.
*/
updateAvailableCategories(query, filter, excludedCategories, excludeFreeTextCategories, excludedTerms) {
updateAvailableCategories(query, filter, excludedCategories, excludedTerms) {
let disallowedPrefixes = [
"allCharacteristics.",
"characteristics.",
Expand All @@ -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;
}
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 68312dd

Please sign in to comment.