Skip to content

Commit

Permalink
Exclude free-text categories unless the excluded terms are ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
arteymix committed Dec 11, 2023
1 parent a544a75 commit 5abaf93
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 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, true, 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, excludedTerms) {
updateAvailableCategories(query, filter, excludedCategories, excludeFreeTextCategories, excludedTerms) {
let disallowedPrefixes = [
"allCharacteristics.",
"characteristics.",
Expand All @@ -449,6 +449,9 @@ export default {
if (excludedCategories !== undefined) {
payload["excludedCategories"] = excludedCategories;
}
if (excludeFreeTextCategories) {
payload["excludeFreeTextCategories"] = excludeFreeTextCategories;
}
if (excludedTerms !== undefined) {
payload["excludedTerms"] = excludedTerms;
}
Expand Down Expand Up @@ -623,7 +626,7 @@ export default {
this.updateOpenApiSpecification(),
this.updateAvailableTaxa(query, filter),
this.updateAvailablePlatforms(query, filter),
this.updateAvailableCategories(query, filter, excludedCategories, excludedTerms),
this.updateAvailableCategories(query, filter, excludedCategories, true, excludedTerms),
this.browse(this.browsingOptions)])
.catch(swallowCancellation)
.catch(err => console.error(`Error while loading initial data: ${err.message}.`, err));
Expand Down Expand Up @@ -663,7 +666,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, excludedTerms));
.then(([excludedCategories, excludedTerms]) => this.updateAvailableCategories(newVal.query, newVal.filter, excludedCategories, true, excludedTerms));
}
} else {
promise = Promise.resolve();
Expand Down

0 comments on commit 5abaf93

Please sign in to comment.