Skip to content

Commit

Permalink
Merge pull request #469 from EBISPOT/issue-302
Browse files Browse the repository at this point in the history
issue-302: fix search from ontology page
  • Loading branch information
serjoshua authored Aug 11, 2023
2 parents fb67055 + e247570 commit c961ac9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frontend/src/components/SearchBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ export default function SearchBox({
let autocompleteElements = autocompleteToShow.map(
(autocomplete, i): SearchBoxEntry => {
searchParams.set("q", autocomplete.autosuggest);
if (ontologyId) searchParams.set("ontology", ontologyId);
const linkUrl = `/search?${new URLSearchParams(searchParams)}`;
return {
linkUrl,
Expand Down Expand Up @@ -329,6 +330,7 @@ export default function SearchBox({
navigate(allDropdownElements[arrowKeySelectedN].linkUrl);
} else if (query) {
searchParams.set("q", query);
if (ontologyId) searchParams.set("ontology", ontologyId);
navigate(`/search?${new URLSearchParams(searchParams)}`);
}
} else if (ev.key === "ArrowDown") {
Expand Down Expand Up @@ -382,6 +384,8 @@ export default function SearchBox({
onClick={() => {
if (query) {
searchParams.set("q", query);
if (ontologyId)
searchParams.set("ontology", ontologyId);
navigate(`/search?${new URLSearchParams(searchParams)}`);
}
}}
Expand All @@ -398,6 +402,7 @@ export default function SearchBox({
onClick={() => {
if (query) {
searchParams.set("q", query);
if (ontologyId) searchParams.set("ontologyId", ontologyId);
navigate(`/search?${new URLSearchParams(searchParams)}`);
}
}}
Expand Down

0 comments on commit c961ac9

Please sign in to comment.