@openneuro/app 4.36.1 → 4.37.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -3
- package/src/scripts/components/accordion/accordion.scss +1 -1
- package/src/scripts/components/activity-slider/ActivitySlider.tsx +4 -22
- package/src/scripts/components/activity-slider/slider.scss +1 -82
- package/src/scripts/components/button/button.scss +1 -1
- package/src/scripts/components/count-toggle/count-toggle.scss +1 -1
- package/src/scripts/components/dropdown/dropdown.scss +1 -1
- package/src/scripts/components/facets/facet.scss +5 -4
- package/src/scripts/components/footer/footer.scss +1 -1
- package/src/scripts/components/front-page/front-page.scss +1 -1
- package/src/scripts/components/header/header.scss +1 -1
- package/src/scripts/components/input/input.scss +1 -1
- package/src/scripts/components/input/term-search.scss +1 -1
- package/src/scripts/components/loading/loading.scss +1 -1
- package/src/scripts/components/modal/modal.scss +1 -1
- package/src/scripts/components/modality-cube/ModalityHexagon.tsx +29 -0
- package/src/scripts/components/modality-cube/modality-cube.scss +1 -1
- package/src/scripts/components/modality-cube/modality-hexagon.scss +93 -0
- package/src/scripts/components/page/page.scss +1 -1
- package/src/scripts/components/progress-bar/progress-bar.scss +1 -1
- package/src/scripts/components/radio/radio.scss +2 -2
- package/src/scripts/components/range/TwoHandleRange.scss +3 -3
- package/src/scripts/components/read-more/read-more.scss +1 -1
- package/src/scripts/components/scss/upload-modal.scss +1 -1
- package/src/scripts/components/tooltip/tooltip.scss +1 -1
- package/src/scripts/dataset/__tests__/__snapshots__/snapshot-container.spec.tsx.snap +132 -128
- package/src/scripts/dataset/__tests__/draft-container.spec.tsx +136 -0
- package/src/scripts/dataset/common/follow-toggles.tsx +1 -1
- package/src/scripts/dataset/components/DatasetHeader.tsx +13 -16
- package/src/scripts/dataset/components/DatasetToolButton.tsx +6 -7
- package/src/scripts/dataset/components/DatasetTools.tsx +6 -2
- package/src/scripts/dataset/draft-container.tsx +30 -24
- package/src/scripts/dataset/files/{file-display.jsx → file-display.tsx} +32 -19
- package/src/scripts/dataset/routes/tab-routes-draft.tsx +6 -1
- package/src/scripts/dataset/routes/tab-routes-snapshot.tsx +5 -1
- package/src/scripts/dataset/snapshot-container.tsx +37 -43
- package/src/scripts/scss/dataset/dataset-page.scss +44 -120
- package/src/scripts/scss/variables.scss +65 -13
- package/src/scripts/{components/search-page → search}/__tests__/NuerobagelSearch.spec.tsx +1 -1
- package/src/scripts/search/components/DatasetsRadioTabs.tsx +103 -0
- package/src/scripts/{components/search-page → search/components}/FilterListItem.tsx +1 -1
- package/src/scripts/{components/search-page → search/components}/FiltersBlock.tsx +5 -8
- package/src/scripts/search/components/MetaListItemList.tsx +31 -0
- package/src/scripts/{components/search-page → search/components}/SearchPage.tsx +15 -8
- package/src/scripts/search/components/SearchResultDetails.tsx +167 -0
- package/src/scripts/{components/search-page → search/components}/SearchResultItem.tsx +57 -173
- package/src/scripts/search/components/SearchResultsList.tsx +45 -0
- package/src/scripts/{components/search-page → search/components}/SearchSort.tsx +2 -2
- package/src/scripts/search/filters-block-container.tsx +1 -1
- package/src/scripts/search/inputs/index.ts +0 -4
- package/src/scripts/search/inputs/sliding-radio-group.tsx +127 -0
- package/src/scripts/search/inputs/sort-by-select.tsx +1 -1
- package/src/scripts/{components/search-page → search/scss}/filters-block.scss +1 -1
- package/src/scripts/{components/search-page → search/scss}/search-page.scss +123 -92
- package/src/scripts/search/scss/search-result-details.scss +70 -0
- package/src/scripts/{components/search-page → search/scss}/search-result.scss +29 -56
- package/src/scripts/{components/search-page → search/scss}/search-sort.scss +1 -1
- package/src/scripts/search/scss/sliding-radio-group.scss +115 -0
- package/src/scripts/search/search-container.tsx +90 -24
- package/src/scripts/search/use-search-results.tsx +3 -0
- package/src/scripts/users/github-auth-button.tsx +1 -1
- package/src/scripts/components/scss/_variables.scss +0 -245
- package/src/scripts/components/search-page/SearchResultsList.tsx +0 -29
- package/src/scripts/dataset/files/index.tsx +0 -6
- package/src/scripts/search/inputs/admin-allDatasets-toggle.tsx +0 -47
- package/src/scripts/search/inputs/show-datasets-radios.tsx +0 -74
- /package/src/scripts/{components/search-page → search/components}/CommunityHeader.tsx +0 -0
- /package/src/scripts/{components/search-page → search/components}/FacetBlockContainerExample.tsx +0 -0
- /package/src/scripts/{components/search-page → search/components}/FilterDateItem.tsx +0 -0
- /package/src/scripts/{components/search-page → search/components}/ModalityHeader.tsx +0 -0
- /package/src/scripts/{components/search-page → search/components}/NeurobagelSearch.tsx +0 -0
- /package/src/scripts/{components/search-page → search/components}/SearchSortContainerExample.tsx +0 -0
- /package/src/scripts/{components/search-page → search/components}/TermListItem.tsx +0 -0
- /package/src/scripts/{components/search-page → search/components}/neurobagel_logo.svg +0 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
@import '../../scss/variables';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// Root container for the general SlidingRadioGroup component
|
|
6
|
+
.sliding-radio-group-root {
|
|
7
|
+
*,
|
|
8
|
+
*::before,
|
|
9
|
+
*::after {
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
}
|
|
12
|
+
&.btn-group-wrapper.facet-radio.show-dataset-radios-container {
|
|
13
|
+
position: relative;
|
|
14
|
+
margin: 0 0 10px;
|
|
15
|
+
background-color: #f6f6f6;
|
|
16
|
+
border: 1px solid #eee;
|
|
17
|
+
border-radius: 4px;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
min-height: 40px;
|
|
20
|
+
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: row;
|
|
23
|
+
align-items: stretch;
|
|
24
|
+
justify-content: flex-start;
|
|
25
|
+
|
|
26
|
+
&:after {
|
|
27
|
+
content: none;
|
|
28
|
+
display: none;
|
|
29
|
+
background: none;
|
|
30
|
+
position: static;
|
|
31
|
+
width: 0;
|
|
32
|
+
height: 0;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Styles for .dataset-filter-radio (individual radio button wrapper)
|
|
37
|
+
.dataset-filter-radio {
|
|
38
|
+
margin: 0;
|
|
39
|
+
|
|
40
|
+
[type='radio']:checked,
|
|
41
|
+
[type='radio']:not(:checked) {
|
|
42
|
+
position: absolute;
|
|
43
|
+
left: -9999px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
> label {
|
|
47
|
+
font-size: 13px;
|
|
48
|
+
line-height: 1.7em;
|
|
49
|
+
position: relative;
|
|
50
|
+
cursor: pointer;
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
height: 100%;
|
|
55
|
+
white-space: nowrap;
|
|
56
|
+
padding: 6px 12px;
|
|
57
|
+
border-right: 1px solid #ddd;
|
|
58
|
+
|
|
59
|
+
&::before,
|
|
60
|
+
&::after {
|
|
61
|
+
display: none;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&:last-child > label,
|
|
66
|
+
label.is-active {
|
|
67
|
+
border-right: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
input[type='radio']:focus-within + label {
|
|
71
|
+
box-shadow: inset 0 0 3px 1px #00a3ff;
|
|
72
|
+
outline: 0;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Styles for the inner group of radio buttons container
|
|
77
|
+
|
|
78
|
+
.show-dataset-radios-group {
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-direction: row;
|
|
81
|
+
justify-content: flex-start;
|
|
82
|
+
align-items: stretch;
|
|
83
|
+
z-index: 1;
|
|
84
|
+
position: relative;
|
|
85
|
+
width: 100%;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.sliding-highlight {
|
|
89
|
+
position: absolute;
|
|
90
|
+
background-color: var(--current-theme-primary);
|
|
91
|
+
border-radius: 4px;
|
|
92
|
+
|
|
93
|
+
transition: left 0.3s ease, width 0.3s ease, top 0.3s ease, height 0.3s ease,
|
|
94
|
+
opacity 0.3s ease;
|
|
95
|
+
z-index: 0;
|
|
96
|
+
opacity: 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
//Specific button states within this component (text color changes)
|
|
100
|
+
|
|
101
|
+
.dataset-filter-radio {
|
|
102
|
+
> label {
|
|
103
|
+
color: var(--current-theme-primary);
|
|
104
|
+
background-color: transparent;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
[type='radio']:checked + label {
|
|
108
|
+
color: #fff;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
[type='radio']:not(:checked) + label:hover {
|
|
112
|
+
color: var(--current-theme-primary-dark);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import React, { useContext, useEffect } from "react"
|
|
1
|
+
import React, { useContext, useEffect, useRef, useState } from "react"
|
|
2
2
|
import type { FC } from "react"
|
|
3
|
+
import * as Sentry from "@sentry/react"
|
|
3
4
|
import { useLocation } from "react-router-dom"
|
|
4
|
-
import { SearchPage } from "
|
|
5
|
-
import { SearchResultsList } from "
|
|
6
|
-
import { NeurobagelSearch } from "
|
|
5
|
+
import { SearchPage } from "./components/SearchPage"
|
|
6
|
+
import { SearchResultsList } from "./components/SearchResultsList"
|
|
7
|
+
import { NeurobagelSearch } from "./components/NeurobagelSearch"
|
|
7
8
|
import { Button } from "../components/button/Button"
|
|
8
9
|
import { Loading } from "../components/loading/Loading"
|
|
10
|
+
import { modalityShortMapping } from "../components/formatting/modality-label"
|
|
11
|
+
|
|
9
12
|
import {
|
|
10
13
|
AgeRangeInput,
|
|
11
|
-
AllDatasetsToggle,
|
|
12
14
|
AuthorInput,
|
|
13
15
|
BodyPartsInput,
|
|
14
16
|
DatasetTypeSelect,
|
|
@@ -21,7 +23,6 @@ import {
|
|
|
21
23
|
ScannerManufacturersModelNames,
|
|
22
24
|
SectionSelect,
|
|
23
25
|
SexRadios,
|
|
24
|
-
ShowDatasetRadios,
|
|
25
26
|
SortBySelect,
|
|
26
27
|
SpeciesSelect,
|
|
27
28
|
StudyDomainInput,
|
|
@@ -30,13 +31,15 @@ import {
|
|
|
30
31
|
TracerNames,
|
|
31
32
|
TracerRadionuclides,
|
|
32
33
|
} from "./inputs"
|
|
34
|
+
import { DatasetsRadioTabs } from "./components/DatasetsRadioTabs"
|
|
33
35
|
import FiltersBlockContainer from "./filters-block-container"
|
|
34
36
|
import AggregateCountsContainer from "../pages/front-page/aggregate-queries/aggregate-counts-container"
|
|
35
37
|
import { useSearchResults } from "./use-search-results"
|
|
36
38
|
import { SearchParamsCtx } from "./search-params-ctx"
|
|
37
39
|
import type { SearchParams } from "./initial-search-params"
|
|
38
40
|
import Helmet from "react-helmet"
|
|
39
|
-
import
|
|
41
|
+
import type { SearchResultItemProps } from "./components/SearchResultItem"
|
|
42
|
+
import { SearchResultDetails } from "./components/SearchResultDetails"
|
|
40
43
|
|
|
41
44
|
export interface SearchContainerProps {
|
|
42
45
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
@@ -97,7 +100,8 @@ export const setDefaultSearch = (
|
|
|
97
100
|
|
|
98
101
|
// Check for grant-related conditions
|
|
99
102
|
if (
|
|
100
|
-
is_grant_portal &&
|
|
103
|
+
is_grant_portal &&
|
|
104
|
+
grant === "nih" &&
|
|
101
105
|
searchParams.brain_initiative !== "true"
|
|
102
106
|
) {
|
|
103
107
|
setSearchParams((prevState) => ({
|
|
@@ -153,12 +157,59 @@ const SearchContainer: FC<SearchContainerProps> = ({ portalContent }) => {
|
|
|
153
157
|
hasNextPage = data.datasets.pageInfo.hasNextPage
|
|
154
158
|
}
|
|
155
159
|
|
|
160
|
+
const [clickedItemData, setClickedItemData] = useState<
|
|
161
|
+
SearchResultItemProps["node"] | null
|
|
162
|
+
>(null)
|
|
163
|
+
|
|
164
|
+
const lastOpenedButtonRef = useRef<HTMLButtonElement | null>(null)
|
|
165
|
+
|
|
166
|
+
useEffect(() => {
|
|
167
|
+
setClickedItemData(null)
|
|
168
|
+
}, [JSON.stringify(searchParams)])
|
|
169
|
+
|
|
170
|
+
// handleItemClick to accept itemId and event, and store the event.currentTarget
|
|
171
|
+
const handleItemClick = (
|
|
172
|
+
itemId: string,
|
|
173
|
+
event: React.MouseEvent<HTMLButtonElement>,
|
|
174
|
+
) => {
|
|
175
|
+
const nodeData =
|
|
176
|
+
resultsList.find((item) => item.node.id === itemId)?.node || null
|
|
177
|
+
|
|
178
|
+
if (!nodeData) {
|
|
179
|
+
Sentry.captureException(`Error: nodeData not found for ID: ${itemId}`)
|
|
180
|
+
return
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (clickedItemData && clickedItemData.id === nodeData.id) {
|
|
184
|
+
// If the same item is clicked again, close details
|
|
185
|
+
setClickedItemData(null)
|
|
186
|
+
// Focus will be returned by handleCloseDetails
|
|
187
|
+
} else {
|
|
188
|
+
setClickedItemData(nodeData)
|
|
189
|
+
lastOpenedButtonRef.current = event.currentTarget
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// handleCloseDetails to use setTimeout for focus
|
|
194
|
+
const handleCloseDetails = () => {
|
|
195
|
+
setClickedItemData(null)
|
|
196
|
+
setTimeout(() => {
|
|
197
|
+
if (lastOpenedButtonRef.current) {
|
|
198
|
+
lastOpenedButtonRef.current.focus()
|
|
199
|
+
lastOpenedButtonRef.current = null
|
|
200
|
+
}
|
|
201
|
+
}, 0)
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const labelText = modality ? modalityShortMapping(modality) : null
|
|
205
|
+
|
|
156
206
|
return (
|
|
157
207
|
<>
|
|
158
208
|
<Helmet>
|
|
159
|
-
<title>OpenNeuro - {
|
|
209
|
+
<title>OpenNeuro - {labelText || selected_grant || ""} Search</title>
|
|
160
210
|
</Helmet>
|
|
161
211
|
<SearchPage
|
|
212
|
+
hasDetailsOpen={!!clickedItemData}
|
|
162
213
|
portalContent={portalContent}
|
|
163
214
|
renderAggregateCounts={() =>
|
|
164
215
|
portalContent.modality
|
|
@@ -172,20 +223,27 @@ const SearchContainer: FC<SearchContainerProps> = ({ portalContent }) => {
|
|
|
172
223
|
)}
|
|
173
224
|
renderSortBy={() => <SortBySelect variables={variables} />}
|
|
174
225
|
renderSearchHeader={() => (
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
226
|
+
<div className="grid grid-between grid-nogutter">
|
|
227
|
+
<div className="col-lg">
|
|
228
|
+
{portalContent
|
|
229
|
+
? (
|
|
230
|
+
<h2>
|
|
231
|
+
{"Search " + (labelText || selected_grant || "") +
|
|
232
|
+
" Portal"}
|
|
233
|
+
</h2>
|
|
234
|
+
)
|
|
235
|
+
: <h1>{"Search All Datasets"}</h1>}
|
|
236
|
+
</div>
|
|
237
|
+
<div className="col-lg text-right">
|
|
238
|
+
<DatasetsRadioTabs />
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
180
241
|
)}
|
|
181
242
|
renderSearchFacets={() => (
|
|
182
243
|
<>
|
|
183
244
|
<NeurobagelSearch />
|
|
184
245
|
<KeywordInput />
|
|
185
|
-
|
|
186
|
-
<AllDatasetsToggle />
|
|
187
|
-
</AdminUser>
|
|
188
|
-
{!searchParams.searchAllDatasets && <ShowDatasetRadios />}
|
|
246
|
+
|
|
189
247
|
{!portalContent
|
|
190
248
|
? <ModalitySelect portalStyles={true} label="Modalities" />
|
|
191
249
|
: <ModalitySelect portalStyles={false} label="Choose Modality" />}
|
|
@@ -233,18 +291,26 @@ const SearchContainer: FC<SearchContainerProps> = ({ portalContent }) => {
|
|
|
233
291
|
<SearchResultsList
|
|
234
292
|
items={resultsList}
|
|
235
293
|
datasetTypeSelected={searchParams.datasetType_selected}
|
|
294
|
+
clickedItemData={clickedItemData}
|
|
295
|
+
handleItemClick={handleItemClick}
|
|
236
296
|
/>
|
|
237
297
|
{/* TODO: make div below into display component. */}
|
|
238
298
|
<div className="grid grid-nogutter" style={{ width: "100%" }}>
|
|
239
|
-
{hasNextPage && resultsList.length > 0 &&
|
|
240
|
-
|
|
241
|
-
<
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
)}
|
|
299
|
+
{hasNextPage && resultsList.length > 0 && (
|
|
300
|
+
<div className="col col-12 load-more m-t-10">
|
|
301
|
+
<Button label="Load More" onClick={loadMore} />
|
|
302
|
+
</div>
|
|
303
|
+
)}
|
|
245
304
|
</div>
|
|
246
305
|
</>
|
|
247
306
|
)}
|
|
307
|
+
renderItemDetails={() =>
|
|
308
|
+
clickedItemData && (
|
|
309
|
+
<SearchResultDetails
|
|
310
|
+
itemData={clickedItemData}
|
|
311
|
+
onClose={handleCloseDetails}
|
|
312
|
+
/>
|
|
313
|
+
)}
|
|
248
314
|
/>
|
|
249
315
|
</>
|
|
250
316
|
)
|
|
@@ -61,8 +61,10 @@ const searchQuery = gql`
|
|
|
61
61
|
}
|
|
62
62
|
latestSnapshot {
|
|
63
63
|
size
|
|
64
|
+
readme
|
|
64
65
|
summary {
|
|
65
66
|
modalities
|
|
67
|
+
primaryModality
|
|
66
68
|
secondaryModalities
|
|
67
69
|
sessions
|
|
68
70
|
subjects
|
|
@@ -94,6 +96,7 @@ const searchQuery = gql`
|
|
|
94
96
|
description {
|
|
95
97
|
Name
|
|
96
98
|
Authors
|
|
99
|
+
DatasetDOI
|
|
97
100
|
}
|
|
98
101
|
}
|
|
99
102
|
analytics {
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
$font-sans: 'Open Sans', sans-serif;
|
|
2
|
-
|
|
3
|
-
//old vars
|
|
4
|
-
$white: #fff;
|
|
5
|
-
$black: #000;
|
|
6
|
-
$mine-shaft: #222;
|
|
7
|
-
$stanford-red: #8c1515;
|
|
8
|
-
$coral: #eb472c;
|
|
9
|
-
$salmon: #ec7764;
|
|
10
|
-
|
|
11
|
-
$rock: #5f574f;
|
|
12
|
-
$stone: #928b81;
|
|
13
|
-
$driftwood: #b6b1a9;
|
|
14
|
-
$misty: #dad7cb;
|
|
15
|
-
|
|
16
|
-
$fuchsia: #9169a7;
|
|
17
|
-
|
|
18
|
-
$ocean: #00505c;
|
|
19
|
-
$algae: #175e54;
|
|
20
|
-
$sky: rgb(0, 124, 146);
|
|
21
|
-
$turquoise: #009b76;
|
|
22
|
-
$persian-green: #00b489;
|
|
23
|
-
$night: #012a30;
|
|
24
|
-
$jungle-mist: #b5cbd3;
|
|
25
|
-
$dodger-blue: #5890ff;
|
|
26
|
-
|
|
27
|
-
$yellow: #ffd820;
|
|
28
|
-
$honey: #fffcee;
|
|
29
|
-
|
|
30
|
-
$success: #24c85e;
|
|
31
|
-
$info: #24c8c8;
|
|
32
|
-
$warning: #f7ba4b;
|
|
33
|
-
$danger: #c82424;
|
|
34
|
-
|
|
35
|
-
$notification-green: #77e6a3;
|
|
36
|
-
|
|
37
|
-
$warning-orange-cream: #ffefdb;
|
|
38
|
-
$warning-orange: #df7600;
|
|
39
|
-
|
|
40
|
-
//end old vars
|
|
41
|
-
|
|
42
|
-
$charcoal: #333;
|
|
43
|
-
$newspaper: #dfdfdf;
|
|
44
|
-
|
|
45
|
-
/* SCSS RGB */
|
|
46
|
-
$on-light-aqua: rgb(55, 188, 210);
|
|
47
|
-
$on-dark-aqua: rgba(32, 78, 90, 1);
|
|
48
|
-
$on-secondary: #196583;
|
|
49
|
-
$on-dark-aqua-light: #e5f4f7;
|
|
50
|
-
|
|
51
|
-
$mri-theme: rgba(79, 51, 130, 1);
|
|
52
|
-
$mri-hover: adjust-color($mri-theme, $lightness: 10%);
|
|
53
|
-
$mri-dark: darken($mri-theme, 25%);
|
|
54
|
-
$mri-secondary: adjust-color($mri-theme, $lightness: 15%);
|
|
55
|
-
$mri-light: adjust-color($mri-theme, $lightness: 45%);
|
|
56
|
-
|
|
57
|
-
$eeg-theme: rgba(134, 31, 55, 1);
|
|
58
|
-
$eeg-hover: adjust-color($eeg-theme, $lightness: 10%);
|
|
59
|
-
$eeg-dark: darken($eeg-theme, 25%);
|
|
60
|
-
$eeg-secondary: adjust-color($eeg-theme, $lightness: 15%);
|
|
61
|
-
$eeg-light: adjust-color($eeg-theme, $lightness: 45%);
|
|
62
|
-
|
|
63
|
-
$pet-theme: rgba(0, 105, 192, 1);
|
|
64
|
-
$pet-hover: adjust-color($pet-theme, $lightness: 10%);
|
|
65
|
-
$pet-dark: darken($pet-theme, 25%);
|
|
66
|
-
$pet-secondary: adjust-color($pet-theme, $lightness: 15%);
|
|
67
|
-
$pet-light: adjust-color($pet-theme, $lightness: 45%);
|
|
68
|
-
|
|
69
|
-
$nih-theme: rgb(34, 133, 148);
|
|
70
|
-
$nih-hover: adjust-color($nih-theme, $lightness: 10%);
|
|
71
|
-
$nih-dark: rgba(32, 85, 138, 1);
|
|
72
|
-
$nih-secondary: adjust-color($nih-theme, $lightness: 15%);
|
|
73
|
-
$nih-light: rgba(155, 211, 221, 1);
|
|
74
|
-
|
|
75
|
-
$ieeg-theme: rgba(18, 109, 62, 1);
|
|
76
|
-
$ieeg-hover: adjust-color($ieeg-theme, $lightness: 10%);
|
|
77
|
-
$ieeg-dark: darken($ieeg-theme, 25%);
|
|
78
|
-
$ieeg-secondary: adjust-color($ieeg-theme, $lightness: 15%);
|
|
79
|
-
$ieeg-light: rgb(200, 212, 153);
|
|
80
|
-
|
|
81
|
-
$meg-theme: rgba(156, 57, 0, 1);
|
|
82
|
-
$meg-hover: adjust-color($meg-theme, $lightness: 10%);
|
|
83
|
-
$meg-dark: darken($meg-theme, 25%);
|
|
84
|
-
$meg-secondary: adjust-color($meg-theme, $lightness: 15%);
|
|
85
|
-
$meg-light: adjust-color($meg-theme, $lightness: 45%);
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
$nirs-theme: rgb(166 21 40);
|
|
89
|
-
$nirs-hover: adjust-color($nirs-theme, $lightness: 10%);
|
|
90
|
-
$nirs-dark: darken($nirs-theme, 25%);
|
|
91
|
-
$nirs-secondary: adjust-color($nirs-theme, $lightness: 15%);
|
|
92
|
-
$nirs-light: adjust-color($nirs-theme, $lightness: 45%);
|
|
93
|
-
|
|
94
|
-
$on-light-green: #00eeb5;
|
|
95
|
-
$on-light-red: #c00342;
|
|
96
|
-
$on-light-orange: rgb(255, 110, 43);
|
|
97
|
-
|
|
98
|
-
$primary: $on-dark-aqua;
|
|
99
|
-
|
|
100
|
-
$chiclet-color: #a2059e;
|
|
101
|
-
|
|
102
|
-
/* CSS HEX */
|
|
103
|
-
:root {
|
|
104
|
-
--mri-theme: #{$mri-theme};
|
|
105
|
-
--eeg-theme: #{$eeg-theme};
|
|
106
|
-
--pet-theme: #{$pet-theme};
|
|
107
|
-
--ieeg-theme: #{$ieeg-theme};
|
|
108
|
-
--meg-theme: #{$meg-theme};
|
|
109
|
-
--nirs-theme: #{$nirs-theme};
|
|
110
|
-
|
|
111
|
-
--on-light-aqua: #{$on-light-aqua};
|
|
112
|
-
--on-dark-aqua: #{$on-dark-aqua};
|
|
113
|
-
--on-light-green: #{on-light-green};
|
|
114
|
-
|
|
115
|
-
--current-theme-primary: #{$on-dark-aqua};
|
|
116
|
-
--current-theme-primary-hover: #{$on-light-aqua};
|
|
117
|
-
--current-theme-secondary: #{$on-secondary};
|
|
118
|
-
--current-theme-primary-dark: #{$on-dark-aqua};
|
|
119
|
-
--current-theme-primary-light: #{$on-dark-aqua-light};
|
|
120
|
-
--current-theme-header: #333;
|
|
121
|
-
--current-theme-header-dark: #333;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.mri-theme {
|
|
125
|
-
background-color: $mri-theme;
|
|
126
|
-
}
|
|
127
|
-
.eeg-theme {
|
|
128
|
-
background-color: $eeg-theme;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.pet-theme {
|
|
132
|
-
background-color: $pet-theme;
|
|
133
|
-
}
|
|
134
|
-
.ieeg-theme {
|
|
135
|
-
background-color: $ieeg-theme;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.on-light-aqua {
|
|
139
|
-
background-color: $on-light-aqua;
|
|
140
|
-
}
|
|
141
|
-
.on-light-green {
|
|
142
|
-
background-color: $on-light-green;
|
|
143
|
-
}
|
|
144
|
-
.on-dark-aqua {
|
|
145
|
-
background-color: $on-dark-aqua;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.meg-theme {
|
|
149
|
-
background-color: $meg-theme;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.nih-theme {
|
|
153
|
-
background: $nih-theme;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.gray-bg {
|
|
157
|
-
background: #f3f3f3;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
//Base unit used for spacing gutters
|
|
161
|
-
$base-unit: 20px;
|
|
162
|
-
|
|
163
|
-
//Screen Sizes
|
|
164
|
-
$screen-sm: 480px;
|
|
165
|
-
$screen-md: 767px;
|
|
166
|
-
$screen-lg: 989px;
|
|
167
|
-
|
|
168
|
-
$border-radius-default: 4px;
|
|
169
|
-
|
|
170
|
-
.search-page-mri,
|
|
171
|
-
.dataset-page-mri {
|
|
172
|
-
--current-theme-primary: #{$mri-theme};
|
|
173
|
-
--current-theme-primary-hover: #{$mri-hover};
|
|
174
|
-
--current-theme-primary-dark: #{$mri-dark};
|
|
175
|
-
--current-theme-secondary: #{$mri-secondary};
|
|
176
|
-
--current-theme-primary-light: #{$mri-light};
|
|
177
|
-
--current-theme-header: #{$mri-theme};
|
|
178
|
-
--current-theme-header-dark: #{$mri-dark};
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.search-page-eeg,
|
|
182
|
-
.dataset-page-eeg {
|
|
183
|
-
--current-theme-primary: #{$eeg-theme};
|
|
184
|
-
--current-theme-primary-hover: #{$eeg-hover};
|
|
185
|
-
--current-theme-primary-dark: #{$eeg-dark};
|
|
186
|
-
--current-theme-secondary: #{$eeg-secondary};
|
|
187
|
-
--current-theme-primary-light: #{$eeg-light};
|
|
188
|
-
--current-theme-header: #{$eeg-theme};
|
|
189
|
-
--current-theme-header-dark: #{$eeg-dark};
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.search-page-pet,
|
|
193
|
-
.dataset-page-pet {
|
|
194
|
-
--current-theme-primary: #{$pet-theme};
|
|
195
|
-
--current-theme-primary-hover: #{$pet-hover};
|
|
196
|
-
--current-theme-primary-dark: #{$pet-dark};
|
|
197
|
-
--current-theme-secondary: #{$pet-secondary};
|
|
198
|
-
--current-theme-primary-light: #{$pet-light};
|
|
199
|
-
--current-theme-header: #{$pet-theme};
|
|
200
|
-
--current-theme-header-dark: #{$pet-dark};
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.search-page-nih,
|
|
204
|
-
.dataset-page-nih{
|
|
205
|
-
--current-theme-primary: #{$nih-theme};
|
|
206
|
-
--current-theme-primary-hover: #{$nih-hover};
|
|
207
|
-
--current-theme-primary-dark: #{$nih-dark};
|
|
208
|
-
--current-theme-secondary: #{$nih-secondary};
|
|
209
|
-
--current-theme-primary-light: #{$nih-light};
|
|
210
|
-
--current-theme-header: #{$nih-theme};
|
|
211
|
-
--current-theme-header-dark: #{$nih-dark};
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.search-page-ieeg,
|
|
215
|
-
.dataset-page-ieeg {
|
|
216
|
-
--current-theme-primary: #{$ieeg-theme};
|
|
217
|
-
--current-theme-primary-hover: #{$ieeg-hover};
|
|
218
|
-
--current-theme-primary-dark: #{$ieeg-dark};
|
|
219
|
-
--current-theme-secondary: #{$ieeg-secondary};
|
|
220
|
-
--current-theme-primary-light: #{$ieeg-light};
|
|
221
|
-
--current-theme-header: #{$ieeg-theme};
|
|
222
|
-
--current-theme-header-dark: #{$ieeg-dark};
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
.search-page-meg,
|
|
226
|
-
.dataset-page-meg {
|
|
227
|
-
--current-theme-primary: #{$meg-theme};
|
|
228
|
-
--current-theme-primary-hover: #{$meg-hover};
|
|
229
|
-
--current-theme-primary-dark: #{$meg-dark};
|
|
230
|
-
--current-theme-secondary: #{$meg-secondary};
|
|
231
|
-
--current-theme-primary-light: #{$meg-light};
|
|
232
|
-
--current-theme-header: #{$meg-theme};
|
|
233
|
-
--current-theme-header-dark: #{$meg-dark};
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
.search-page-nirs,
|
|
237
|
-
.dataset-page-nirs {
|
|
238
|
-
--current-theme-primary: #{$nirs-theme};
|
|
239
|
-
--current-theme-primary-hover: #{$nirs-hover};
|
|
240
|
-
--current-theme-primary-dark: #{$nirs-dark};
|
|
241
|
-
--current-theme-secondary: #{$nirs-secondary};
|
|
242
|
-
--current-theme-primary-light: #{$nirs-light};
|
|
243
|
-
--current-theme-header: #{$nirs-theme};
|
|
244
|
-
--current-theme-header-dark: #{$nirs-dark};
|
|
245
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
import { SearchResultItem } from "./SearchResultItem"
|
|
3
|
-
import "./search-page.scss"
|
|
4
|
-
|
|
5
|
-
export interface SearchResultsListProps {
|
|
6
|
-
items
|
|
7
|
-
datasetTypeSelected: string
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export const SearchResultsList = ({
|
|
11
|
-
items,
|
|
12
|
-
datasetTypeSelected,
|
|
13
|
-
}: SearchResultsListProps) => {
|
|
14
|
-
return (
|
|
15
|
-
<div className="search-results">
|
|
16
|
-
{items.map((data) => {
|
|
17
|
-
if (data) {
|
|
18
|
-
return (
|
|
19
|
-
<SearchResultItem
|
|
20
|
-
node={data.node}
|
|
21
|
-
key={data.node.id}
|
|
22
|
-
datasetTypeSelected={datasetTypeSelected}
|
|
23
|
-
/>
|
|
24
|
-
)
|
|
25
|
-
}
|
|
26
|
-
})}
|
|
27
|
-
</div>
|
|
28
|
-
)
|
|
29
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React, { useContext } from "react"
|
|
2
|
-
import type { FC } from "react"
|
|
3
|
-
import { SearchParamsCtx } from "../search-params-ctx"
|
|
4
|
-
import { Button } from "../../components/button/Button"
|
|
5
|
-
import styled from "@emotion/styled"
|
|
6
|
-
|
|
7
|
-
const StyledButton = styled(Button)`
|
|
8
|
-
width: auto;
|
|
9
|
-
padding: 6px 10px;
|
|
10
|
-
margin-bottom: 20px;
|
|
11
|
-
justify-content: flex-start;
|
|
12
|
-
&.active {
|
|
13
|
-
background: #fff5f3;
|
|
14
|
-
border-color: #e68383;
|
|
15
|
-
color: #710000;
|
|
16
|
-
i {
|
|
17
|
-
color: #710000;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
`
|
|
21
|
-
|
|
22
|
-
const TaskInput: FC = () => {
|
|
23
|
-
const {
|
|
24
|
-
searchParams: { searchAllDatasets },
|
|
25
|
-
setSearchParams,
|
|
26
|
-
} = useContext(SearchParamsCtx)
|
|
27
|
-
|
|
28
|
-
const toggleSearchAllDatasets = () =>
|
|
29
|
-
setSearchParams((prevState) => ({
|
|
30
|
-
...prevState,
|
|
31
|
-
searchAllDatasets: !prevState.searchAllDatasets,
|
|
32
|
-
}))
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<StyledButton
|
|
36
|
-
className={searchAllDatasets ? "active toggle-btn" : "toggle-btn"}
|
|
37
|
-
onClick={toggleSearchAllDatasets}
|
|
38
|
-
icon={searchAllDatasets ? "fas fa-check-square" : "far fa-square"}
|
|
39
|
-
label={searchAllDatasets
|
|
40
|
-
? "Admin: Searching All Datasets"
|
|
41
|
-
: "Admin: Search All Datasets"}
|
|
42
|
-
>
|
|
43
|
-
</StyledButton>
|
|
44
|
-
)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export default TaskInput
|