@openneuro/app 4.20.5 → 4.20.6-alpha.2
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/__mocks__/fileMock.js +1 -1
- package/package.json +5 -5
- package/pluralize-esm.js +204 -211
- package/src/@types/custom.d.ts +3 -3
- package/src/@types/react.d.ts +3 -4
- package/src/client.jsx +17 -16
- package/src/scripts/__mocks__/config.ts +6 -6
- package/src/scripts/__utils__/mock-app-shell.tsx +9 -8
- package/src/scripts/apm.js +6 -6
- package/src/scripts/app.tsx +7 -7
- package/src/scripts/authentication/__tests__/profile.spec.js +10 -10
- package/src/scripts/authentication/admin-user.jsx +2 -2
- package/src/scripts/authentication/logged-in.jsx +2 -2
- package/src/scripts/authentication/logged-out.jsx +2 -2
- package/src/scripts/authentication/loginCheck.js +2 -2
- package/src/scripts/authentication/loginUrls.ts +1 -1
- package/src/scripts/authentication/profile.ts +7 -7
- package/src/scripts/authentication/regular-user.tsx +3 -3
- package/src/scripts/authentication/signOut.ts +2 -2
- package/src/scripts/authentication/withProfile.jsx +6 -6
- package/src/scripts/common/block-navigation.jsx +3 -4
- package/src/scripts/common/containers/__tests__/header.spec.tsx +16 -16
- package/src/scripts/common/containers/footer.tsx +3 -3
- package/src/scripts/common/containers/header.tsx +30 -30
- package/src/scripts/common/forms/__tests__/warn-button.spec.jsx +6 -6
- package/src/scripts/common/forms/warn-button.jsx +21 -17
- package/src/scripts/common/partials/block-navigation.jsx +3 -4
- package/src/scripts/common/partials/freshdesk-widget.jsx +17 -20
- package/src/scripts/common/partials/toast-content.jsx +2 -2
- package/src/scripts/components/__tests__/data-table.spec.tsx +7 -7
- package/src/scripts/components/data-table.tsx +23 -22
- package/src/scripts/config.ts +2 -2
- package/src/scripts/datalad/dataset/comments-fragments.js +1 -1
- package/src/scripts/datalad/dataset/dataset-context.js +1 -1
- package/src/scripts/datalad/dataset/dataset-query-context.js +1 -1
- package/src/scripts/datalad/dataset/dataset-query-fragments.js +1 -1
- package/src/scripts/datalad/mutations/cache-clear.jsx +7 -6
- package/src/scripts/datalad/mutations/cache-id.js +2 -2
- package/src/scripts/datalad/mutations/delete-comment.jsx +13 -11
- package/src/scripts/datalad/mutations/delete.jsx +10 -9
- package/src/scripts/datalad/mutations/follow.jsx +12 -11
- package/src/scripts/datalad/mutations/publish.jsx +13 -12
- package/src/scripts/datalad/mutations/remove-permissions.jsx +8 -8
- package/src/scripts/datalad/mutations/revalidate.jsx +7 -6
- package/src/scripts/datalad/mutations/snapshot.tsx +7 -7
- package/src/scripts/datalad/mutations/star.jsx +12 -11
- package/src/scripts/datalad/mutations/submit-metadata.jsx +14 -12
- package/src/scripts/datalad/mutations/update-permissions.jsx +14 -13
- package/src/scripts/datalad/mutations/update-ref.jsx +7 -6
- package/src/scripts/datalad/routes/dataset-redirect.tsx +49 -49
- package/src/scripts/datalad/subscriptions/__tests__/files-subscription.spec.jsx +32 -32
- package/src/scripts/datalad/subscriptions/files-subscription.jsx +16 -16
- package/src/scripts/datalad/subscriptions/useDatasetDeletedSubscription.jsx +4 -4
- package/src/scripts/datalad/subscriptions/useDraftSubscription.js +4 -4
- package/src/scripts/datalad/subscriptions/usePermissionsSubscription.js +4 -4
- package/src/scripts/datalad/subscriptions/useSnapshotsUpdatedSubscriptions.js +3 -3
- package/src/scripts/dataset/__tests__/__snapshots__/snapshot-container.spec.tsx.snap +2 -2
- package/src/scripts/dataset/__tests__/snapshot-container.spec.tsx +12 -12
- package/src/scripts/dataset/comments/__tests__/comment.spec.jsx +21 -21
- package/src/scripts/dataset/comments/__tests__/comments.spec.jsx +10 -10
- package/src/scripts/dataset/comments/block-style-controls.jsx +15 -15
- package/src/scripts/dataset/comments/comment-editor.jsx +31 -31
- package/src/scripts/dataset/comments/comment.jsx +50 -50
- package/src/scripts/dataset/comments/comments.jsx +24 -22
- package/src/scripts/dataset/comments/inline-style-controls.jsx +9 -9
- package/src/scripts/dataset/comments/style-button.jsx +8 -9
- package/src/scripts/dataset/common/follow-toggles.tsx +3 -3
- package/src/scripts/dataset/dataset-query-context.js +1 -1
- package/src/scripts/dataset/dataset-query.jsx +34 -31
- package/src/scripts/dataset/dataset-routes.jsx +5 -5
- package/src/scripts/dataset/download/__tests__/download-command-line.spec.jsx +13 -13
- package/src/scripts/dataset/download/__tests__/download-link.spec.jsx +10 -10
- package/src/scripts/dataset/download/__tests__/download-native.spec.js +7 -7
- package/src/scripts/dataset/download/__tests__/shell-example.spec.jsx +5 -5
- package/src/scripts/dataset/download/download-command-line.jsx +9 -7
- package/src/scripts/dataset/download/download-datalad.jsx +22 -20
- package/src/scripts/dataset/download/download-derivative-datalad.tsx +2 -2
- package/src/scripts/dataset/download/download-derivative-s3.tsx +2 -2
- package/src/scripts/dataset/download/download-link.jsx +6 -6
- package/src/scripts/dataset/download/download-native.js +20 -19
- package/src/scripts/dataset/download/download-query.js +2 -3
- package/src/scripts/dataset/download/download-s3.jsx +8 -8
- package/src/scripts/dataset/download/download-script.tsx +23 -20
- package/src/scripts/dataset/download/native-file-toast.jsx +13 -11
- package/src/scripts/dataset/download/shell-example.jsx +1 -1
- package/src/scripts/dataset/download/track-download.js +5 -5
- package/src/scripts/dataset/draft-container.tsx +104 -102
- package/src/scripts/dataset/draft-snapshot-routes.tsx +3 -3
- package/src/scripts/dataset/files/__tests__/file-tree-unloaded-directory.spec.jsx +23 -23
- package/src/scripts/dataset/files/__tests__/file-tree.spec.jsx +57 -58
- package/src/scripts/dataset/files/__tests__/file-viewer-type.spec.jsx +6 -6
- package/src/scripts/dataset/files/__tests__/file.spec.jsx +15 -15
- package/src/scripts/dataset/files/file-display.jsx +11 -11
- package/src/scripts/dataset/files/file-tree-unloaded-directory.jsx +10 -10
- package/src/scripts/dataset/files/file-tree.tsx +27 -27
- package/src/scripts/dataset/files/file-view.jsx +4 -4
- package/src/scripts/dataset/files/file-viewer-type.jsx +21 -21
- package/src/scripts/dataset/files/file.tsx +85 -80
- package/src/scripts/dataset/files/files.tsx +41 -40
- package/src/scripts/dataset/files/index.tsx +2 -2
- package/src/scripts/dataset/files/viewers/__tests__/__snapshots__/file-viewer-json.spec.jsx.snap +0 -24
- package/src/scripts/dataset/files/viewers/__tests__/file-viewer-json.spec.jsx +9 -9
- package/src/scripts/dataset/files/viewers/__tests__/parse-tabular.spec.js +8 -8
- package/src/scripts/dataset/files/viewers/file-viewer-csv.jsx +5 -5
- package/src/scripts/dataset/files/viewers/file-viewer-html.jsx +3 -3
- package/src/scripts/dataset/files/viewers/file-viewer-json.jsx +4 -4
- package/src/scripts/dataset/files/viewers/file-viewer-nifti.tsx +4 -4
- package/src/scripts/dataset/files/viewers/file-viewer-table.tsx +3 -3
- package/src/scripts/dataset/files/viewers/file-viewer-text.jsx +3 -3
- package/src/scripts/dataset/files/viewers/file-viewer-tsv.jsx +5 -5
- package/src/scripts/dataset/files/viewers/parse-tabular.js +4 -4
- package/src/scripts/dataset/fragments/__tests__/cancel-button.spec.tsx +5 -5
- package/src/scripts/dataset/fragments/__tests__/dataset-alert-draft.spec.tsx +9 -9
- package/src/scripts/dataset/fragments/__tests__/dataset-citation.spec.jsx +10 -10
- package/src/scripts/dataset/fragments/__tests__/doi-link.spec.tsx +29 -29
- package/src/scripts/dataset/fragments/__tests__/edit-button.spec.tsx +5 -5
- package/src/scripts/dataset/fragments/__tests__/edit-list.spec.jsx +13 -13
- package/src/scripts/dataset/fragments/__tests__/save-button.spec.tsx +5 -5
- package/src/scripts/dataset/fragments/__tests__/select-input.spec.tsx +26 -26
- package/src/scripts/dataset/fragments/cancel-button.tsx +2 -2
- package/src/scripts/dataset/fragments/comments-fragments.js +1 -1
- package/src/scripts/dataset/fragments/copyable-tooltip.jsx +14 -13
- package/src/scripts/dataset/fragments/dataset-alert-draft.tsx +17 -13
- package/src/scripts/dataset/fragments/dataset-alert-version.tsx +5 -4
- package/src/scripts/dataset/fragments/dataset-citation.jsx +23 -21
- package/src/scripts/dataset/fragments/dataset-history.jsx +12 -12
- package/src/scripts/dataset/fragments/dataset-reviewers.ts +1 -1
- package/src/scripts/dataset/fragments/doi-link.tsx +6 -6
- package/src/scripts/dataset/fragments/edit-button.tsx +2 -2
- package/src/scripts/dataset/fragments/edit-description-field.jsx +23 -21
- package/src/scripts/dataset/fragments/edit-description-list.jsx +8 -8
- package/src/scripts/dataset/fragments/edit-list.jsx +8 -8
- package/src/scripts/dataset/fragments/number-input.tsx +36 -35
- package/src/scripts/dataset/fragments/save-button.tsx +2 -2
- package/src/scripts/dataset/fragments/select-input.tsx +87 -86
- package/src/scripts/dataset/fragments/text-array-input.tsx +38 -37
- package/src/scripts/dataset/fragments/text-input.tsx +79 -78
- package/src/scripts/dataset/mutations/__tests__/cache-id.spec.js +5 -5
- package/src/scripts/dataset/mutations/__tests__/delete-file.spec.jsx +85 -83
- package/src/scripts/dataset/mutations/__tests__/delete.spec.jsx +8 -8
- package/src/scripts/dataset/mutations/__tests__/deprecate-snapshot.spec.tsx +17 -17
- package/src/scripts/dataset/mutations/__tests__/deprecate-version.spec.tsx +19 -19
- package/src/scripts/dataset/mutations/__tests__/description.spec.jsx +51 -51
- package/src/scripts/dataset/mutations/__tests__/remove-permissions.spec.tsx +9 -9
- package/src/scripts/dataset/mutations/__tests__/update-permissions.spec.jsx +7 -7
- package/src/scripts/dataset/mutations/admin-exports.jsx +13 -12
- package/src/scripts/dataset/mutations/cache-clear.jsx +6 -6
- package/src/scripts/dataset/mutations/cache-id.js +2 -2
- package/src/scripts/dataset/mutations/comment.jsx +25 -23
- package/src/scripts/dataset/mutations/create-anonymous-reviewer.tsx +36 -30
- package/src/scripts/dataset/mutations/dataset-relations.tsx +28 -29
- package/src/scripts/dataset/mutations/delete-anonymous-reviewer.tsx +7 -8
- package/src/scripts/dataset/mutations/delete-comment.jsx +14 -12
- package/src/scripts/dataset/mutations/delete-dataset-form.jsx +20 -22
- package/src/scripts/dataset/mutations/delete-file.jsx +8 -8
- package/src/scripts/dataset/mutations/delete.jsx +10 -9
- package/src/scripts/dataset/mutations/deprecate-version.tsx +5 -6
- package/src/scripts/dataset/mutations/description.jsx +21 -20
- package/src/scripts/dataset/mutations/flag-annex-object.jsx +10 -9
- package/src/scripts/dataset/mutations/follow.tsx +15 -14
- package/src/scripts/dataset/mutations/import-dataset.tsx +5 -5
- package/src/scripts/dataset/mutations/metadata-form.jsx +94 -97
- package/src/scripts/dataset/mutations/publish.jsx +13 -13
- package/src/scripts/dataset/mutations/readme.jsx +12 -11
- package/src/scripts/dataset/mutations/remove-annex-object.jsx +10 -9
- package/src/scripts/dataset/mutations/remove-permissions.tsx +5 -6
- package/src/scripts/dataset/mutations/revalidate.jsx +7 -7
- package/src/scripts/dataset/mutations/snapshot.tsx +8 -8
- package/src/scripts/dataset/mutations/star.tsx +14 -13
- package/src/scripts/dataset/mutations/submit-metadata.jsx +12 -11
- package/src/scripts/dataset/mutations/undo-deprecate-version.tsx +5 -6
- package/src/scripts/dataset/mutations/update-file.jsx +6 -6
- package/src/scripts/dataset/mutations/update-permissions.tsx +9 -9
- package/src/scripts/dataset/mutations/update-ref.jsx +7 -7
- package/src/scripts/dataset/routes/__tests__/deprecate-snapshot-page.spec.tsx +5 -5
- package/src/scripts/dataset/routes/add-metadata.jsx +19 -20
- package/src/scripts/dataset/routes/admin-datalad.jsx +7 -7
- package/src/scripts/dataset/routes/dataset-default.tsx +12 -10
- package/src/scripts/dataset/routes/delete-page.tsx +12 -12
- package/src/scripts/dataset/routes/deprecate-snapshot-page.tsx +8 -8
- package/src/scripts/dataset/routes/derivatives.tsx +10 -10
- package/src/scripts/dataset/routes/download-dataset.tsx +20 -20
- package/src/scripts/dataset/routes/manage-anonymous-reviewers.tsx +37 -35
- package/src/scripts/dataset/routes/manage-permissions.jsx +22 -22
- package/src/scripts/dataset/routes/publish.jsx +32 -30
- package/src/scripts/dataset/routes/snapshot-default.tsx +7 -7
- package/src/scripts/dataset/routes/snapshot.tsx +44 -43
- package/src/scripts/dataset/routes/styles/dataset-page-border.tsx +3 -3
- package/src/scripts/dataset/routes/styles/dataset-page-tab-container.tsx +3 -3
- package/src/scripts/dataset/routes/styles/header-row.tsx +3 -3
- package/src/scripts/dataset/routes/tab-routes-draft.tsx +12 -12
- package/src/scripts/dataset/routes/tab-routes-snapshot.tsx +8 -8
- package/src/scripts/dataset/snapshot-container.tsx +78 -86
- package/src/scripts/errors/403page.tsx +11 -11
- package/src/scripts/errors/404page.tsx +12 -12
- package/src/scripts/errors/errorBoundary.jsx +13 -12
- package/src/scripts/errors/errorRoute.jsx +6 -6
- package/src/scripts/errors/freshdesk-widget.jsx +17 -20
- package/src/scripts/errors/freshdeskInterface.jsx +9 -9
- package/src/scripts/errors/orcid/email.jsx +3 -3
- package/src/scripts/errors/orcid/family.jsx +4 -4
- package/src/scripts/errors/orcid/general.jsx +1 -1
- package/src/scripts/errors/orcid/given.jsx +4 -4
- package/src/scripts/fixtures/dataset-query.ts +119 -119
- package/src/scripts/fixtures/mock-app-wrapper.tsx +4 -4
- package/src/scripts/index.tsx +9 -9
- package/src/scripts/pages/admin/admin.jsx +5 -5
- package/src/scripts/pages/admin/flagged-files.jsx +33 -31
- package/src/scripts/pages/admin/user-fragment.ts +1 -1
- package/src/scripts/pages/admin/user-tools.tsx +13 -11
- package/src/scripts/pages/admin/users.jsx +38 -39
- package/src/scripts/pages/api.jsx +20 -19
- package/src/scripts/pages/citation-page.tsx +4 -4
- package/src/scripts/pages/faq/faq.tsx +2 -2
- package/src/scripts/pages/front-page/aggregate-queries/aggregate-counts-container.tsx +6 -5
- package/src/scripts/pages/front-page/aggregate-queries/use-participant-count.ts +2 -2
- package/src/scripts/pages/front-page/aggregate-queries/use-publicDatasets-count.ts +2 -2
- package/src/scripts/pages/front-page/front-page-content.ts +42 -42
- package/src/scripts/pages/front-page/front-page.tsx +18 -14
- package/src/scripts/pages/front-page-comp.tsx +3 -3
- package/src/scripts/pages/import-dataset.tsx +10 -10
- package/src/scripts/pages/metadata/dataset-metadata.tsx +15 -14
- package/src/scripts/pages/pet-redirect.tsx +2 -2
- package/src/scripts/queries/dataset.ts +3 -3
- package/src/scripts/resources/__tests__/kibana.spec.js +9 -9
- package/src/scripts/resources/kibana.js +3 -3
- package/src/scripts/resources/strings.js +2 -2
- package/src/scripts/routes.tsx +14 -14
- package/src/scripts/search/__helpers__/search-render.tsx +3 -3
- package/src/scripts/search/__tests__/search-container.spec.tsx +22 -22
- package/src/scripts/search/__tests__/search-params-ctx.spec.tsx +20 -20
- package/src/scripts/search/es-query-builders.ts +21 -5
- package/src/scripts/search/filters-block-container.tsx +14 -16
- package/src/scripts/search/initial-search-params.tsx +45 -45
- package/src/scripts/search/inputs/__tests__/sort-by-select.spec.tsx +23 -23
- package/src/scripts/search/inputs/admin-allDatasets-toggle.tsx +12 -12
- package/src/scripts/search/inputs/age-range-input.tsx +9 -8
- package/src/scripts/search/inputs/author-input.tsx +14 -11
- package/src/scripts/search/inputs/date-radios.tsx +8 -7
- package/src/scripts/search/inputs/diagnosis-select.tsx +6 -6
- package/src/scripts/search/inputs/index.ts +33 -33
- package/src/scripts/search/inputs/keyword-input.tsx +13 -13
- package/src/scripts/search/inputs/modality-select.tsx +33 -30
- package/src/scripts/search/inputs/pet/bodyParts_input.tsx +18 -16
- package/src/scripts/search/inputs/pet/scannerManufacturersModelNames_input.tsx +18 -16
- package/src/scripts/search/inputs/pet/scannerManufacturers_input.tsx +18 -16
- package/src/scripts/search/inputs/pet/tracerNames_input.tsx +16 -15
- package/src/scripts/search/inputs/pet/tracerRadionuclides_input.tsx +18 -16
- package/src/scripts/search/inputs/section-select.tsx +6 -6
- package/src/scripts/search/inputs/sex-radios.tsx +6 -6
- package/src/scripts/search/inputs/show-datasets-radios.tsx +31 -29
- package/src/scripts/search/inputs/sort-by-select.tsx +10 -11
- package/src/scripts/search/inputs/species-select.tsx +6 -6
- package/src/scripts/search/inputs/study-domain-input.tsx +18 -16
- package/src/scripts/search/inputs/subject-count-range-input.tsx +8 -7
- package/src/scripts/search/inputs/task-input.tsx +18 -16
- package/src/scripts/search/search-container.tsx +83 -85
- package/src/scripts/search/search-params-ctx.tsx +40 -38
- package/src/scripts/search/search-routes.tsx +4 -4
- package/src/scripts/search/use-search-results.tsx +125 -99
- package/src/scripts/styles/media.tsx +3 -3
- package/src/scripts/styles/support-modal.jsx +2 -2
- package/src/scripts/sw.ts +12 -11
- package/src/scripts/test-utils.js +4 -4
- package/src/scripts/uploader/add-path-to-files.js +7 -7
- package/src/scripts/uploader/file-select.tsx +3 -3
- package/src/scripts/uploader/file-upload.js +13 -12
- package/src/scripts/uploader/input.jsx +8 -7
- package/src/scripts/uploader/upload-button.jsx +3 -3
- package/src/scripts/uploader/upload-disclaimer-input.tsx +66 -66
- package/src/scripts/uploader/upload-disclaimer.jsx +6 -5
- package/src/scripts/uploader/upload-file-status.jsx +4 -4
- package/src/scripts/uploader/upload-issues.jsx +32 -29
- package/src/scripts/uploader/upload-metadata.jsx +18 -17
- package/src/scripts/uploader/upload-mutation.js +17 -20
- package/src/scripts/uploader/upload-progress-button.jsx +5 -4
- package/src/scripts/uploader/upload-progress.jsx +3 -3
- package/src/scripts/uploader/upload-rename.jsx +6 -5
- package/src/scripts/uploader/upload-resume.jsx +26 -24
- package/src/scripts/uploader/upload-select.jsx +10 -9
- package/src/scripts/uploader/upload-status.jsx +5 -5
- package/src/scripts/uploader/upload-step.jsx +9 -9
- package/src/scripts/uploader/uploader-context.js +1 -1
- package/src/scripts/uploader/uploader-location.js +1 -1
- package/src/scripts/uploader/uploader-modal.jsx +8 -7
- package/src/scripts/uploader/uploader-setup-routes.jsx +10 -10
- package/src/scripts/uploader/uploader-status-routes.jsx +6 -6
- package/src/scripts/uploader/uploader-view.jsx +4 -4
- package/src/scripts/uploader/uploader.jsx +50 -48
- package/src/scripts/users/username.tsx +3 -3
- package/src/scripts/utils/__tests__/csv.spec.ts +16 -16
- package/src/scripts/utils/__tests__/date.spec.js +4 -4
- package/src/scripts/utils/__tests__/json-ld.spec.js +12 -12
- package/src/scripts/utils/__tests__/newid.spec.js +9 -9
- package/src/scripts/utils/__tests__/userNotify.spec.js +10 -10
- package/src/scripts/utils/analytics.tsx +3 -3
- package/src/scripts/utils/cookies.js +1 -1
- package/src/scripts/utils/csv.ts +13 -15
- package/src/scripts/utils/datalad.js +1 -1
- package/src/scripts/utils/dataset-url.js +2 -2
- package/src/scripts/utils/date.js +2 -2
- package/src/scripts/utils/global-polyfill.ts +2 -2
- package/src/scripts/utils/gtag.js +6 -6
- package/src/scripts/utils/json-ld.js +13 -13
- package/src/scripts/utils/newid.js +1 -1
- package/src/scripts/utils/user-login-modal-ctx.tsx +4 -4
- package/src/scripts/utils/userNotify.js +2 -2
- package/src/scripts/validation/validation-panel.jsx +3 -3
- package/src/scripts/validation/validation-results.issues.issue.jsx +9 -9
- package/src/scripts/validation/validation-results.issues.jsx +19 -17
- package/src/scripts/validation/validation-results.jsx +10 -10
- package/src/scripts/validation/validation-status.jsx +19 -17
- package/src/scripts/validation/validation.jsx +5 -5
- package/src/scripts/workers/schema.ts +2 -2
- package/src/scripts/workers/schema.worker.ts +4 -4
- package/src/scripts/workers/validate.ts +2 -2
- package/src/scripts/workers/validate.worker.ts +7 -5
- package/vite.config.js +17 -17
- package/src/dist/assets/activity-icon.9ab0c828.png +0 -0
- package/src/dist/assets/bids.da8810b3.jpg +0 -0
- package/src/dist/assets/brand_mark.28e7645d.png +0 -0
- package/src/dist/assets/close-button.21e700a6.png +0 -0
- package/src/dist/assets/cube-get.39ed5636.png +0 -0
- package/src/dist/assets/cube-share.9b558c29.png +0 -0
- package/src/dist/assets/cube-use.ccf2ddc5.png +0 -0
- package/src/dist/assets/datalad.a35b15b8.jpg +0 -0
- package/src/dist/assets/eeg.1dc1dc54.jpg +0 -0
- package/src/dist/assets/email-header.1cb8bf76.png +0 -0
- package/src/dist/assets/ieeg.f91deb0a.jpg +0 -0
- package/src/dist/assets/index.3db805fb.js +0 -23127
- package/src/dist/assets/index.3db805fb.js.map +0 -1
- package/src/dist/assets/index.5eb79d2c.css +0 -1
- package/src/dist/assets/ljaf.567e9566.png +0 -0
- package/src/dist/assets/logo_app.8c986cf9.png +0 -0
- package/src/dist/assets/logo_cube.5224b745.png +0 -0
- package/src/dist/assets/logo_data.3e1d5743.png +0 -0
- package/src/dist/assets/logo_users.a84a265a.png +0 -0
- package/src/dist/assets/meg.1e1928f8.jpg +0 -0
- package/src/dist/assets/mri.b01e4f42.jpg +0 -0
- package/src/dist/assets/nih-bi-logo.80d76e1d.png +0 -0
- package/src/dist/assets/nih-stanford.2a7c496e.jpg +0 -0
- package/src/dist/assets/nih.78a64d38.png +0 -0
- package/src/dist/assets/nimh.0ec775d8.png +0 -0
- package/src/dist/assets/nru-logo.f3097dc5.png +0 -0
- package/src/dist/assets/nsf.eee1d3f7.png +0 -0
- package/src/dist/assets/nsf.f87e96e7.png +0 -0
- package/src/dist/assets/on-dark-horz.e1f213d0.svg +0 -1
- package/src/dist/assets/on-dark.12f4e2ce.svg +0 -1
- package/src/dist/assets/on-light-horz.23ff22c3.svg +0 -1
- package/src/dist/assets/on-light.50592f7f.svg +0 -1
- package/src/dist/assets/pet-scan.21d98a3d.jpg +0 -0
- package/src/dist/assets/revicons.4ca02b8a.ttf +0 -0
- package/src/dist/assets/revicons.9e4d4c68.eot +0 -0
- package/src/dist/assets/revicons.f7b9c306.woff +0 -0
- package/src/dist/assets/sqm-logo.9cd0cca5.png +0 -0
- package/src/dist/assets/squishymedia.fa3c5919.png +0 -0
- package/src/dist/assets/stanford.5f245936.png +0 -0
- package/src/dist/index.html +0 -25
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
// dependencies -------------------------------------------------------
|
|
2
2
|
|
|
3
|
-
import React from
|
|
4
|
-
import PropTypes from
|
|
5
|
-
import { Query } from
|
|
6
|
-
import { gql } from
|
|
7
|
-
import parseISO from
|
|
8
|
-
import formatDistanceToNow from
|
|
9
|
-
import { Input } from
|
|
10
|
-
import { Loading } from
|
|
11
|
-
import { formatDate } from
|
|
12
|
-
import Helmet from
|
|
13
|
-
import { pageTitle } from
|
|
14
|
-
import { UserTools } from
|
|
15
|
-
import { USER_FRAGMENT } from
|
|
3
|
+
import React from "react"
|
|
4
|
+
import PropTypes from "prop-types"
|
|
5
|
+
import { Query } from "@apollo/client/react/components"
|
|
6
|
+
import { gql } from "@apollo/client"
|
|
7
|
+
import parseISO from "date-fns/parseISO"
|
|
8
|
+
import formatDistanceToNow from "date-fns/formatDistanceToNow"
|
|
9
|
+
import { Input } from "@openneuro/components/input"
|
|
10
|
+
import { Loading } from "@openneuro/components/loading"
|
|
11
|
+
import { formatDate } from "../../utils/date.js"
|
|
12
|
+
import Helmet from "react-helmet"
|
|
13
|
+
import { pageTitle } from "../../resources/strings.js"
|
|
14
|
+
import { UserTools } from "./user-tools"
|
|
15
|
+
import { USER_FRAGMENT } from "./user-fragment"
|
|
16
16
|
|
|
17
17
|
export const GET_USERS = gql`
|
|
18
18
|
query {
|
|
@@ -56,8 +56,8 @@ class Users extends React.Component {
|
|
|
56
56
|
// life cycle events --------------------------------------------------
|
|
57
57
|
render() {
|
|
58
58
|
const users = this.props.users.map((user, index) => {
|
|
59
|
-
const adminBadge = user.admin ?
|
|
60
|
-
const userEmail = user.hasOwnProperty(
|
|
59
|
+
const adminBadge = user.admin ? "Admin" : null
|
|
60
|
+
const userEmail = user.hasOwnProperty("email") ? user.email : user.id
|
|
61
61
|
if (this.state.adminFilter && !user.admin) {
|
|
62
62
|
return null
|
|
63
63
|
}
|
|
@@ -76,7 +76,7 @@ class Users extends React.Component {
|
|
|
76
76
|
<div className="fade-in user-panel panel panel-default" key={index}>
|
|
77
77
|
<div className="user-col uc-name">
|
|
78
78
|
<div>
|
|
79
|
-
{user.name}{
|
|
79
|
+
{user.name}{" "}
|
|
80
80
|
{adminBadge && <span className="badge">{adminBadge}</span>}
|
|
81
81
|
<UserTools user={user} refetch={this.props.refetch} />
|
|
82
82
|
</div>
|
|
@@ -109,7 +109,7 @@ class Users extends React.Component {
|
|
|
109
109
|
name="Search Name Or Email"
|
|
110
110
|
type="text"
|
|
111
111
|
placeholder="Search Name or Email"
|
|
112
|
-
onKeyDown={e => this.setState({ stringFilter: e.target.value })}
|
|
112
|
+
onKeyDown={(e) => this.setState({ stringFilter: e.target.value })}
|
|
113
113
|
/>
|
|
114
114
|
</div>
|
|
115
115
|
|
|
@@ -118,36 +118,32 @@ class Users extends React.Component {
|
|
|
118
118
|
<div className="filters">
|
|
119
119
|
<label>Filter By:</label>
|
|
120
120
|
<button
|
|
121
|
-
className={this.state.adminFilter ?
|
|
121
|
+
className={this.state.adminFilter ? "active" : null}
|
|
122
122
|
onClick={() =>
|
|
123
|
-
this.setState({ adminFilter: !this.state.adminFilter })
|
|
124
|
-
|
|
123
|
+
this.setState({ adminFilter: !this.state.adminFilter })}
|
|
124
|
+
>
|
|
125
125
|
<span className="filter-admin">
|
|
126
126
|
<i
|
|
127
|
-
className={
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
/>{' '}
|
|
127
|
+
className={this.state.adminFilter
|
|
128
|
+
? "fa fa-check-square-o"
|
|
129
|
+
: "fa fa-square-o"}
|
|
130
|
+
/>{" "}
|
|
133
131
|
Admin
|
|
134
132
|
</span>
|
|
135
133
|
</button>
|
|
136
134
|
<button
|
|
137
|
-
className={this.state.blacklistFilter ?
|
|
135
|
+
className={this.state.blacklistFilter ? "active" : null}
|
|
138
136
|
onClick={() =>
|
|
139
137
|
this.setState({
|
|
140
138
|
blacklistFilter: !this.state.blacklistFilter,
|
|
141
|
-
})
|
|
142
|
-
|
|
139
|
+
})}
|
|
140
|
+
>
|
|
143
141
|
<span className="filter-admin">
|
|
144
142
|
<i
|
|
145
|
-
className={
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
/>{' '}
|
|
143
|
+
className={this.state.blacklistFilter
|
|
144
|
+
? "fa fa-check-square-o"
|
|
145
|
+
: "fa fa-square-o"}
|
|
146
|
+
/>{" "}
|
|
151
147
|
Blocked
|
|
152
148
|
</span>
|
|
153
149
|
</button>
|
|
@@ -157,7 +153,9 @@ class Users extends React.Component {
|
|
|
157
153
|
|
|
158
154
|
<div>
|
|
159
155
|
<div className="users-panel-wrap">
|
|
160
|
-
{users.filter(u => u !== null).length
|
|
156
|
+
{users.filter((u) => u !== null).length
|
|
157
|
+
? users
|
|
158
|
+
: this._noResults()}
|
|
161
159
|
</div>
|
|
162
160
|
</div>
|
|
163
161
|
</div>
|
|
@@ -177,15 +175,16 @@ class Users extends React.Component {
|
|
|
177
175
|
return (
|
|
178
176
|
<>
|
|
179
177
|
<div className="summary-data">
|
|
180
|
-
<b>Signed Up:</b>{
|
|
178
|
+
<b>Signed Up:</b>{" "}
|
|
181
179
|
<div>
|
|
182
180
|
{formatDate(created)} - {formatDistanceToNow(parseISO(created))} ago
|
|
183
181
|
</div>
|
|
184
182
|
</div>
|
|
185
183
|
<div className="summary-data">
|
|
186
|
-
<b>Last Signed In:</b>{
|
|
184
|
+
<b>Last Signed In:</b>{" "}
|
|
187
185
|
<div>
|
|
188
|
-
{formatDate(lastLogin)} - {formatDistanceToNow(parseISO(lastLogin))}
|
|
186
|
+
{formatDate(lastLogin)} - {formatDistanceToNow(parseISO(lastLogin))}
|
|
187
|
+
{" "}
|
|
189
188
|
ago
|
|
190
189
|
</div>
|
|
191
190
|
</div>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Loading } from
|
|
3
|
-
import { CopyToClipboard } from
|
|
4
|
-
import Helmet from
|
|
5
|
-
import { pageTitle } from
|
|
6
|
-
import { Button } from
|
|
7
|
-
import LoggedIn from
|
|
8
|
-
import LoggedOut from
|
|
9
|
-
import { config } from
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { Loading } from "@openneuro/components/loading"
|
|
3
|
+
import { CopyToClipboard } from "react-copy-to-clipboard"
|
|
4
|
+
import Helmet from "react-helmet"
|
|
5
|
+
import { pageTitle } from "../resources/strings.js"
|
|
6
|
+
import { Button } from "@openneuro/components/button"
|
|
7
|
+
import LoggedIn from "../authentication/logged-in"
|
|
8
|
+
import LoggedOut from "../authentication/logged-out"
|
|
9
|
+
import { config } from "../config"
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Create API Key
|
|
@@ -16,8 +16,8 @@ import { config } from '../config'
|
|
|
16
16
|
*/
|
|
17
17
|
export const createAPIKey = async () => {
|
|
18
18
|
const req = await fetch(`${config.api}keygen`, {
|
|
19
|
-
method:
|
|
20
|
-
credentials:
|
|
19
|
+
method: "POST",
|
|
20
|
+
credentials: "same-origin",
|
|
21
21
|
})
|
|
22
22
|
const res = await req.json()
|
|
23
23
|
return res?.key
|
|
@@ -36,7 +36,7 @@ class APIKeyGen extends React.Component {
|
|
|
36
36
|
_requestKey() {
|
|
37
37
|
this.setState({ loading: true })
|
|
38
38
|
createAPIKey()
|
|
39
|
-
.then(key => {
|
|
39
|
+
.then((key) => {
|
|
40
40
|
this.setState({ key, loading: false })
|
|
41
41
|
})
|
|
42
42
|
.catch(() => {
|
|
@@ -71,9 +71,10 @@ class APIKeyGen extends React.Component {
|
|
|
71
71
|
<div className="copy-key ck-wrap">
|
|
72
72
|
<CopyToClipboard
|
|
73
73
|
text={this.state.key}
|
|
74
|
-
onCopy={this._onCopy.bind(this)}
|
|
74
|
+
onCopy={this._onCopy.bind(this)}
|
|
75
|
+
>
|
|
75
76
|
<span className="copy-key">
|
|
76
|
-
<i className="fa fa-link" aria-hidden="true" />{
|
|
77
|
+
<i className="fa fa-link" aria-hidden="true" />{" "}
|
|
77
78
|
{this._copyNotification()}
|
|
78
79
|
</span>
|
|
79
80
|
</CopyToClipboard>
|
|
@@ -88,9 +89,9 @@ class APIKeyGen extends React.Component {
|
|
|
88
89
|
}
|
|
89
90
|
_copyNotification() {
|
|
90
91
|
const copyClass = this.state.linkCopied
|
|
91
|
-
?
|
|
92
|
-
:
|
|
93
|
-
const copyText = this.state.linkCopied ?
|
|
92
|
+
? "copy-notification-active copy-notification-copied"
|
|
93
|
+
: "copy-notification-active"
|
|
94
|
+
const copyText = this.state.linkCopied ? "Copied!" : "Copy key to clipboard"
|
|
94
95
|
return (
|
|
95
96
|
<span>
|
|
96
97
|
<span className={copyClass}>{copyText}</span>
|
|
@@ -107,8 +108,8 @@ class APIKeyGen extends React.Component {
|
|
|
107
108
|
|
|
108
109
|
render() {
|
|
109
110
|
const helperText = this.state.key
|
|
110
|
-
?
|
|
111
|
-
:
|
|
111
|
+
? "Your API Key:"
|
|
112
|
+
: "Click the button below to generate an API key"
|
|
112
113
|
return (
|
|
113
114
|
<>
|
|
114
115
|
<Helmet>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import Helmet from
|
|
3
|
-
import { frontPage } from
|
|
4
|
-
import styled from
|
|
1
|
+
import React from "react"
|
|
2
|
+
import Helmet from "react-helmet"
|
|
3
|
+
import { frontPage } from "./front-page/front-page-content"
|
|
4
|
+
import styled from "@emotion/styled"
|
|
5
5
|
|
|
6
6
|
const CitationPageStyle = styled.div`
|
|
7
7
|
background: white;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import useParticipantCount from
|
|
3
|
-
import usePublicDatasetsCount from
|
|
4
|
-
import { AggregateCount } from
|
|
1
|
+
import React from "react"
|
|
2
|
+
import useParticipantCount from "./use-participant-count"
|
|
3
|
+
import usePublicDatasetsCount from "./use-publicDatasets-count"
|
|
4
|
+
import { AggregateCount } from "@openneuro/components/aggregate-count"
|
|
5
5
|
|
|
6
6
|
export interface AggregateCountsContainerProps {
|
|
7
7
|
modality?: string
|
|
@@ -26,7 +26,7 @@ const AggregateCountsContainer: React.FC<AggregateCountsContainerProps> = ({
|
|
|
26
26
|
|
|
27
27
|
if (loading) return <>...</>
|
|
28
28
|
else if (error) return null
|
|
29
|
-
else
|
|
29
|
+
else {
|
|
30
30
|
return (
|
|
31
31
|
<>
|
|
32
32
|
<AggregateCount
|
|
@@ -39,6 +39,7 @@ const AggregateCountsContainer: React.FC<AggregateCountsContainerProps> = ({
|
|
|
39
39
|
/>
|
|
40
40
|
</>
|
|
41
41
|
)
|
|
42
|
+
}
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
export default AggregateCountsContainer
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { gql, useQuery } from
|
|
1
|
+
import { gql, useQuery } from "@apollo/client"
|
|
2
2
|
|
|
3
3
|
const PARTICIPANT_COUNT = gql`
|
|
4
4
|
query participantCount($modality: String) {
|
|
@@ -9,7 +9,7 @@ const PARTICIPANT_COUNT = gql`
|
|
|
9
9
|
const useParticipantCount = (modality?: string) => {
|
|
10
10
|
return useQuery(PARTICIPANT_COUNT, {
|
|
11
11
|
variables: { modality },
|
|
12
|
-
errorPolicy:
|
|
12
|
+
errorPolicy: "all",
|
|
13
13
|
})
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { gql, useQuery } from
|
|
1
|
+
import { gql, useQuery } from "@apollo/client"
|
|
2
2
|
|
|
3
3
|
const PUBLIC_DATASETS_COUNT = gql`
|
|
4
4
|
query publicDatasetCount($modality: String) {
|
|
@@ -13,7 +13,7 @@ const PUBLIC_DATASETS_COUNT = gql`
|
|
|
13
13
|
const usePublicDatasetsCount = (modality?: string) => {
|
|
14
14
|
return useQuery(PUBLIC_DATASETS_COUNT, {
|
|
15
15
|
variables: { modality },
|
|
16
|
-
errorPolicy:
|
|
16
|
+
errorPolicy: "all",
|
|
17
17
|
})
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import ljaf from
|
|
2
|
-
import nsf from
|
|
3
|
-
import nih from
|
|
4
|
-
import squishymedia from
|
|
5
|
-
import stanford from
|
|
6
|
-
import logo_app from
|
|
7
|
-
import logo_cube from
|
|
8
|
-
import logo_data from
|
|
9
|
-
import logo_users from
|
|
10
|
-
import brand_mark from
|
|
1
|
+
import ljaf from "../../../assets/ljaf.png"
|
|
2
|
+
import nsf from "../../../assets/nsf.png"
|
|
3
|
+
import nih from "../../../assets/nih.png"
|
|
4
|
+
import squishymedia from "../../../assets/squishymedia.png"
|
|
5
|
+
import stanford from "../../../assets/stanford.png"
|
|
6
|
+
import logo_app from "../../../assets/logo_app.png"
|
|
7
|
+
import logo_cube from "../../../assets/logo_cube.png"
|
|
8
|
+
import logo_data from "../../../assets/logo_data.png"
|
|
9
|
+
import logo_users from "../../../assets/logo_users.png"
|
|
10
|
+
import brand_mark from "../../../assets/brand_mark.png"
|
|
11
11
|
|
|
12
12
|
export const frontPage = {
|
|
13
|
-
pageTitle:
|
|
13
|
+
pageTitle: "OpenNeuro",
|
|
14
14
|
copyright: {
|
|
15
|
-
holder:
|
|
15
|
+
holder: "Stanford Center for Reproducible Neuroscience",
|
|
16
16
|
},
|
|
17
17
|
pageDescription:
|
|
18
|
-
|
|
18
|
+
"A free and open platform for sharing MRI, MEG, EEG, iEEG, ECoG, ASL, and PET data",
|
|
19
19
|
titlePanel: {
|
|
20
20
|
logos: [
|
|
21
21
|
{
|
|
22
|
-
class:
|
|
22
|
+
class: "logo-layer-users",
|
|
23
23
|
src: logo_users,
|
|
24
|
-
alt:
|
|
24
|
+
alt: "OpenNeuro Logo",
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
|
-
class:
|
|
27
|
+
class: "logo-layer-cube",
|
|
28
28
|
src: logo_cube,
|
|
29
|
-
alt:
|
|
29
|
+
alt: "OpenNeuro Logo",
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
class:
|
|
32
|
+
class: "logo-layer-app",
|
|
33
33
|
src: logo_app,
|
|
34
|
-
alt:
|
|
34
|
+
alt: "OpenNeuro Logo",
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
|
-
class:
|
|
37
|
+
class: "logo-layer-data",
|
|
38
38
|
src: logo_data,
|
|
39
|
-
alt:
|
|
39
|
+
alt: "OpenNeuro Logo",
|
|
40
40
|
},
|
|
41
41
|
],
|
|
42
42
|
logoText: true,
|
|
43
|
-
privacyDetail:
|
|
44
|
-
privacyLink:
|
|
43
|
+
privacyDetail: "",
|
|
44
|
+
privacyLink: "https://www.stanford.edu/site/privacy/",
|
|
45
45
|
},
|
|
46
46
|
navBar: {
|
|
47
47
|
brand: {
|
|
48
48
|
src: brand_mark,
|
|
49
|
-
alt:
|
|
50
|
-
title:
|
|
49
|
+
alt: "OpenNeuro Logo",
|
|
50
|
+
title: "OpenNeuro Link to Home Page",
|
|
51
51
|
text: {
|
|
52
|
-
first:
|
|
53
|
-
second:
|
|
52
|
+
first: "Open",
|
|
53
|
+
second: "Neuro",
|
|
54
54
|
},
|
|
55
55
|
},
|
|
56
56
|
},
|
|
@@ -58,42 +58,42 @@ export const frontPage = {
|
|
|
58
58
|
collaborators: true,
|
|
59
59
|
support: [
|
|
60
60
|
{
|
|
61
|
-
title:
|
|
62
|
-
alt:
|
|
61
|
+
title: "Arnold Foundation",
|
|
62
|
+
alt: "Arnold Foundation",
|
|
63
63
|
logo: ljaf,
|
|
64
|
-
link:
|
|
64
|
+
link: "http://www.arnoldfoundation.org/",
|
|
65
65
|
width: 4,
|
|
66
66
|
offset: 0,
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
|
-
title:
|
|
70
|
-
alt:
|
|
69
|
+
title: "NSF",
|
|
70
|
+
alt: "National Science Foundation",
|
|
71
71
|
logo: nsf,
|
|
72
|
-
link:
|
|
72
|
+
link: "https://www.nsf.gov/",
|
|
73
73
|
width: 4,
|
|
74
74
|
offset: 0,
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
|
-
title:
|
|
78
|
-
alt:
|
|
77
|
+
title: "NIH",
|
|
78
|
+
alt: "National Institute on Drug and Abuse",
|
|
79
79
|
logo: nih,
|
|
80
|
-
link:
|
|
80
|
+
link: "https://nih.gov",
|
|
81
81
|
width: 4,
|
|
82
82
|
offset: 0,
|
|
83
83
|
},
|
|
84
84
|
{
|
|
85
|
-
title:
|
|
86
|
-
alt:
|
|
85
|
+
title: "Stanford",
|
|
86
|
+
alt: "Stanford",
|
|
87
87
|
logo: stanford,
|
|
88
|
-
link:
|
|
88
|
+
link: "https://www.stanford.edu",
|
|
89
89
|
width: 3,
|
|
90
90
|
offset: 3,
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
|
-
title:
|
|
94
|
-
alt:
|
|
93
|
+
title: "Squishymedia",
|
|
94
|
+
alt: "Squishymedia",
|
|
95
95
|
logo: squishymedia,
|
|
96
|
-
link:
|
|
96
|
+
link: "https://squishymedia.com",
|
|
97
97
|
width: 3,
|
|
98
98
|
offset: 0,
|
|
99
99
|
},
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { apm } from
|
|
2
|
-
import React from
|
|
3
|
-
import { gql, useQuery } from
|
|
4
|
-
import { Mutation } from
|
|
5
|
-
import styled from
|
|
1
|
+
import { apm } from "../../apm"
|
|
2
|
+
import React from "react"
|
|
3
|
+
import { gql, useQuery } from "@apollo/client"
|
|
4
|
+
import { Mutation } from "@apollo/client/react/components"
|
|
5
|
+
import styled from "@emotion/styled"
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
-
AffiliateBlock,
|
|
9
8
|
ActivityHeader,
|
|
9
|
+
AffiliateBlock,
|
|
10
10
|
Contributors,
|
|
11
11
|
GetUpdates,
|
|
12
12
|
Infographic,
|
|
13
|
-
} from
|
|
14
|
-
import { Loading } from
|
|
15
|
-
import { ActivitySlider } from
|
|
13
|
+
} from "@openneuro/components/front-page"
|
|
14
|
+
import { Loading } from "@openneuro/components/loading"
|
|
15
|
+
import { ActivitySlider } from "@openneuro/components/activity-slider"
|
|
16
16
|
|
|
17
17
|
const SUBSCRIBE_TO_NEWSLETTER = gql`
|
|
18
18
|
mutation subscribeToNewsletter($email: String!) {
|
|
@@ -100,7 +100,7 @@ const responsive = {
|
|
|
100
100
|
|
|
101
101
|
export const FrontPageTopQuery = ({ query }) => {
|
|
102
102
|
const result = useQuery(query, {
|
|
103
|
-
errorPolicy:
|
|
103
|
+
errorPolicy: "all",
|
|
104
104
|
})
|
|
105
105
|
if (result.loading) {
|
|
106
106
|
return (
|
|
@@ -114,7 +114,9 @@ export const FrontPageTopQuery = ({ query }) => {
|
|
|
114
114
|
return <div>Failed to load top datasets, please try again later.</div>
|
|
115
115
|
} else {
|
|
116
116
|
// Remove any edges which could not be loaded
|
|
117
|
-
const edges = result.data.datasets.edges.filter(dataset =>
|
|
117
|
+
const edges = result.data.datasets.edges.filter((dataset) =>
|
|
118
|
+
dataset !== null
|
|
119
|
+
)
|
|
118
120
|
return (
|
|
119
121
|
<ActivitySlider
|
|
120
122
|
data={edges}
|
|
@@ -131,7 +133,7 @@ export const FrontPageTopQuery = ({ query }) => {
|
|
|
131
133
|
|
|
132
134
|
export const FrontPageNewQuery = ({ query }) => {
|
|
133
135
|
const result = useQuery(query, {
|
|
134
|
-
errorPolicy:
|
|
136
|
+
errorPolicy: "all",
|
|
135
137
|
})
|
|
136
138
|
if (result.loading) {
|
|
137
139
|
return <Loading />
|
|
@@ -140,7 +142,9 @@ export const FrontPageNewQuery = ({ query }) => {
|
|
|
140
142
|
return <div>Failed to load top datasets, please try again later.</div>
|
|
141
143
|
} else {
|
|
142
144
|
// Remove any edges which could not be loaded
|
|
143
|
-
const edges = result.data.datasets.edges.filter(dataset =>
|
|
145
|
+
const edges = result.data.datasets.edges.filter((dataset) =>
|
|
146
|
+
dataset !== null
|
|
147
|
+
)
|
|
144
148
|
return (
|
|
145
149
|
<ActivitySlider
|
|
146
150
|
data={edges}
|
|
@@ -193,7 +197,7 @@ const FrontPageContainer: React.FC = () => (
|
|
|
193
197
|
</FrontPageSection>
|
|
194
198
|
<FrontPageSection className="gray-bg">
|
|
195
199
|
<Mutation mutation={SUBSCRIBE_TO_NEWSLETTER}>
|
|
196
|
-
{subscribeToNewsletter => (
|
|
200
|
+
{(subscribeToNewsletter) => (
|
|
197
201
|
<GetUpdates
|
|
198
202
|
subscribe={(email, cb) => {
|
|
199
203
|
subscribeToNewsletter({ variables: { email } }).then(cb).catch(cb)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import styled from
|
|
1
|
+
import React from "react"
|
|
2
|
+
import styled from "@emotion/styled"
|
|
3
3
|
|
|
4
4
|
const FrontPageSection = styled.section`
|
|
5
5
|
margin: 100px 0;
|
|
@@ -33,7 +33,7 @@ export const FrontPage: React.FC<FrontPageProps> = ({
|
|
|
33
33
|
className,
|
|
34
34
|
}) => (
|
|
35
35
|
<>
|
|
36
|
-
<div className={className +
|
|
36
|
+
<div className={className + " page"}>
|
|
37
37
|
<FrontPageSection>{renderAffiliateBlock()}</FrontPageSection>
|
|
38
38
|
<FrontPageSection>
|
|
39
39
|
<div className="container">{renderInfographic()}</div>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React, { useState } from
|
|
2
|
-
import styled from
|
|
3
|
-
import { ImportDatasetMutation } from
|
|
4
|
-
import { useLocation } from
|
|
5
|
-
import LoggedIn from
|
|
6
|
-
import LoggedOut from
|
|
7
|
-
import { testAffirmed } from
|
|
8
|
-
import { UploadDisclaimerInput } from
|
|
1
|
+
import React, { useState } from "react"
|
|
2
|
+
import styled from "@emotion/styled"
|
|
3
|
+
import { ImportDatasetMutation } from "../dataset/mutations/import-dataset"
|
|
4
|
+
import { useLocation } from "react-router-dom"
|
|
5
|
+
import LoggedIn from "../authentication/logged-in"
|
|
6
|
+
import LoggedOut from "../authentication/logged-out"
|
|
7
|
+
import { testAffirmed } from "../uploader/upload-disclaimer"
|
|
8
|
+
import { UploadDisclaimerInput } from "../uploader/upload-disclaimer-input"
|
|
9
9
|
|
|
10
10
|
function useQuery() {
|
|
11
11
|
const { search } = useLocation()
|
|
@@ -22,7 +22,7 @@ const ImportDatasetPageStyle = styled.div`
|
|
|
22
22
|
`
|
|
23
23
|
|
|
24
24
|
export const ImportDataset: React.VoidFunctionComponent = () => {
|
|
25
|
-
const url = useQuery().get(
|
|
25
|
+
const url = useQuery().get("url")
|
|
26
26
|
const [affirmedDefaced, setAffirmedDefaced] = useState(false)
|
|
27
27
|
const [affirmedConsent, setAffirmedConsent] = useState(false)
|
|
28
28
|
return (
|
|
@@ -30,7 +30,7 @@ export const ImportDataset: React.VoidFunctionComponent = () => {
|
|
|
30
30
|
<div className="container">
|
|
31
31
|
<h2>Import a dataset from remote URL</h2>
|
|
32
32
|
<p>
|
|
33
|
-
Use this page to import a new OpenNeuro dataset from{
|
|
33
|
+
Use this page to import a new OpenNeuro dataset from{" "}
|
|
34
34
|
<a href="https://brainlife.io/ezbids/">ezBIDS</a>. After submitting an
|
|
35
35
|
import, please allow some time for processing and you will receive an
|
|
36
36
|
email notification when complete.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import styled from
|
|
3
|
-
import { DataTable } from
|
|
4
|
-
import { gql, useQuery } from
|
|
5
|
-
import { Loading } from
|
|
6
|
-
import { makeCsv } from
|
|
1
|
+
import React from "react"
|
|
2
|
+
import styled from "@emotion/styled"
|
|
3
|
+
import { DataTable } from "../../components/data-table"
|
|
4
|
+
import { gql, useQuery } from "@apollo/client"
|
|
5
|
+
import { Loading } from "@openneuro/components/loading"
|
|
6
|
+
import { makeCsv } from "../../utils/csv"
|
|
7
7
|
|
|
8
8
|
const MetadataPageStyle = styled.div`
|
|
9
9
|
background: white;
|
|
@@ -50,7 +50,7 @@ const METADATA_QUERY = gql`
|
|
|
50
50
|
|
|
51
51
|
export function DatasetMetadata(): React.ReactElement {
|
|
52
52
|
const { loading, error, data } = useQuery(METADATA_QUERY, {
|
|
53
|
-
errorPolicy:
|
|
53
|
+
errorPolicy: "all",
|
|
54
54
|
})
|
|
55
55
|
if (loading || error) {
|
|
56
56
|
return <Loading />
|
|
@@ -64,8 +64,8 @@ export function DatasetMetadata(): React.ReactElement {
|
|
|
64
64
|
className="on-button on-button--small on-button--primary icon-text"
|
|
65
65
|
aria-label="Download"
|
|
66
66
|
onClick={() =>
|
|
67
|
-
makeCsv(data?.publicMetadata,
|
|
68
|
-
|
|
67
|
+
makeCsv(data?.publicMetadata, "openneuro-metadata.csv")}
|
|
68
|
+
>
|
|
69
69
|
<i className="fa fa-download css-0" aria-hidden="true"></i>Download
|
|
70
70
|
CSV
|
|
71
71
|
</MetadataPageButton>
|
|
@@ -75,11 +75,12 @@ export function DatasetMetadata(): React.ReactElement {
|
|
|
75
75
|
data={data?.publicMetadata}
|
|
76
76
|
downloadFilename="openneuro-metadata.csv"
|
|
77
77
|
hideColumns={[
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
]}
|
|
78
|
+
"__typename",
|
|
79
|
+
"datasetUrl",
|
|
80
|
+
"affirmedDefaced",
|
|
81
|
+
"affirmedConsent",
|
|
82
|
+
]}
|
|
83
|
+
/>
|
|
83
84
|
</MetadataPageStyle>
|
|
84
85
|
)
|
|
85
86
|
}
|