Skip to content

Commit

Permalink
Exclude free-text terms and uncategorized terms
Browse files Browse the repository at this point in the history
  • Loading branch information
arteymix committed Mar 1, 2024
1 parent ab611a4 commit 510c353
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 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, excludedTerms));
.then(([excludedCategories, excludedTerms]) => this.updateAvailableCategories(browsingOptions.query, browsingOptions.filter, excludedCategories, excludedTerms, true));
}
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, excludedTerms) {
updateAvailableCategories(query, filter, excludedCategories, excludedTerms, excludeUncategorizedTerms) {
let disallowedPrefixes = [
"allCharacteristics.",
"characteristics.",
Expand All @@ -449,7 +449,11 @@ export default {
if (excludedCategories !== undefined) {
payload["excludedCategories"] = excludedCategories;
}
// this is just too costly, even for development purposes
payload["excludeFreeTextCategories"] = "true";
if (excludeUncategorizedTerms) {
payload["excludeUncategorizedTerms"] = "true";
}
if (excludedTerms !== undefined) {
payload["excludedTerms"] = excludedTerms;
}
Expand Down Expand Up @@ -624,7 +628,7 @@ export default {
this.updateOpenApiSpecification(),
this.updateAvailableTaxa(query, filter),
this.updateAvailablePlatforms(query, filter),
this.updateAvailableCategories(query, filter, excludedCategories, excludedTerms),
this.updateAvailableCategories(query, filter, excludedCategories, excludedTerms, true),
this.browse(this.browsingOptions)])
.catch(swallowCancellation)
.catch(err => console.error(`Error while loading initial data: ${err.message}.`, err));
Expand Down

0 comments on commit 510c353

Please sign in to comment.