@openneuro/app 4.20.5 → 4.20.6-alpha.3
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,49 +1,49 @@
|
|
|
1
1
|
// Example queries responses for use in tests
|
|
2
2
|
export const dataset = {
|
|
3
|
-
id:
|
|
4
|
-
created:
|
|
3
|
+
id: "ds001032",
|
|
4
|
+
created: "2021-12-17T22:24:05.500Z",
|
|
5
5
|
public: true,
|
|
6
6
|
following: true,
|
|
7
7
|
followers: [
|
|
8
8
|
{
|
|
9
|
-
userId:
|
|
10
|
-
__typename:
|
|
9
|
+
userId: "18492691-707f-4161-bc73-6ed22ce40138",
|
|
10
|
+
__typename: "Follower",
|
|
11
11
|
},
|
|
12
12
|
],
|
|
13
13
|
starred: false,
|
|
14
14
|
stars: [],
|
|
15
|
-
worker:
|
|
15
|
+
worker: "datalad-0",
|
|
16
16
|
draft: {
|
|
17
|
-
id:
|
|
18
|
-
modified:
|
|
17
|
+
id: "ds001032",
|
|
18
|
+
modified: "2021-12-17T22:32:35.282Z",
|
|
19
19
|
readme:
|
|
20
|
-
|
|
21
|
-
head:
|
|
20
|
+
"This dataset was obtained from the OpenfMRI project (http://www.openfmri.org).\nAccession #: ds003\nDescription: Rhyme judgment\n\nRelease history:\n10/06/2011: initial release\n3/21/2013: Updated release with QA information\n\nThis dataset is made available under the Public Domain Dedication and License \nv1.0, whose full text can be found at \nhttp://www.opendatacommons.org/licenses/pddl/1.0/. \nWe hope that all users will follow the ODC Attribution/Share-Alike \nCommunity Norms (http://www.opendatacommons.org/norms/odc-by-sa/); \nin particular, while not legally required, we hope that all users \nof the data will acknowledge the OpenfMRI project and NSF Grant \nOCI-1131441 (R. Poldrack, PI) in any publications.\n",
|
|
21
|
+
head: "d62fdc42e2a568a6f89e33d68d3ef343ff883e02",
|
|
22
22
|
size: 623389,
|
|
23
23
|
description: {
|
|
24
|
-
Name:
|
|
25
|
-
Authors: [
|
|
24
|
+
Name: "DS003-downsampled (only T1)",
|
|
25
|
+
Authors: ["J. Doe", "J. Doe", "J. Doe"],
|
|
26
26
|
DatasetDOI: null,
|
|
27
|
-
License:
|
|
27
|
+
License: "CC0",
|
|
28
28
|
Acknowledgements: null,
|
|
29
29
|
HowToAcknowledge: null,
|
|
30
30
|
Funding: null,
|
|
31
31
|
ReferencesAndLinks: null,
|
|
32
32
|
EthicsApprovals: null,
|
|
33
|
-
__typename:
|
|
33
|
+
__typename: "Description",
|
|
34
34
|
},
|
|
35
35
|
summary: {
|
|
36
|
-
modalities: [
|
|
37
|
-
secondaryModalities: [
|
|
36
|
+
modalities: ["MRI"],
|
|
37
|
+
secondaryModalities: ["MRI_Structural"],
|
|
38
38
|
sessions: [],
|
|
39
|
-
subjects: [
|
|
39
|
+
subjects: ["01", "02"],
|
|
40
40
|
subjectMetadata: [
|
|
41
41
|
{
|
|
42
|
-
participantId:
|
|
42
|
+
participantId: "01",
|
|
43
43
|
age: 25,
|
|
44
|
-
sex:
|
|
44
|
+
sex: "M",
|
|
45
45
|
group: null,
|
|
46
|
-
__typename:
|
|
46
|
+
__typename: "SubjectMetadata",
|
|
47
47
|
},
|
|
48
48
|
],
|
|
49
49
|
tasks: [],
|
|
@@ -51,208 +51,208 @@ export const dataset = {
|
|
|
51
51
|
totalFiles: 7,
|
|
52
52
|
dataProcessed: false,
|
|
53
53
|
pet: null,
|
|
54
|
-
__typename:
|
|
54
|
+
__typename: "Summary",
|
|
55
55
|
},
|
|
56
|
-
__typename:
|
|
56
|
+
__typename: "Draft",
|
|
57
57
|
issues: [
|
|
58
58
|
{
|
|
59
|
-
severity:
|
|
59
|
+
severity: "warning",
|
|
60
60
|
code: 82,
|
|
61
61
|
reason:
|
|
62
|
-
|
|
62
|
+
"Tabular file contains custom columns not described in a data dictionary",
|
|
63
63
|
files: [
|
|
64
64
|
{
|
|
65
65
|
evidence:
|
|
66
|
-
|
|
66
|
+
"Columns: sex, age not defined, please define in: /participants.json",
|
|
67
67
|
line: null,
|
|
68
68
|
character: null,
|
|
69
69
|
reason:
|
|
70
|
-
|
|
70
|
+
"Tabular file contains custom columns not described in a data dictionary",
|
|
71
71
|
file: {
|
|
72
|
-
name:
|
|
73
|
-
path:
|
|
74
|
-
relativePath:
|
|
75
|
-
__typename:
|
|
72
|
+
name: "participants.tsv",
|
|
73
|
+
path: "/datalad/ds001032/participants.tsv",
|
|
74
|
+
relativePath: "/participants.tsv",
|
|
75
|
+
__typename: "ValidationIssueFileDetail",
|
|
76
76
|
},
|
|
77
|
-
__typename:
|
|
77
|
+
__typename: "ValidationIssueFile",
|
|
78
78
|
},
|
|
79
79
|
],
|
|
80
80
|
additionalFileCount: 0,
|
|
81
|
-
__typename:
|
|
81
|
+
__typename: "ValidationIssue",
|
|
82
82
|
},
|
|
83
83
|
],
|
|
84
84
|
},
|
|
85
|
-
__typename:
|
|
85
|
+
__typename: "Dataset",
|
|
86
86
|
permissions: {
|
|
87
|
-
id:
|
|
87
|
+
id: "ds001032",
|
|
88
88
|
userPermissions: [
|
|
89
89
|
{
|
|
90
90
|
user: {
|
|
91
|
-
id:
|
|
92
|
-
email:
|
|
93
|
-
__typename:
|
|
91
|
+
id: "18492691-707f-4161-bc73-6ed22ce40138",
|
|
92
|
+
email: "test@example.com",
|
|
93
|
+
__typename: "User",
|
|
94
94
|
},
|
|
95
|
-
level:
|
|
96
|
-
__typename:
|
|
95
|
+
level: "admin",
|
|
96
|
+
__typename: "Permission",
|
|
97
97
|
},
|
|
98
98
|
],
|
|
99
|
-
__typename:
|
|
99
|
+
__typename: "DatasetPermissions",
|
|
100
100
|
},
|
|
101
101
|
snapshots: [
|
|
102
102
|
{
|
|
103
|
-
id:
|
|
104
|
-
tag:
|
|
105
|
-
created:
|
|
106
|
-
hexsha:
|
|
107
|
-
__typename:
|
|
103
|
+
id: "ds001032:1.0.0",
|
|
104
|
+
tag: "1.0.0",
|
|
105
|
+
created: "2021-12-17T22:22:49.000Z",
|
|
106
|
+
hexsha: "e4daf5567b86426b13e2d319859164e410975056",
|
|
107
|
+
__typename: "Snapshot",
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
|
-
id:
|
|
111
|
-
tag:
|
|
112
|
-
created:
|
|
113
|
-
hexsha:
|
|
114
|
-
__typename:
|
|
110
|
+
id: "ds001032:2.0.0",
|
|
111
|
+
tag: "2.0.0",
|
|
112
|
+
created: "2021-12-17T22:32:08.000Z",
|
|
113
|
+
hexsha: "d62fdc42e2a568a6f89e33d68d3ef343ff883e02",
|
|
114
|
+
__typename: "Snapshot",
|
|
115
115
|
},
|
|
116
116
|
],
|
|
117
117
|
metadata: {
|
|
118
|
-
datasetId:
|
|
118
|
+
datasetId: "ds001032",
|
|
119
119
|
datasetUrl: null,
|
|
120
120
|
datasetName: null,
|
|
121
121
|
firstSnapshotCreatedAt: null,
|
|
122
122
|
latestSnapshotCreatedAt: null,
|
|
123
|
-
dxStatus:
|
|
123
|
+
dxStatus: "",
|
|
124
124
|
tasksCompleted: [],
|
|
125
125
|
trialCount: null,
|
|
126
|
-
grantFunderName:
|
|
127
|
-
grantIdentifier:
|
|
128
|
-
studyDesign:
|
|
129
|
-
studyDomain:
|
|
130
|
-
studyLongitudinal:
|
|
126
|
+
grantFunderName: "",
|
|
127
|
+
grantIdentifier: "",
|
|
128
|
+
studyDesign: "",
|
|
129
|
+
studyDomain: "",
|
|
130
|
+
studyLongitudinal: "",
|
|
131
131
|
dataProcessed: null,
|
|
132
|
-
species:
|
|
133
|
-
associatedPaperDOI:
|
|
134
|
-
openneuroPaperDOI:
|
|
132
|
+
species: "",
|
|
133
|
+
associatedPaperDOI: "",
|
|
134
|
+
openneuroPaperDOI: "",
|
|
135
135
|
seniorAuthor: null,
|
|
136
136
|
adminUsers: [],
|
|
137
137
|
ages: [],
|
|
138
138
|
modalities: [],
|
|
139
139
|
affirmedDefaced: true,
|
|
140
140
|
affirmedConsent: false,
|
|
141
|
-
__typename:
|
|
141
|
+
__typename: "Metadata",
|
|
142
142
|
},
|
|
143
143
|
comments: [],
|
|
144
144
|
uploader: {
|
|
145
|
-
id:
|
|
146
|
-
name:
|
|
147
|
-
email:
|
|
148
|
-
__typename:
|
|
145
|
+
id: "18492691-707f-4161-bc73-6ed22ce40138",
|
|
146
|
+
name: "Test User",
|
|
147
|
+
email: "test@example.com",
|
|
148
|
+
__typename: "User",
|
|
149
149
|
},
|
|
150
150
|
analytics: {
|
|
151
151
|
downloads: 0,
|
|
152
152
|
views: 23,
|
|
153
|
-
__typename:
|
|
153
|
+
__typename: "Analytic",
|
|
154
154
|
},
|
|
155
155
|
derivatives: [],
|
|
156
156
|
onBrainlife: false,
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
export const snapshot = {
|
|
160
|
-
id:
|
|
161
|
-
tag:
|
|
162
|
-
created:
|
|
160
|
+
id: "ds001032:1.0.0",
|
|
161
|
+
tag: "1.0.0",
|
|
162
|
+
created: "2021-12-17T22:32:08.000Z",
|
|
163
163
|
readme:
|
|
164
|
-
|
|
164
|
+
"This dataset was obtained from the OpenfMRI project (http://www.openfmri.org).\nAccession #: ds003\nDescription: Rhyme judgment\n\nRelease history:\n10/06/2011: initial release\n3/21/2013: Updated release with QA information\n\nThis dataset is made available under the Public Domain Dedication and License \nv1.0, whose full text can be found at \nhttp://www.opendatacommons.org/licenses/pddl/1.0/. \nWe hope that all users will follow the ODC Attribution/Share-Alike \nCommunity Norms (http://www.opendatacommons.org/norms/odc-by-sa/); \nin particular, while not legally required, we hope that all users \nof the data will acknowledge the OpenfMRI project and NSF Grant \nOCI-1131441 (R. Poldrack, PI) in any publications.\n",
|
|
165
165
|
size: 623389,
|
|
166
166
|
deprecated: null,
|
|
167
167
|
description: {
|
|
168
|
-
Name:
|
|
169
|
-
Authors: [
|
|
168
|
+
Name: "DS003-downsampled (only T1)",
|
|
169
|
+
Authors: ["J. Doe", "J. Doe", "J. Doe"],
|
|
170
170
|
DatasetDOI: null,
|
|
171
|
-
License:
|
|
171
|
+
License: "CC0",
|
|
172
172
|
Acknowledgements: null,
|
|
173
173
|
HowToAcknowledge: null,
|
|
174
174
|
Funding: null,
|
|
175
175
|
ReferencesAndLinks: null,
|
|
176
176
|
EthicsApprovals: null,
|
|
177
|
-
__typename:
|
|
177
|
+
__typename: "Description",
|
|
178
178
|
},
|
|
179
179
|
files: [
|
|
180
180
|
{
|
|
181
|
-
id:
|
|
182
|
-
key:
|
|
183
|
-
filename:
|
|
181
|
+
id: "7dcbfd4d8ef17174c6eb2cc023f7950c682563a5",
|
|
182
|
+
key: "4feabfe8803db741e9a0c5ad00bc3ada109558e3",
|
|
183
|
+
filename: "CHANGES",
|
|
184
184
|
size: 52,
|
|
185
185
|
directory: null,
|
|
186
186
|
annexed: false,
|
|
187
|
-
__typename:
|
|
187
|
+
__typename: "DatasetFile",
|
|
188
188
|
},
|
|
189
189
|
{
|
|
190
|
-
id:
|
|
191
|
-
key:
|
|
192
|
-
filename:
|
|
190
|
+
id: "63888a199a5ce37377b1cd708cda59577dad218f",
|
|
191
|
+
key: "fa84e5f958ec72d42b3e196e592f6db9f7104b19",
|
|
192
|
+
filename: "README",
|
|
193
193
|
size: 709,
|
|
194
194
|
directory: null,
|
|
195
195
|
annexed: false,
|
|
196
|
-
__typename:
|
|
196
|
+
__typename: "DatasetFile",
|
|
197
197
|
},
|
|
198
198
|
{
|
|
199
|
-
id:
|
|
200
|
-
key:
|
|
201
|
-
filename:
|
|
199
|
+
id: "0a2a5d8d72a31f03608db59c4cfd650aba77c363",
|
|
200
|
+
key: "b08aa0ec5b5e716479824859524a22140fb2af82",
|
|
201
|
+
filename: "T1w.json",
|
|
202
202
|
size: 196,
|
|
203
203
|
directory: null,
|
|
204
204
|
annexed: false,
|
|
205
|
-
__typename:
|
|
205
|
+
__typename: "DatasetFile",
|
|
206
206
|
},
|
|
207
207
|
{
|
|
208
|
-
id:
|
|
209
|
-
key:
|
|
210
|
-
filename:
|
|
208
|
+
id: "a2922b427c5c997e77ce058e0ce57ffd17123a7f",
|
|
209
|
+
key: "0b1856b91c11f67098ce60114417a62dd55730a5",
|
|
210
|
+
filename: "dataset_description.json",
|
|
211
211
|
size: 172,
|
|
212
212
|
directory: null,
|
|
213
213
|
annexed: false,
|
|
214
|
-
__typename:
|
|
214
|
+
__typename: "DatasetFile",
|
|
215
215
|
},
|
|
216
216
|
{
|
|
217
|
-
id:
|
|
218
|
-
key:
|
|
219
|
-
filename:
|
|
217
|
+
id: "f682a32c9538082fa6c8ad11e9a536dc07d1d0cf",
|
|
218
|
+
key: "37ecbdc7ab8ffaf2cddecc338092f6679089287d",
|
|
219
|
+
filename: "participants.tsv",
|
|
220
220
|
size: 36,
|
|
221
221
|
directory: null,
|
|
222
222
|
annexed: false,
|
|
223
|
-
__typename:
|
|
223
|
+
__typename: "DatasetFile",
|
|
224
224
|
},
|
|
225
225
|
{
|
|
226
|
-
id:
|
|
226
|
+
id: "directory:sub-01",
|
|
227
227
|
key: null,
|
|
228
|
-
filename:
|
|
228
|
+
filename: "sub-01",
|
|
229
229
|
size: 1,
|
|
230
230
|
directory: true,
|
|
231
231
|
annexed: null,
|
|
232
|
-
__typename:
|
|
232
|
+
__typename: "DatasetFile",
|
|
233
233
|
},
|
|
234
234
|
{
|
|
235
|
-
id:
|
|
235
|
+
id: "directory:sub-02",
|
|
236
236
|
key: null,
|
|
237
|
-
filename:
|
|
237
|
+
filename: "sub-02",
|
|
238
238
|
size: 1,
|
|
239
239
|
directory: true,
|
|
240
240
|
annexed: null,
|
|
241
|
-
__typename:
|
|
241
|
+
__typename: "DatasetFile",
|
|
242
242
|
},
|
|
243
243
|
],
|
|
244
244
|
summary: {
|
|
245
|
-
modalities: [
|
|
246
|
-
secondaryModalities: [
|
|
245
|
+
modalities: ["MRI"],
|
|
246
|
+
secondaryModalities: ["MRI_Structural"],
|
|
247
247
|
sessions: [],
|
|
248
|
-
subjects: [
|
|
248
|
+
subjects: ["01", "02"],
|
|
249
249
|
subjectMetadata: [
|
|
250
250
|
{
|
|
251
|
-
participantId:
|
|
251
|
+
participantId: "01",
|
|
252
252
|
age: 25,
|
|
253
|
-
sex:
|
|
253
|
+
sex: "M",
|
|
254
254
|
group: null,
|
|
255
|
-
__typename:
|
|
255
|
+
__typename: "SubjectMetadata",
|
|
256
256
|
},
|
|
257
257
|
],
|
|
258
258
|
tasks: [],
|
|
@@ -260,41 +260,41 @@ export const snapshot = {
|
|
|
260
260
|
totalFiles: 7,
|
|
261
261
|
dataProcessed: false,
|
|
262
262
|
pet: null,
|
|
263
|
-
__typename:
|
|
263
|
+
__typename: "Summary",
|
|
264
264
|
},
|
|
265
265
|
analytics: {
|
|
266
266
|
downloads: 0,
|
|
267
267
|
views: 24,
|
|
268
|
-
__typename:
|
|
268
|
+
__typename: "Analytic",
|
|
269
269
|
},
|
|
270
270
|
issues: [
|
|
271
271
|
{
|
|
272
|
-
severity:
|
|
272
|
+
severity: "warning",
|
|
273
273
|
code: 82,
|
|
274
274
|
reason:
|
|
275
|
-
|
|
275
|
+
"Tabular file contains custom columns not described in a data dictionary",
|
|
276
276
|
files: [
|
|
277
277
|
{
|
|
278
278
|
evidence:
|
|
279
|
-
|
|
279
|
+
"Columns: sex, age not defined, please define in: /participants.json",
|
|
280
280
|
line: null,
|
|
281
281
|
character: null,
|
|
282
282
|
reason:
|
|
283
|
-
|
|
283
|
+
"Tabular file contains custom columns not described in a data dictionary",
|
|
284
284
|
file: {
|
|
285
|
-
name:
|
|
286
|
-
path:
|
|
287
|
-
relativePath:
|
|
288
|
-
__typename:
|
|
285
|
+
name: "participants.tsv",
|
|
286
|
+
path: "/datalad/ds001032/participants.tsv",
|
|
287
|
+
relativePath: "/participants.tsv",
|
|
288
|
+
__typename: "ValidationIssueFileDetail",
|
|
289
289
|
},
|
|
290
|
-
__typename:
|
|
290
|
+
__typename: "ValidationIssueFile",
|
|
291
291
|
},
|
|
292
292
|
],
|
|
293
293
|
additionalFileCount: 0,
|
|
294
|
-
__typename:
|
|
294
|
+
__typename: "ValidationIssue",
|
|
295
295
|
},
|
|
296
296
|
],
|
|
297
|
-
__typename:
|
|
298
|
-
hexsha:
|
|
297
|
+
__typename: "Snapshot",
|
|
298
|
+
hexsha: "d62fdc42e2a568a6f89e33d68d3ef343ff883e02",
|
|
299
299
|
onBrainlife: false,
|
|
300
300
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { useState } from
|
|
2
|
-
import { MemoryRouter } from
|
|
3
|
-
import { UserModalOpenCtx } from
|
|
4
|
-
import { MockedProvider } from
|
|
1
|
+
import React, { useState } from "react"
|
|
2
|
+
import { MemoryRouter } from "react-router-dom"
|
|
3
|
+
import { UserModalOpenCtx } from "../utils/user-login-modal-ctx"
|
|
4
|
+
import { MockedProvider } from "@apollo/client/testing"
|
|
5
5
|
|
|
6
6
|
// Provide the basics needed to render complex components with mocked router, apollo, etc
|
|
7
7
|
export const MockAppWrapper = ({ children }) => {
|
package/src/scripts/index.tsx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import Uploader from
|
|
3
|
-
import AppRoutes from
|
|
4
|
-
import HeaderContainer from
|
|
5
|
-
import FooterContainer from
|
|
6
|
-
import { SearchParamsProvider } from
|
|
7
|
-
import { UserModalOpenProvider } from
|
|
8
|
-
import { useAnalytics } from
|
|
1
|
+
import React from "react"
|
|
2
|
+
import Uploader from "./uploader/uploader.jsx"
|
|
3
|
+
import AppRoutes from "./routes"
|
|
4
|
+
import HeaderContainer from "./common/containers/header"
|
|
5
|
+
import FooterContainer from "./common/containers/footer"
|
|
6
|
+
import { SearchParamsProvider } from "./search/search-params-ctx"
|
|
7
|
+
import { UserModalOpenProvider } from "./utils/user-login-modal-ctx"
|
|
8
|
+
import { useAnalytics } from "./utils/analytics"
|
|
9
9
|
|
|
10
|
-
import
|
|
10
|
+
import "../assets/email-header.png"
|
|
11
11
|
|
|
12
12
|
const Index = (): React.ReactElement => {
|
|
13
13
|
useAnalytics()
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// dependencies -------------------------------------------------------
|
|
2
2
|
|
|
3
|
-
import React from
|
|
4
|
-
import { Navigate,
|
|
5
|
-
import Users from
|
|
6
|
-
import FlaggedFiles from
|
|
7
|
-
import AdminUser from
|
|
3
|
+
import React from "react"
|
|
4
|
+
import { Navigate, NavLink, Route, Routes } from "react-router-dom"
|
|
5
|
+
import Users from "./users.jsx"
|
|
6
|
+
import FlaggedFiles from "./flagged-files.jsx"
|
|
7
|
+
import AdminUser from "../../authentication/admin-user.jsx"
|
|
8
8
|
|
|
9
9
|
class Dashboard extends React.Component {
|
|
10
10
|
// life cycle events --------------------------------------------------
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// dependencies -------------------------------------------------------
|
|
2
2
|
|
|
3
|
-
import React, { useState } from
|
|
4
|
-
import PropTypes from
|
|
5
|
-
import { useQuery } from
|
|
6
|
-
import { gql } from
|
|
7
|
-
import Helmet from
|
|
8
|
-
import { Loading } from
|
|
9
|
-
import { Link } from
|
|
10
|
-
import { pageTitle } from
|
|
3
|
+
import React, { useState } from "react"
|
|
4
|
+
import PropTypes from "prop-types"
|
|
5
|
+
import { useQuery } from "@apollo/client"
|
|
6
|
+
import { gql } from "@apollo/client"
|
|
7
|
+
import Helmet from "react-helmet"
|
|
8
|
+
import { Loading } from "@openneuro/components/loading"
|
|
9
|
+
import { Link } from "react-router-dom"
|
|
10
|
+
import { pageTitle } from "../../resources/strings.js"
|
|
11
11
|
|
|
12
|
-
export const unescapePath = path => path.replace(/:/g,
|
|
12
|
+
export const unescapePath = (path) => path.replace(/:/g, "/")
|
|
13
13
|
|
|
14
14
|
export const FLAGGED_FILES = gql`
|
|
15
15
|
query flaggedFiles($flagged: Boolean, $deleted: Boolean) {
|
|
@@ -30,7 +30,7 @@ const FlaggedFilesContainer = () => {
|
|
|
30
30
|
const [includeDeleted, setIncludeDeleted] = useState(false)
|
|
31
31
|
const { data, loading, error } = useQuery(FLAGGED_FILES, {
|
|
32
32
|
variables: { flagged: includeFlagged, deleted: includeDeleted },
|
|
33
|
-
errorPolicy:
|
|
33
|
+
errorPolicy: "all",
|
|
34
34
|
})
|
|
35
35
|
return (
|
|
36
36
|
<FlaggedFiles
|
|
@@ -68,26 +68,28 @@ const FlaggedFiles = ({
|
|
|
68
68
|
<div className="filters">
|
|
69
69
|
<label>Filter By:</label>
|
|
70
70
|
<button
|
|
71
|
-
className={includeFlagged ?
|
|
72
|
-
onClick={() => setIncludeFlagged(prev => !prev)}
|
|
71
|
+
className={includeFlagged ? "active" : null}
|
|
72
|
+
onClick={() => setIncludeFlagged((prev) => !prev)}
|
|
73
|
+
>
|
|
73
74
|
<span className="filter-flagged">
|
|
74
75
|
<i
|
|
75
|
-
className={
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
/>{
|
|
76
|
+
className={includeFlagged
|
|
77
|
+
? "fa fa-check-square-o"
|
|
78
|
+
: "fa fa-square-o"}
|
|
79
|
+
/>{" "}
|
|
79
80
|
Flagged
|
|
80
81
|
</span>
|
|
81
82
|
</button>
|
|
82
83
|
<button
|
|
83
|
-
className={includeDeleted ?
|
|
84
|
-
onClick={() => setIncludeDeleted(prev => !prev)}
|
|
84
|
+
className={includeDeleted ? "active" : null}
|
|
85
|
+
onClick={() => setIncludeDeleted((prev) => !prev)}
|
|
86
|
+
>
|
|
85
87
|
<span className="filter-deleted">
|
|
86
88
|
<i
|
|
87
|
-
className={
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
/>{
|
|
89
|
+
className={includeDeleted
|
|
90
|
+
? "fa fa-check-square-o"
|
|
91
|
+
: "fa fa-square-o"}
|
|
92
|
+
/>{" "}
|
|
91
93
|
Deleted
|
|
92
94
|
</span>
|
|
93
95
|
</button>
|
|
@@ -99,13 +101,13 @@ const FlaggedFiles = ({
|
|
|
99
101
|
<div className="users-panel-wrap">
|
|
100
102
|
{loading && <Loading />}
|
|
101
103
|
{data &&
|
|
102
|
-
(data.flaggedFiles.length
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
(data.flaggedFiles.length
|
|
105
|
+
? (
|
|
106
|
+
data.flaggedFiles.map((flaggedFile, key) => (
|
|
107
|
+
<FlaggedItem {...flaggedFile} key={key} />
|
|
108
|
+
))
|
|
109
|
+
)
|
|
110
|
+
: <h4>No Results Found</h4>)}
|
|
109
111
|
</div>
|
|
110
112
|
</div>
|
|
111
113
|
</div>
|
|
@@ -122,7 +124,7 @@ FlaggedFiles.propTypes = {
|
|
|
122
124
|
}
|
|
123
125
|
|
|
124
126
|
const datasetUrlPath = (datasetId, snapshot) =>
|
|
125
|
-
`/datasets/${datasetId}${snapshot ===
|
|
127
|
+
`/datasets/${datasetId}${snapshot === "HEAD" ? "" : `/versions/${snapshot}`}`
|
|
126
128
|
|
|
127
129
|
const FlaggedItem = ({
|
|
128
130
|
datasetId,
|
|
@@ -136,7 +138,7 @@ const FlaggedItem = ({
|
|
|
136
138
|
<label>Dataset : Snapshot</label>
|
|
137
139
|
<Link to={datasetUrlPath(datasetId, snapshot)}>
|
|
138
140
|
{datasetId}
|
|
139
|
-
{
|
|
141
|
+
{" : "}
|
|
140
142
|
{snapshot}
|
|
141
143
|
</Link>
|
|
142
144
|
</div>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React, { FC, ReactElement } from
|
|
2
|
-
import { gql } from
|
|
3
|
-
import { Mutation } from
|
|
4
|
-
import { WarnButton } from
|
|
5
|
-
import { getProfile } from
|
|
6
|
-
import { useCookies } from
|
|
7
|
-
import { USER_FRAGMENT } from
|
|
1
|
+
import React, { FC, ReactElement } from "react"
|
|
2
|
+
import { gql } from "@apollo/client"
|
|
3
|
+
import { Mutation } from "@apollo/client/react/components"
|
|
4
|
+
import { WarnButton } from "@openneuro/components/warn-button"
|
|
5
|
+
import { getProfile } from "../../authentication/profile"
|
|
6
|
+
import { useCookies } from "react-cookie"
|
|
7
|
+
import { USER_FRAGMENT } from "./user-fragment"
|
|
8
8
|
|
|
9
9
|
interface UserToolsProps {
|
|
10
10
|
user: Record<string, unknown>
|
|
@@ -31,8 +31,8 @@ export const SET_BLOCKED = gql`
|
|
|
31
31
|
|
|
32
32
|
export const UserTools: FC<UserToolsProps> = ({ user, refetch }) => {
|
|
33
33
|
const [cookies] = useCookies()
|
|
34
|
-
const adminIcon = user.admin ?
|
|
35
|
-
const blacklistIcon = user.blocked ?
|
|
34
|
+
const adminIcon = user.admin ? "fa-check-square-o" : "fa-square-o"
|
|
35
|
+
const blacklistIcon = user.blocked ? "fa-check-square-o" : "fa-square-o"
|
|
36
36
|
|
|
37
37
|
if (user.id !== getProfile(cookies).sub) {
|
|
38
38
|
return (
|
|
@@ -41,7 +41,8 @@ export const UserTools: FC<UserToolsProps> = ({ user, refetch }) => {
|
|
|
41
41
|
<div className="tool">
|
|
42
42
|
<Mutation
|
|
43
43
|
mutation={SET_ADMIN}
|
|
44
|
-
variables={{ id: user.id, admin: !user.admin }}
|
|
44
|
+
variables={{ id: user.id, admin: !user.admin }}
|
|
45
|
+
>
|
|
45
46
|
{(setAdmin): ReactElement => (
|
|
46
47
|
<WarnButton
|
|
47
48
|
message="Admin"
|
|
@@ -58,7 +59,8 @@ export const UserTools: FC<UserToolsProps> = ({ user, refetch }) => {
|
|
|
58
59
|
<div className="tool">
|
|
59
60
|
<Mutation
|
|
60
61
|
mutation={SET_BLOCKED}
|
|
61
|
-
variables={{ id: user.id, blocked: !user.blocked }}
|
|
62
|
+
variables={{ id: user.id, blocked: !user.blocked }}
|
|
63
|
+
>
|
|
62
64
|
{(setBlocked): ReactElement => (
|
|
63
65
|
<WarnButton
|
|
64
66
|
message="Block"
|