@openneuro/app 4.33.4 → 4.34.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.
Files changed (302) hide show
  1. package/package.json +4 -3
  2. package/src/client.jsx +2 -1
  3. package/src/scripts/authentication/signOut.ts +1 -1
  4. package/src/scripts/common/containers/footer.tsx +1 -1
  5. package/src/scripts/common/containers/header.tsx +3 -2
  6. package/src/scripts/common/content/affiliate-content.jsx +72 -0
  7. package/src/scripts/common/content/assets/affiliates/bids.jpg +0 -0
  8. package/src/scripts/common/content/assets/affiliates/datalad.jpg +0 -0
  9. package/src/scripts/common/content/assets/affiliates/nih-bi-logo.png +0 -0
  10. package/src/scripts/common/content/assets/front-page/brand_mark.png +0 -0
  11. package/src/scripts/common/content/assets/front-page/cube-get.png +0 -0
  12. package/src/scripts/common/content/assets/front-page/cube-share.png +0 -0
  13. package/src/scripts/common/content/assets/front-page/cube-use.png +0 -0
  14. package/src/scripts/common/content/assets/front-page/ljaf.png +0 -0
  15. package/src/scripts/common/content/assets/front-page/logo_app.png +0 -0
  16. package/src/scripts/common/content/assets/front-page/logo_cube.png +0 -0
  17. package/src/scripts/common/content/assets/front-page/logo_data.png +0 -0
  18. package/src/scripts/common/content/assets/front-page/logo_users.png +0 -0
  19. package/src/scripts/common/content/assets/front-page/novo-logo.png +0 -0
  20. package/src/scripts/common/content/assets/front-page/nru-logo.png +0 -0
  21. package/src/scripts/common/content/assets/front-page/nsf.png +0 -0
  22. package/src/scripts/common/content/assets/front-page/sqm-logo.png +0 -0
  23. package/src/scripts/common/content/assets/front-page/squishymedia.png +0 -0
  24. package/src/scripts/common/content/assets/front-page/stanford.png +0 -0
  25. package/src/scripts/common/content/assets/modality-cubes/brain-initiative.jpg +0 -0
  26. package/src/scripts/common/content/assets/modality-cubes/eeg.jpg +0 -0
  27. package/src/scripts/common/content/assets/modality-cubes/ieeg.jpg +0 -0
  28. package/src/scripts/common/content/assets/modality-cubes/meg.jpg +0 -0
  29. package/src/scripts/common/content/assets/modality-cubes/mri.jpg +0 -0
  30. package/src/scripts/common/content/assets/modality-cubes/nih_cube.jpg +0 -0
  31. package/src/scripts/common/content/assets/modality-cubes/nirs.jpg +0 -0
  32. package/src/scripts/common/content/assets/modality-cubes/pet-scan.jpg +0 -0
  33. package/src/scripts/common/content/assets/portal-content/nih-bi-brand.png +0 -0
  34. package/src/scripts/common/content/facet-content.jsx +186 -0
  35. package/src/scripts/common/content/front-page-content.jsx +177 -0
  36. package/src/scripts/common/content/image-attribution.tsx +3 -3
  37. package/src/scripts/common/content/modality-cube-content.jsx +92 -0
  38. package/src/scripts/common/content/portal-content.jsx +149 -0
  39. package/src/scripts/common/content/portal-grant-content.jsx +30 -0
  40. package/src/scripts/common/content/sortby-list.jsx +18 -0
  41. package/src/scripts/common/forms/warn-button.jsx +1 -1
  42. package/src/scripts/components/accordion/AccordionTab.tsx +68 -0
  43. package/src/scripts/components/accordion/AccordionWrap.tsx +22 -0
  44. package/src/scripts/components/accordion/__tests__/AccordionTab.spec.tsx +35 -0
  45. package/src/scripts/components/accordion/accordion.scss +68 -0
  46. package/src/scripts/components/activity-slider/ActivitySlider.tsx +121 -0
  47. package/src/scripts/components/activity-slider/slider.scss +130 -0
  48. package/src/scripts/components/affiliate-article/AffiliateArticle.tsx +26 -0
  49. package/src/scripts/components/affiliate-article/affiliate.scss +32 -0
  50. package/src/scripts/components/aggregate-count/AggregateCount.tsx +20 -0
  51. package/src/scripts/components/assets/activity-icon.png +0 -0
  52. package/src/scripts/components/assets/close-button.png +0 -0
  53. package/src/scripts/components/assets/favicon copy.ico +0 -0
  54. package/src/scripts/components/assets/favicon.ico +0 -0
  55. package/src/scripts/components/assets/get_data_browse.png +0 -0
  56. package/src/scripts/components/assets/get_data_download.png +0 -0
  57. package/src/scripts/components/assets/ljaf copy.png +0 -0
  58. package/src/scripts/components/assets/logo_app copy.png +0 -0
  59. package/src/scripts/components/assets/logo_cube copy.png +0 -0
  60. package/src/scripts/components/assets/logo_data copy.png +0 -0
  61. package/src/scripts/components/assets/logo_users copy.png +0 -0
  62. package/src/scripts/components/assets/mri-scan.jpg +0 -0
  63. package/src/scripts/components/assets/nih copy.png +0 -0
  64. package/src/scripts/components/assets/nih-bi-brand.jpg +0 -0
  65. package/src/scripts/components/assets/nih-stanford.jpg +0 -0
  66. package/src/scripts/components/assets/nih.png +0 -0
  67. package/src/scripts/components/assets/nimh.png +0 -0
  68. package/src/scripts/components/assets/nsf copy.png +0 -0
  69. package/src/scripts/components/assets/on-dark-horz.svg +1 -0
  70. package/src/scripts/components/assets/on-dark.svg +1 -0
  71. package/src/scripts/components/assets/on-light-horz.svg +1 -0
  72. package/src/scripts/components/assets/on-light.svg +1 -0
  73. package/src/scripts/components/assets/orcid_24x24 copy.png +0 -0
  74. package/src/scripts/components/assets/orcid_24x24.png +0 -0
  75. package/src/scripts/components/assets/share_data_collaborate.png +0 -0
  76. package/src/scripts/components/assets/share_data_publish.png +0 -0
  77. package/src/scripts/components/assets/share_data_validate.png +0 -0
  78. package/src/scripts/components/assets/squishymedia copy.png +0 -0
  79. package/src/scripts/components/assets/stanford copy.png +0 -0
  80. package/src/scripts/components/assets/tab-get_data.png +0 -0
  81. package/src/scripts/components/assets/tab-share_data.png +0 -0
  82. package/src/scripts/components/assets/tab-use_data.png +0 -0
  83. package/src/scripts/components/assets/use_data_analyze.png +0 -0
  84. package/src/scripts/components/assets/use_data_snapshot.png +0 -0
  85. package/src/scripts/components/button/Button.tsx +113 -0
  86. package/src/scripts/components/button/__tests__/Button.spec.tsx +21 -0
  87. package/src/scripts/components/button/button.scss +140 -0
  88. package/src/scripts/components/count-toggle/CountToggle.tsx +65 -0
  89. package/src/scripts/components/count-toggle/__tests__/CountToggle.spec.tsx +31 -0
  90. package/src/scripts/components/count-toggle/count-toggle.scss +34 -0
  91. package/src/scripts/components/dropdown/Dropdown.tsx +38 -0
  92. package/src/scripts/components/dropdown/dropdown.scss +29 -0
  93. package/src/scripts/components/facets/FacetRadio.tsx +43 -0
  94. package/src/scripts/components/facets/FacetRange.tsx +35 -0
  95. package/src/scripts/components/facets/FacetSearch.tsx +66 -0
  96. package/src/scripts/components/facets/FacetSelect.tsx +87 -0
  97. package/src/scripts/components/facets/SingleSelect.tsx +39 -0
  98. package/src/scripts/components/facets/__tests__/FacetSelect.spec.tsx +14 -0
  99. package/src/scripts/components/facets/__tests__/SingleSelect.spec.tsx +58 -0
  100. package/src/scripts/components/facets/facet.scss +244 -0
  101. package/src/scripts/components/footer/Footer.tsx +52 -0
  102. package/src/scripts/components/footer/footer.scss +20 -0
  103. package/src/scripts/components/formatting/__tests__/modality-label.spec.tsx +34 -0
  104. package/src/scripts/components/formatting/modality-label.tsx +34 -0
  105. package/src/scripts/components/front-page/ActivityHeader.tsx +12 -0
  106. package/src/scripts/components/front-page/AffiliateBlock.tsx +22 -0
  107. package/src/scripts/components/front-page/Contributors.tsx +28 -0
  108. package/src/scripts/components/front-page/GetUpdates.tsx +99 -0
  109. package/src/scripts/components/front-page/Infographic.tsx +36 -0
  110. package/src/scripts/components/front-page/front-page.scss +295 -0
  111. package/src/scripts/components/header/Header.tsx +151 -0
  112. package/src/scripts/components/header/LandingExpandedHeader.tsx +110 -0
  113. package/src/scripts/components/header/header.scss +409 -0
  114. package/src/scripts/components/icon/Icon.tsx +55 -0
  115. package/src/scripts/components/icon/__tests__/Icon.spec.tsx +10 -0
  116. package/src/scripts/components/icon/icon.scss +8 -0
  117. package/src/scripts/components/input/Input.tsx +137 -0
  118. package/src/scripts/components/input/TermSearch.tsx +101 -0
  119. package/src/scripts/components/input/input.scss +147 -0
  120. package/src/scripts/components/input/term-search.scss +68 -0
  121. package/src/scripts/components/json-tree/ExpandableProperty.tsx +35 -0
  122. package/src/scripts/components/json-tree/RecursiveProperty.tsx +67 -0
  123. package/src/scripts/components/json-tree/json-tree.scss +19 -0
  124. package/src/scripts/components/loading/Loading.tsx +19 -0
  125. package/src/scripts/components/loading/__tests__/Loading.spec.tsx +12 -0
  126. package/src/scripts/components/loading/loading.scss +141 -0
  127. package/src/scripts/components/logo/Logo.tsx +44 -0
  128. package/src/scripts/components/logo/__tests__/Logo.spec.tsx +22 -0
  129. package/src/scripts/components/modal/Modal.tsx +51 -0
  130. package/src/scripts/components/modal/ModalExample.tsx +25 -0
  131. package/src/scripts/components/modal/UserLoginModal.tsx +74 -0
  132. package/src/scripts/components/modal/__tests__/UserLoginModal.spec.tsx +37 -0
  133. package/src/scripts/components/modal/modal.scss +60 -0
  134. package/src/scripts/components/modality-cube/ModalityCube.tsx +60 -0
  135. package/src/scripts/components/modality-cube/modality-cube.scss +303 -0
  136. package/src/scripts/components/page/Page.tsx +61 -0
  137. package/src/scripts/components/page/page.scss +408 -0
  138. package/src/scripts/components/progress-bar/ProgressBar.tsx +16 -0
  139. package/src/scripts/components/progress-bar/progress-bar.scss +34 -0
  140. package/src/scripts/components/radio/Radio.tsx +33 -0
  141. package/src/scripts/components/radio/RadioGroup.tsx +45 -0
  142. package/src/scripts/components/radio/__tests__/RadioGroup.spec.tsx +31 -0
  143. package/src/scripts/components/radio/radio.scss +335 -0
  144. package/src/scripts/components/range/TwoHandleRange.scss +108 -0
  145. package/src/scripts/components/range/TwoHandleRange.tsx +128 -0
  146. package/src/scripts/components/range/__tests__/TwoHandleRange.spec.tsx +34 -0
  147. package/src/scripts/components/read-more/ReadMore.tsx +50 -0
  148. package/src/scripts/components/read-more/__tests__/ReadMore.spec.tsx +14 -0
  149. package/src/scripts/components/read-more/read-more.scss +79 -0
  150. package/src/scripts/components/scss/_flex-grid.scss +216 -0
  151. package/src/scripts/components/scss/_helper-classes.scss +162 -0
  152. package/src/scripts/components/scss/_normalize.scss +614 -0
  153. package/src/scripts/components/scss/_variables.scss +245 -0
  154. package/src/scripts/components/scss/global.scss +124 -0
  155. package/src/scripts/components/scss/toasts.scss +33 -0
  156. package/src/scripts/components/scss/upload-modal.scss +479 -0
  157. package/src/scripts/components/search-page/CommunityHeader.tsx +27 -0
  158. package/src/scripts/components/search-page/FacetBlockContainerExample.tsx +6 -0
  159. package/src/scripts/components/search-page/FilterDateItem.tsx +44 -0
  160. package/src/scripts/components/search-page/FilterListItem.tsx +62 -0
  161. package/src/scripts/components/search-page/FiltersBlock.tsx +277 -0
  162. package/src/scripts/components/search-page/ModalityHeader.tsx +64 -0
  163. package/src/scripts/components/search-page/NeurobagelSearch.tsx +59 -0
  164. package/src/scripts/components/search-page/SearchPage.tsx +114 -0
  165. package/src/scripts/components/search-page/SearchResultItem.tsx +417 -0
  166. package/src/scripts/components/search-page/SearchResultsList.tsx +48 -0
  167. package/src/scripts/components/search-page/SearchSort.tsx +52 -0
  168. package/src/scripts/components/search-page/SearchSortContainerExample.tsx +9 -0
  169. package/src/scripts/components/search-page/TermListItem.tsx +41 -0
  170. package/src/scripts/components/search-page/__tests__/NuerobagelSearch.spec.tsx +17 -0
  171. package/src/scripts/components/search-page/filters-block.scss +99 -0
  172. package/src/scripts/components/search-page/neurobagel_logo.svg +75 -0
  173. package/src/scripts/components/search-page/search-page.scss +505 -0
  174. package/src/scripts/components/search-page/search-result.scss +117 -0
  175. package/src/scripts/components/search-page/search-sort.scss +56 -0
  176. package/src/scripts/components/select/SelectGroup.tsx +41 -0
  177. package/src/scripts/components/select/__tests__/SelectGroup.spec.tsx +43 -0
  178. package/src/scripts/components/select/select.scss +40 -0
  179. package/src/scripts/components/textarea/Textarea.tsx +68 -0
  180. package/src/scripts/components/textarea/__tests__/Textarea.spec.tsx +53 -0
  181. package/src/scripts/components/tooltip/Tooltip.tsx +30 -0
  182. package/src/scripts/components/tooltip/__tests__/Tooltip.spec.tsx +14 -0
  183. package/src/scripts/components/tooltip/tooltip.scss +159 -0
  184. package/src/scripts/components/user/UserMenu.tsx +72 -0
  185. package/src/scripts/components/user/user-menu.scss +88 -0
  186. package/src/scripts/components/warn-button/WarnButton.tsx +97 -0
  187. package/src/scripts/components/warn-button/warn-button.scss +39 -0
  188. package/src/scripts/datalad/dataset/dataset-query-context.js +2 -0
  189. package/src/scripts/dataset/comments/comment.jsx +1 -1
  190. package/src/scripts/dataset/components/AnalyzeDropdown.tsx +2 -2
  191. package/src/scripts/dataset/components/CloneDropdown.tsx +2 -2
  192. package/src/scripts/dataset/components/DatasetEventItem.tsx +105 -0
  193. package/src/scripts/dataset/components/DatasetGitAccess.tsx +2 -2
  194. package/src/scripts/dataset/components/DatasetToolButton.tsx +2 -2
  195. package/src/scripts/dataset/components/ModalitiesMetaDataBlock.tsx +2 -10
  196. package/src/scripts/dataset/components/ValidationBlock.tsx +37 -2
  197. package/src/scripts/dataset/components/VersionList.tsx +1 -1
  198. package/src/scripts/dataset/components/scss/dataset-events.module.scss +41 -0
  199. package/src/scripts/dataset/dataset-query.jsx +12 -11
  200. package/src/scripts/dataset/download/__tests__/__snapshots__/download-command-line.spec.jsx.snap +7 -1
  201. package/src/scripts/dataset/download/__tests__/download-command-line.spec.jsx +2 -2
  202. package/src/scripts/dataset/download/download-command-line.jsx +17 -13
  203. package/src/scripts/dataset/download/download-datalad.jsx +6 -3
  204. package/src/scripts/dataset/download/download-link.jsx +1 -1
  205. package/src/scripts/dataset/download/download-s3.jsx +0 -4
  206. package/src/scripts/dataset/files/file-display.jsx +1 -1
  207. package/src/scripts/dataset/files/file-tree-unloaded-directory.jsx +1 -1
  208. package/src/scripts/dataset/files/file-tree.tsx +1 -1
  209. package/src/scripts/dataset/files/file-view.jsx +1 -1
  210. package/src/scripts/dataset/files/file-viewer-type.jsx +5 -1
  211. package/src/scripts/dataset/files/file.tsx +2 -2
  212. package/src/scripts/dataset/files/files.tsx +3 -3
  213. package/src/scripts/dataset/files/viewers/file-viewer-json.jsx +1 -1
  214. package/src/scripts/dataset/files/viewers/file-viewer-markdown.tsx +13 -0
  215. package/src/scripts/dataset/fragments/cancel-button.tsx +1 -1
  216. package/src/scripts/dataset/fragments/dataset-citation.jsx +2 -2
  217. package/src/scripts/dataset/fragments/edit-button.tsx +1 -1
  218. package/src/scripts/dataset/fragments/edit-list.jsx +1 -1
  219. package/src/scripts/dataset/fragments/save-button.tsx +1 -1
  220. package/src/scripts/dataset/mutations/admin-exports.jsx +1 -1
  221. package/src/scripts/dataset/mutations/cache-clear.jsx +1 -1
  222. package/src/scripts/dataset/mutations/create-anonymous-reviewer.tsx +2 -2
  223. package/src/scripts/dataset/mutations/dataset-events.tsx +187 -0
  224. package/src/scripts/dataset/mutations/dataset-relations.tsx +1 -1
  225. package/src/scripts/dataset/mutations/delete-anonymous-reviewer.tsx +1 -1
  226. package/src/scripts/dataset/mutations/delete-comment.jsx +1 -1
  227. package/src/scripts/dataset/mutations/delete-file.jsx +1 -1
  228. package/src/scripts/dataset/mutations/deprecate-version.tsx +1 -1
  229. package/src/scripts/dataset/mutations/flag-annex-object.jsx +2 -2
  230. package/src/scripts/dataset/mutations/follow.tsx +1 -1
  231. package/src/scripts/dataset/mutations/import-dataset.tsx +1 -1
  232. package/src/scripts/dataset/mutations/publish.jsx +1 -1
  233. package/src/scripts/dataset/mutations/remove-annex-object.jsx +2 -2
  234. package/src/scripts/dataset/mutations/remove-permissions.tsx +1 -1
  235. package/src/scripts/dataset/mutations/revalidate.jsx +2 -2
  236. package/src/scripts/dataset/mutations/snapshot.tsx +1 -1
  237. package/src/scripts/dataset/mutations/star.tsx +1 -1
  238. package/src/scripts/dataset/mutations/submit-metadata.jsx +1 -1
  239. package/src/scripts/dataset/mutations/undo-deprecate-version.tsx +2 -2
  240. package/src/scripts/dataset/mutations/update-permissions.tsx +1 -1
  241. package/src/scripts/dataset/routes/admin-datalad.jsx +4 -0
  242. package/src/scripts/dataset/routes/dataset-default.tsx +1 -1
  243. package/src/scripts/dataset/routes/delete-page.tsx +7 -3
  244. package/src/scripts/dataset/routes/deprecate-snapshot-page.tsx +1 -1
  245. package/src/scripts/dataset/routes/manage-permissions.jsx +1 -1
  246. package/src/scripts/dataset/routes/snapshot-default.tsx +1 -1
  247. package/src/scripts/dataset/routes/snapshot.tsx +1 -1
  248. package/src/scripts/dataset/snapshot-container.tsx +14 -8
  249. package/src/scripts/pages/admin/flagged-files.jsx +1 -1
  250. package/src/scripts/pages/admin/user-tools.tsx +1 -1
  251. package/src/scripts/pages/admin/users.tsx +2 -2
  252. package/src/scripts/pages/api.jsx +2 -2
  253. package/src/scripts/pages/front-page/aggregate-queries/aggregate-counts-container.tsx +6 -7
  254. package/src/scripts/pages/front-page/front-page.tsx +7 -9
  255. package/src/scripts/pages/metadata/dataset-metadata.tsx +1 -1
  256. package/src/scripts/search/__tests__/search-container.spec.tsx +7 -7
  257. package/src/scripts/search/filters-block-container.tsx +66 -9
  258. package/src/scripts/search/initial-search-params.tsx +7 -7
  259. package/src/scripts/search/inputs/__tests__/sort-by-select.spec.tsx +1 -1
  260. package/src/scripts/search/inputs/admin-allDatasets-toggle.tsx +1 -1
  261. package/src/scripts/search/inputs/age-range-input.tsx +3 -2
  262. package/src/scripts/search/inputs/author-input.tsx +3 -2
  263. package/src/scripts/search/inputs/dataset-type-select.tsx +3 -2
  264. package/src/scripts/search/inputs/date-radios.tsx +3 -2
  265. package/src/scripts/search/inputs/diagnosis-select.tsx +3 -2
  266. package/src/scripts/search/inputs/initiative-select.tsx +12 -6
  267. package/src/scripts/search/inputs/keyword-input.tsx +2 -2
  268. package/src/scripts/search/inputs/modality-select.tsx +28 -26
  269. package/src/scripts/search/inputs/pet/bodyParts_input.tsx +4 -3
  270. package/src/scripts/search/inputs/pet/scannerManufacturersModelNames_input.tsx +4 -3
  271. package/src/scripts/search/inputs/pet/scannerManufacturers_input.tsx +4 -3
  272. package/src/scripts/search/inputs/pet/tracerNames_input.tsx +4 -3
  273. package/src/scripts/search/inputs/pet/tracerRadionuclides_input.tsx +4 -3
  274. package/src/scripts/search/inputs/section-select.tsx +3 -2
  275. package/src/scripts/search/inputs/sex-radios.tsx +3 -2
  276. package/src/scripts/search/inputs/show-datasets-radios.tsx +4 -3
  277. package/src/scripts/search/inputs/sort-by-select.tsx +1 -1
  278. package/src/scripts/search/inputs/species-select.tsx +3 -2
  279. package/src/scripts/search/inputs/study-domain-input.tsx +4 -3
  280. package/src/scripts/search/inputs/subject-count-range-input.tsx +3 -2
  281. package/src/scripts/search/inputs/task-input.tsx +4 -3
  282. package/src/scripts/search/search-container.tsx +14 -17
  283. package/src/scripts/search/search-params-ctx.tsx +28 -5
  284. package/src/scripts/search/search-routes.tsx +2 -4
  285. package/src/scripts/search/use-search-results.tsx +14 -13
  286. package/src/scripts/uploader/upload-issues.tsx +1 -1
  287. package/src/scripts/uploader/upload-progress.jsx +1 -1
  288. package/src/scripts/uploader/uploader-modal.jsx +1 -1
  289. package/src/scripts/users/components/close-button.tsx +1 -1
  290. package/src/scripts/users/components/edit-button.tsx +1 -1
  291. package/src/scripts/users/components/edit-list.tsx +1 -1
  292. package/src/scripts/users/components/edit-string.tsx +1 -1
  293. package/src/scripts/users/dataset-card.tsx +2 -2
  294. package/src/scripts/users/user-notification-accordion.tsx +1 -1
  295. package/src/scripts/utils/user-login-modal-ctx.tsx +1 -1
  296. package/src/scripts/validation/validation-issues.tsx +2 -1
  297. package/src/scripts/validation/validation-panel.tsx +2 -1
  298. package/src/scripts/validation/validation-results.tsx +4 -3
  299. package/src/scripts/validation-legacy/validation-panel.jsx +2 -1
  300. package/src/scripts/validation-legacy/validation-results.issues.jsx +2 -3
  301. package/src/scripts/validation-legacy/validation-results.tsx +3 -4
  302. package/tsconfig.json +1 -4
@@ -0,0 +1,74 @@
1
+ import React from "react"
2
+ import { Modal } from "./Modal"
3
+ import { Button } from "../button/Button"
4
+ import { Logo } from "../logo/Logo"
5
+ import { AccordionTab } from "../../components/accordion/AccordionTab"
6
+ import { AccordionWrap } from "../../components/accordion/AccordionWrap"
7
+ import { useLocation } from "react-router-dom"
8
+
9
+ import orcidIcon from "../../../assets/orcid_24x24.png"
10
+
11
+ export interface UserLoginModalProps {
12
+ isOpen: boolean
13
+ toggle: () => void
14
+ loginUrls: Record<string, string>
15
+ }
16
+
17
+ export const UserLoginModal = ({
18
+ isOpen,
19
+ toggle,
20
+ loginUrls,
21
+ }: UserLoginModalProps) => {
22
+ const location = useLocation()
23
+ const redirectPath = `${location.pathname}${location.search}`
24
+ return (
25
+ <>
26
+ <Modal isOpen={isOpen} toggle={toggle}>
27
+ <div className="sign-in-modal-header">
28
+ <Logo horizontal dark={true} width="230px" />
29
+ <h2>Sign in</h2>
30
+ </div>
31
+ <div className="sign-in-modal-content">
32
+ <div>
33
+ <a href={loginUrls.google + `?redirectPath=${btoa(redirectPath)}`}>
34
+ <Button
35
+ className="login-button"
36
+ primary
37
+ label="Google"
38
+ icon="fab fa-google"
39
+ iconSize="23px"
40
+ />
41
+ </a>
42
+ </div>
43
+ <div>
44
+ <a href={loginUrls.orcid + `?redirectPath=${btoa(redirectPath)}`}>
45
+ <Button
46
+ className="login-button"
47
+ primary
48
+ label="ORCID"
49
+ imgSrc={orcidIcon}
50
+ />
51
+ </a>
52
+ <AccordionWrap>
53
+ <AccordionTab
54
+ id="orcid-info-accordion"
55
+ label="What is this?"
56
+ accordionStyle="plain"
57
+ children={
58
+ <>
59
+ ORCID users are identified and connected to their
60
+ contributions and affiliations, across disciplines, borders,
61
+ and time.{" "}
62
+ <a href="https://orcid.org/content/about-orcid">
63
+ Learn more
64
+ </a>
65
+ </>
66
+ }
67
+ />
68
+ </AccordionWrap>
69
+ </div>
70
+ </div>
71
+ </Modal>
72
+ </>
73
+ )
74
+ }
@@ -0,0 +1,37 @@
1
+ import { vi } from "vitest"
2
+ import React from "react"
3
+ import { render, screen } from "@testing-library/react"
4
+ import { UserLoginModal } from "../UserLoginModal"
5
+ import { MemoryRouter } from "react-router-dom"
6
+
7
+ const loginUrls = {
8
+ google: "https://openneuro.org/crn/auth/google",
9
+ orcid: "https://openneuro.org/crn/auth/orcid",
10
+ }
11
+
12
+ const toggle = vi.fn()
13
+
14
+ describe("UserLoginModal component", () => {
15
+ it("Google login link has correctly formed auth URL", () => {
16
+ render(
17
+ <MemoryRouter initialEntries={["/import?url=https://example.com"]}>
18
+ <UserLoginModal isOpen={true} toggle={toggle} loginUrls={loginUrls} />
19
+ </MemoryRouter>,
20
+ )
21
+ expect(
22
+ screen.getByRole("link", { name: /google/i }).getAttribute("href"),
23
+ ).toBe(
24
+ "https://openneuro.org/crn/auth/google?redirectPath=L2ltcG9ydD91cmw9aHR0cHM6Ly9leGFtcGxlLmNvbQ==",
25
+ )
26
+ })
27
+ it("ORCID login link has correctly formed auth URL", () => {
28
+ render(
29
+ <MemoryRouter initialEntries={["/import"]}>
30
+ <UserLoginModal isOpen={true} toggle={toggle} loginUrls={loginUrls} />
31
+ </MemoryRouter>,
32
+ )
33
+ expect(
34
+ screen.getByRole("link", { name: /orcid/i }).getAttribute("href"),
35
+ ).toBe("https://openneuro.org/crn/auth/orcid?redirectPath=L2ltcG9ydA==")
36
+ })
37
+ })
@@ -0,0 +1,60 @@
1
+ @import '../scss/variables';
2
+
3
+ .modal-wrapper {
4
+ position: fixed;
5
+ top: 0;
6
+ right: 0;
7
+ bottom: 0;
8
+ left: 0;
9
+ display: flex;
10
+ justify-content: center;
11
+ align-items: flex-start;
12
+ transition: opacity 0.3s;
13
+ z-index: 9000;
14
+ .modal {
15
+ background-color: #fff;
16
+ width: 500px;
17
+ max-width: 90%;
18
+ transition: transform 0.3s;
19
+ overflow: scroll;
20
+ max-height: 90vh;
21
+ }
22
+
23
+ .modal-close-x {
24
+ position: absolute;
25
+ right: 7px;
26
+ top: 4px;
27
+ cursor: pointer;
28
+ font-size: 18px;
29
+ }
30
+
31
+ .modal-body {
32
+ margin: 0 0 30px;
33
+ }
34
+
35
+ .overlay {
36
+ position: absolute;
37
+ top: 0;
38
+ right: 0;
39
+ bottom: 0;
40
+ left: 0;
41
+ background-color: rgba(0, 10, 10, 75%);
42
+ }
43
+
44
+ &.hide-modal {
45
+ opacity: 0;
46
+ transition-delay: 0.01s;
47
+ animation-fill-mode: forwards;
48
+ pointer-events: none;
49
+ .modal {
50
+ transform: translateY(-100vh);
51
+ }
52
+ }
53
+ &.show-modal {
54
+ opacity: 1;
55
+ pointer-events: auto;
56
+ .modal {
57
+ transform: translateY(0);
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,60 @@
1
+ import React from "react"
2
+ import "./modality-cube.scss"
3
+
4
+ export interface ModalityCubeProps {
5
+ label: string
6
+ stats: React.ReactNode
7
+ portal: boolean
8
+ cubeImage?: string
9
+ altText?: string
10
+ cubeFaceImage: string
11
+ onClick: (redirectPath: string) => (e: React.MouseEvent) => void
12
+ }
13
+
14
+ export const ModalityCube: React.FC<ModalityCubeProps> = ({
15
+ label,
16
+ stats,
17
+ portal = false,
18
+ cubeImage,
19
+ altText,
20
+ cubeFaceImage,
21
+ onClick,
22
+ }) => {
23
+ return (
24
+ <li
25
+ className="hex"
26
+ onClick={portal
27
+ ? onClick("search/" + label.toLowerCase())
28
+ : onClick("search/modality/" + label.toLowerCase())}
29
+ >
30
+ <div className={"hexIn " + label.toLowerCase() + "-cube"}>
31
+ <div>
32
+ <div
33
+ className="img"
34
+ style={{ backgroundImage: `url(${cubeImage})` }}
35
+ >
36
+ <div className="modality-cube">
37
+ <div className="front">
38
+ <span className="label">
39
+ {cubeFaceImage
40
+ ? (
41
+ <img
42
+ style={{ maxWidth: "120px" }}
43
+ src={cubeFaceImage}
44
+ alt={altText}
45
+ />
46
+ )
47
+ : label}
48
+ </span>
49
+ </div>
50
+ <div className="top"></div>
51
+ <div className="right"></div>
52
+ </div>
53
+ <h3 className="content1">{label}</h3>
54
+ <div className="content2">{stats}</div>
55
+ </div>
56
+ </div>
57
+ </div>
58
+ </li>
59
+ )
60
+ }
@@ -0,0 +1,303 @@
1
+ @import '../scss/variables';
2
+ // Variables for hexagonal grid and cube sizes
3
+ $hex-width: 240px;
4
+ $hex-height: 450px; // Height for the hex grid
5
+ $hex-padding: 2%; // Margin padding for hexagon inside
6
+ $hex-grid-width: 1020px; // Width for the hex grid
7
+ $modality-cube-width: 69%; // Modality cube width
8
+ $modality-cube-height: 60%; // Modality cube height
9
+ $gridbreakpoint: calc($hex-grid-width + 500px); // single col
10
+
11
+ #hexGrid {
12
+ display: grid;
13
+ grid-template-columns: repeat(auto-fit, minmax($hex-width, 1fr)); // Dynamic columns
14
+ justify-items: center;
15
+ width: 100%;
16
+ max-width: $hex-grid-width;
17
+ margin: 0 auto;
18
+ overflow: hidden;
19
+ font-family: sans-serif;
20
+ list-style: none;
21
+ padding: 40px 0 7.4%;
22
+ gap: 20px;
23
+
24
+ @media (max-width: $gridbreakpoint) {
25
+ grid-template-columns: repeat(3, $hex-width); // Switch to 3 columns
26
+ margin: 0 auto;
27
+ flex-basis: 100%;
28
+ justify-content: center;
29
+ }
30
+ }
31
+
32
+ .hex {
33
+ position: relative;
34
+ visibility: hidden;
35
+ outline: 1px solid transparent;
36
+ backface-visibility: hidden;
37
+ width: $hex-width;
38
+ margin: 0 10px;
39
+ &::after {
40
+ content: '';
41
+ display: block;
42
+ padding-bottom: 86.602%; // Maintain hexagonal aspect ratio
43
+ }
44
+
45
+ // Default: Shift every second row in the 4-column layout
46
+ &:nth-child(8n + 5),
47
+ &:nth-child(8n + 6),
48
+ &:nth-child(8n + 7),
49
+ &:nth-child(8n + 8) {
50
+ left: calc($hex-width / 2 + 10px); // Staggered shift for items in the 4-column layout
51
+ }
52
+
53
+ // Ensure items 8, 9, 10, and 11 are in the third row with no shift
54
+ &:nth-child(8) {
55
+ grid-row: 3; // Place item 8 in the third row
56
+ left: 0; // Remove the left shift
57
+ }
58
+
59
+ &:nth-child(9),
60
+ &:nth-child(10),
61
+ &:nth-child(11) {
62
+ grid-row: 3; // Ensure items 9, 10, and 11 are in the same row (3rd)
63
+ left: 0; // Remove the left shift
64
+ }
65
+
66
+ @media (max-width: $gridbreakpoint) {
67
+ // Reset positioning for smaller screens
68
+ &:nth-child(n) {
69
+ left: 0;
70
+ }
71
+
72
+ // Set 3-column layout for smaller screens
73
+ display: grid;
74
+ grid-template-columns: repeat(3, $hex-width); // 3 columns for smaller screens
75
+ gap: 20px; // Maintain grid gap
76
+
77
+ // Adjust placement of items to ensure 3-column layout is respected
78
+ &:nth-child(1), &:nth-child(2), &:nth-child(3) {
79
+ grid-row: 1; // First row
80
+ }
81
+
82
+ &:nth-child(4), &:nth-child(5) {
83
+ grid-row: 2; // Second row
84
+ left: calc($hex-width / 2 + 10px); // Shift right for 4th and 5th items
85
+ }
86
+
87
+ &:nth-child(6), &:nth-child(7), &:nth-child(8) {
88
+ grid-row: 3; // Third row
89
+ left: 0; // No shift
90
+ }
91
+
92
+ &:nth-child(9), &:nth-child(10) {
93
+ grid-row: 4; // Fourth row
94
+ left: calc($hex-width / 2 + 10px); // Shift right for 9th and 10th items
95
+ }
96
+
97
+ &:nth-child(11) {
98
+ grid-row: 5; // Fifth row
99
+ left: 0; // No shift for item 11
100
+ }
101
+ }
102
+ }
103
+
104
+ // styling for the single hex items - contains the cube faces
105
+ .hexIn {
106
+ position: absolute;
107
+ width: 96%;
108
+ padding-bottom: 110.851%; // Maintain hexagonal aspect ratio
109
+ margin: $hex-padding;
110
+ overflow: hidden;
111
+ visibility: hidden;
112
+ outline: 1px solid transparent;
113
+ transform: rotate3d(0, 0, 1, -60deg) skewY(30deg);
114
+
115
+ > div {
116
+ display: block;
117
+ width: 100%;
118
+ height: 100%;
119
+ text-align: center;
120
+ color: #fff;
121
+ overflow: hidden;
122
+ transform: skewY(-30deg) rotate3d(0, 0, 1, 60deg);
123
+ position: absolute;
124
+ visibility: visible;
125
+ outline: 1px solid transparent; /* fix for jagged edges in FF on hover transition */
126
+
127
+ .img {
128
+ position: absolute;
129
+ visibility: visible;
130
+ outline: 1px solid transparent; /* fix for jagged edges in FF on hover transition */
131
+
132
+ .modality-cube {
133
+ height: $modality-cube-height;
134
+ width: $modality-cube-width;
135
+ margin: 20px 0 0;
136
+ z-index: 1000;
137
+ position: relative;
138
+ visibility: visible;
139
+ transform-style: preserve-3d;
140
+ transform: scale3d(1.05, 1.04, 1.04) rotateX(-36deg) rotateY(-45deg)
141
+ rotateZ(0deg) translate3d(0px, 0px, 0px) skew(0deg, 0deg);
142
+
143
+ // Adjust the faces for correct positioning
144
+ > .front,
145
+ > .top,
146
+ > .right {
147
+ position: absolute;
148
+ box-sizing: border-box;
149
+ text-align: center;
150
+ height: 100%;
151
+ width: 100%;
152
+ color: #000;
153
+ font-weight: bold;
154
+ opacity: 1;
155
+ transition: opacity 0.8s;
156
+ }
157
+
158
+ > .front {
159
+ display: flex;
160
+ flex-direction: column;
161
+ justify-content: center;
162
+ align-items: center;
163
+ font-size: 30px;
164
+ transform: translate3d(-30px, 93px, 0) rotateY(0deg);
165
+ span.label {
166
+ color: #fff;
167
+ }
168
+ }
169
+
170
+ > .top {
171
+ transform-origin: top center;
172
+ background-color: rgba(0, 0, 0, 0.1);
173
+ transform: rotateX(-270deg) translate3d(62px, -69px, 0);
174
+ }
175
+
176
+ > .right {
177
+ transform-origin: top right;
178
+ background-color: rgba(0, 0, 0, 0.4);
179
+ transform: rotateY(-270deg) translate3d(130px, 64px, 0);
180
+ }
181
+ }
182
+ }
183
+ }
184
+
185
+ > div .img .modality-cube > .front {
186
+ background-color: rgba(0, 0, 0, 0.4);
187
+ }
188
+
189
+ .img {
190
+ position: absolute;
191
+ top: 0;
192
+ right: 0;
193
+ bottom: 0;
194
+ left: 0;
195
+ background-position: center center;
196
+ background-size: cover;
197
+ overflow: hidden;
198
+ -webkit-clip-path: polygon(
199
+ 50% 0%,
200
+ 100% 25%,
201
+ 100% 75%,
202
+ 50% 100%,
203
+ 0% 75%,
204
+ 0% 25%
205
+ );
206
+ clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
207
+
208
+ &:before,
209
+ &:after {
210
+ position: absolute;
211
+ top: 0;
212
+ right: 0;
213
+ bottom: 0;
214
+ left: 0;
215
+ content: '';
216
+ opacity: 0;
217
+ transition: opacity 0.6s;
218
+ }
219
+ &:before {
220
+ background: rgb(13 255 0);
221
+ }
222
+
223
+ .content1,
224
+ .content2 {
225
+ width: 100%;
226
+ box-sizing: border-box;
227
+ font-weight: 300;
228
+ opacity: 0;
229
+ padding: 0 5px;
230
+ position: absolute;
231
+ top: 0;
232
+ }
233
+
234
+ .content1,
235
+ .content2 {
236
+ color: #fff;
237
+ text-align: center;
238
+ z-index: 1;
239
+ margin: 0;
240
+ font-weight: 600;
241
+ }
242
+ .content1 {
243
+ transform: translateY(120px);
244
+ }
245
+
246
+ .content2 {
247
+ justify-content: center;
248
+ align-items: center;
249
+ flex-direction: column;
250
+ margin: 0;
251
+ transform: translateY(150px);
252
+ }
253
+ }
254
+ }
255
+
256
+ .hexIn:hover,
257
+ .hexIn:focus {
258
+ .content1,
259
+ .content2 {
260
+ opacity: 1;
261
+ transition: opacity 0.5s, transform 0.5s;
262
+ }
263
+
264
+ .content1 {
265
+ transform: translateY(80px);
266
+ }
267
+ .content2 {
268
+ transform: translateY(120px);
269
+ }
270
+
271
+ > div .img .modality-cube {
272
+ .front,
273
+ .top,
274
+ .right {
275
+ opacity: 0;
276
+ transition: 0.8s;
277
+ }
278
+ }
279
+ .img:before,
280
+ .img:after {
281
+ opacity: 1;
282
+ transition: 0.5s;
283
+ }
284
+ }
285
+
286
+ // theme color vars
287
+ // Theme color variables
288
+ @mixin modality-theme($theme) {
289
+ & > div .img {
290
+ &:before,
291
+ .modality-cube > .front {
292
+ background-color: $theme;
293
+ }
294
+ }
295
+ }
296
+
297
+ .nirs-cube {@include modality-theme($nirs-theme);}
298
+ .mri-cube {@include modality-theme($mri-theme);}
299
+ .eeg-cube {@include modality-theme($eeg-theme);}
300
+ .pet-cube {@include modality-theme($pet-theme);}
301
+ .ieeg-cube {@include modality-theme($ieeg-theme);}
302
+ .meg-cube {@include modality-theme($meg-theme);}
303
+ .nih-cube {@include modality-theme($nih-theme);}
@@ -0,0 +1,61 @@
1
+ /* eslint-disable no-console */
2
+ import React from "react"
3
+
4
+ import { Header } from "../header/Header"
5
+ import { LandingExpandedHeader } from "../header/LandingExpandedHeader"
6
+ import { Input } from "../input/Input"
7
+ import { Footer } from "../footer/Footer"
8
+
9
+ import "./page.scss"
10
+
11
+ export interface PageProps {
12
+ children: React.ReactNode
13
+ headerArgs
14
+ className?: string
15
+ }
16
+
17
+ export const Page = ({ children, headerArgs, className }: PageProps) => {
18
+ const [isOpenSupport, setSupportIsOpen] = React.useState(false)
19
+
20
+ const toggleLogin = () => alert("this is a context")
21
+ const toggleSupport = () => setSupportIsOpen((prevIsOpen) => !prevIsOpen)
22
+ return (
23
+ <>
24
+ <article className={className}>
25
+ <Header
26
+ isOpenSupport={isOpenSupport}
27
+ toggleLoginModal={toggleLogin}
28
+ signOutAndRedirect={() => console.log("signed out")}
29
+ toggleSupport={toggleSupport}
30
+ profile={headerArgs.user}
31
+ expanded={headerArgs.expanded}
32
+ navigateToNewSearch={() => console.log("go to /search")}
33
+ renderUploader={() => <li>Upload</li>}
34
+ renderOnFreshDeskWidget={() => <>This is a freshdesk widget</>}
35
+ renderOnExpanded={(profile) => (
36
+ <LandingExpandedHeader
37
+ user={profile}
38
+ renderFacetSelect={() => <>front facet example</>}
39
+ renderSearchInput={() => (
40
+ <Input
41
+ placeholder="Search"
42
+ type="text"
43
+ name="front-page-search"
44
+ labelStyle="default"
45
+ label="search"
46
+ value=""
47
+ setValue={(_) => {}}
48
+ />
49
+ )}
50
+ onSearch={() => console.log("User search by keyword.")}
51
+ />
52
+ )}
53
+ />
54
+ {children}
55
+ <div className="on-foot">
56
+ <Footer version="x.x.x" />
57
+ </div>
58
+ </article>
59
+ </>
60
+ )
61
+ }