Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Add link to external participant level search to filters block #2988

Merged
merged 5 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
} from "../authentication/profile"
import { Button } from "@openneuro/components/button"
import { Loading } from "@openneuro/components/loading"
import { NeurobagelSearch } from "@openneuro/components/search-page"
import {
AgeRangeInput,
AllDatasetsToggle,
Expand Down Expand Up @@ -156,6 +157,7 @@
)}
renderSearchFacets={() => (
<>
<NeurobagelSearch />

Check warning on line 160 in packages/openneuro-app/src/scripts/search/search-container.tsx

View check run for this annotation

Codecov / codecov/patch

packages/openneuro-app/src/scripts/search/search-container.tsx#L160

Added line #L160 was not covered by tests
<KeywordInput />
<AdminUser>
<AllDatasetsToggle />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import { FilterDateItem } from "./FilterDateItem"
import { TermListItem } from "./TermListItem"
import { FacetSelectValueType } from "../facets/FacetSelect"
import { NeurobagelSearch } from "./NeurobagelSearch"


export interface FiltersBlockProps {
keywords: string[]
Expand Down Expand Up @@ -67,6 +69,7 @@

return (
<div className="filters-block">
{/* <NeurobagelSearch /> */}

Check warning on line 72 in packages/openneuro-components/src/search-page/FiltersBlock.tsx

View check run for this annotation

Codecov / codecov/patch

packages/openneuro-components/src/search-page/FiltersBlock.tsx#L72

Added line #L72 was not covered by tests
<h2>
{noFilters
? (
Expand Down
59 changes: 59 additions & 0 deletions packages/openneuro-components/src/search-page/NeurobagelSearch.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import React from "react"

import NeurobagelLogo from "./neurobagel_logo.svg"
import { AccordionTab } from "../accordion/AccordionTab"
import { AccordionWrap } from "../accordion/AccordionWrap"
import styled from "@emotion/styled"

const NeurobagelSearchDiv = styled.div`
padding-bottom: 15px;
border-bottom: 1px solid #dfdfdf; // $newspaper in _variables.scss
margin-bottom: 10px;
img.inline-icon {
height: 1.1em;
vertical-align: middle;
}
.on-accordion-wrapper .keyword-accordion {
.accordion-title {
position: absolute;
top: -20px;
@media (max-width: 421px) {
left: 93px;
}
@media (max-width: 330px) {
left: 130px;
}
left: 375px;
}
}
`

export const NeurobagelSearch = () => {
return (
<NeurobagelSearchDiv>
<img src={NeurobagelLogo} className="inline-icon"/>{" "}
<a href="https://query.neurobagel.org/?node=OpenNeuro" target="_blank">
Search at the participant-level with Neurobagel
</a>
<AccordionWrap>
<AccordionTab
accordionStyle="plain"
label="?"
className="keyword-accordion"
>
<span>
Search at the participant level is provided by{" "}
<a href="https://neurobagel.org" target="_blank">
Neurobagel
</a>
{", "}a third party project.

Neurobagel is a collection of tools for harmonizing phenotypic
and imaging data descriptions, searching for participants across datasets,
and constructing cohorts from multiple source datasets.
</span>
</AccordionTab>
</AccordionWrap>
</NeurobagelSearchDiv>
)
}

Check warning on line 59 in packages/openneuro-components/src/search-page/NeurobagelSearch.tsx

View check run for this annotation

Codecov / codecov/patch

packages/openneuro-components/src/search-page/NeurobagelSearch.tsx#L32-L59

Added lines #L32 - L59 were not covered by tests
2 changes: 2 additions & 0 deletions packages/openneuro-components/src/search-page/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { SearchResultsList } from "./SearchResultsList"
import { FiltersBlock } from "./FiltersBlock"
import { SearchPage } from "./SearchPage"
import { SearchSort } from "./SearchSort"
import { NeurobagelSearch } from "./NeurobagelSearch"

/* TEMPORARY EXPORTS */
// TODO: remove
Expand All @@ -15,4 +16,5 @@ export {
SearchResultsList,
SearchSort,
SearchSortContainerExample,
NeurobagelSearch
}
75 changes: 75 additions & 0 deletions packages/openneuro-components/src/search-page/neurobagel_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading