@openneuro/app 4.20.4 → 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,24 +1,24 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import PropTypes from
|
|
3
|
-
import styled from
|
|
1
|
+
import React, { createRef, useState } from "react"
|
|
2
|
+
import PropTypes from "prop-types"
|
|
3
|
+
import styled from "@emotion/styled"
|
|
4
4
|
|
|
5
5
|
const Container = styled.div({
|
|
6
|
-
position:
|
|
7
|
-
width:
|
|
8
|
-
height:
|
|
9
|
-
marginTop:
|
|
10
|
-
backgroundColor:
|
|
11
|
-
borderRadius:
|
|
6
|
+
position: "relative",
|
|
7
|
+
width: "100%",
|
|
8
|
+
height: "3rem",
|
|
9
|
+
marginTop: "30px",
|
|
10
|
+
backgroundColor: "white",
|
|
11
|
+
borderRadius: "4px",
|
|
12
12
|
border: 0,
|
|
13
13
|
})
|
|
14
14
|
|
|
15
15
|
const centerLabelStyles = {
|
|
16
|
-
top:
|
|
17
|
-
fontSize:
|
|
16
|
+
top: "1rem",
|
|
17
|
+
fontSize: "1em",
|
|
18
18
|
}
|
|
19
19
|
const pushedUpLabelStyles = {
|
|
20
|
-
top:
|
|
21
|
-
fontSize:
|
|
20
|
+
top: "-17px",
|
|
21
|
+
fontSize: "0.75em",
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
interface TextArrayInputLabelProps {
|
|
@@ -28,36 +28,36 @@ interface TextArrayInputLabelProps {
|
|
|
28
28
|
|
|
29
29
|
const Label = styled.label<TextArrayInputLabelProps>(
|
|
30
30
|
{
|
|
31
|
-
position:
|
|
32
|
-
left:
|
|
33
|
-
right:
|
|
34
|
-
overflow:
|
|
35
|
-
whiteSpace:
|
|
36
|
-
textOverflow:
|
|
37
|
-
color:
|
|
38
|
-
transition:
|
|
39
|
-
transitionTimingFunction:
|
|
40
|
-
textAlign:
|
|
31
|
+
position: "absolute",
|
|
32
|
+
left: "1rem",
|
|
33
|
+
right: "1rem",
|
|
34
|
+
overflow: "hidden",
|
|
35
|
+
whiteSpace: "nowrap",
|
|
36
|
+
textOverflow: "ellipsis",
|
|
37
|
+
color: "#999",
|
|
38
|
+
transition: "top 100ms, font-size 100ms",
|
|
39
|
+
transitionTimingFunction: "ease-out",
|
|
40
|
+
textAlign: "left",
|
|
41
41
|
},
|
|
42
42
|
({ hasValue, hasFocus }) => ({
|
|
43
43
|
...(hasValue || hasFocus ? pushedUpLabelStyles : centerLabelStyles),
|
|
44
|
-
|
|
44
|
+
":focus": pushedUpLabelStyles,
|
|
45
45
|
}),
|
|
46
46
|
)
|
|
47
47
|
const DisabledIcon = styled.i({
|
|
48
|
-
|
|
49
|
-
position:
|
|
50
|
-
top:
|
|
51
|
-
right:
|
|
52
|
-
color:
|
|
53
|
-
fontSize:
|
|
48
|
+
"&&": {
|
|
49
|
+
position: "absolute",
|
|
50
|
+
top: "0.4rem",
|
|
51
|
+
right: "0.4rem",
|
|
52
|
+
color: "#5cb85c",
|
|
53
|
+
fontSize: "8px",
|
|
54
54
|
},
|
|
55
55
|
})
|
|
56
56
|
const Input = styled.input({
|
|
57
|
-
width:
|
|
58
|
-
height:
|
|
59
|
-
padding:
|
|
60
|
-
textAlign:
|
|
57
|
+
width: "100%",
|
|
58
|
+
height: "100%",
|
|
59
|
+
padding: "13px",
|
|
60
|
+
textAlign: "left",
|
|
61
61
|
})
|
|
62
62
|
|
|
63
63
|
const TextArrayInput = ({
|
|
@@ -83,7 +83,7 @@ const TextArrayInput = ({
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
const handleChange = (e): void => {
|
|
86
|
-
onChange(e.target.name, e.target.value.split(
|
|
86
|
+
onChange(e.target.name, e.target.value.split(","))
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
return (
|
|
@@ -92,14 +92,15 @@ const TextArrayInput = ({
|
|
|
92
92
|
htmlFor={name}
|
|
93
93
|
hasValue={Boolean(value)}
|
|
94
94
|
hasFocus={hasFocus}
|
|
95
|
-
onClick={focusInput}
|
|
95
|
+
onClick={focusInput}
|
|
96
|
+
>
|
|
96
97
|
{label}
|
|
97
98
|
</Label>
|
|
98
99
|
{annotated && <DisabledIcon className="fa fa-asterisk" />}
|
|
99
100
|
<Input
|
|
100
101
|
ref={input}
|
|
101
102
|
name={name}
|
|
102
|
-
value={value.join(
|
|
103
|
+
value={value.join(", ")}
|
|
103
104
|
disabled={disabled}
|
|
104
105
|
required={required}
|
|
105
106
|
onFocus={focusInput}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import PropTypes from
|
|
3
|
-
import styled from
|
|
1
|
+
import React, { createRef, useState } from "react"
|
|
2
|
+
import PropTypes from "prop-types"
|
|
3
|
+
import styled from "@emotion/styled"
|
|
4
4
|
|
|
5
5
|
interface TextInputContainerProps {
|
|
6
6
|
textarea: boolean
|
|
@@ -8,27 +8,25 @@ interface TextInputContainerProps {
|
|
|
8
8
|
|
|
9
9
|
const Container = styled.div<TextInputContainerProps>(
|
|
10
10
|
{
|
|
11
|
-
position:
|
|
12
|
-
width:
|
|
13
|
-
height:
|
|
14
|
-
marginTop:
|
|
15
|
-
backgroundColor:
|
|
16
|
-
borderRadius:
|
|
11
|
+
position: "relative",
|
|
12
|
+
width: "100%",
|
|
13
|
+
height: "3rem",
|
|
14
|
+
marginTop: "30px",
|
|
15
|
+
backgroundColor: "white",
|
|
16
|
+
borderRadius: "4px",
|
|
17
17
|
},
|
|
18
18
|
({ textarea }) =>
|
|
19
|
-
textarea
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
height: '3rem',
|
|
23
|
-
},
|
|
19
|
+
textarea ? {} : {
|
|
20
|
+
height: "3rem",
|
|
21
|
+
},
|
|
24
22
|
)
|
|
25
23
|
const centerLabelStyles = {
|
|
26
|
-
top:
|
|
27
|
-
fontSize:
|
|
24
|
+
top: "13px",
|
|
25
|
+
fontSize: "1em",
|
|
28
26
|
}
|
|
29
27
|
const pushedUpLabelStyles = {
|
|
30
|
-
top:
|
|
31
|
-
fontSize:
|
|
28
|
+
top: "-17px",
|
|
29
|
+
fontSize: "0.75em",
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
interface TextInputLabelProps {
|
|
@@ -38,42 +36,42 @@ interface TextInputLabelProps {
|
|
|
38
36
|
|
|
39
37
|
const Label = styled.label<TextInputLabelProps>(
|
|
40
38
|
{
|
|
41
|
-
position:
|
|
42
|
-
left:
|
|
43
|
-
right:
|
|
44
|
-
overflow:
|
|
45
|
-
whiteSpace:
|
|
46
|
-
textOverflow:
|
|
47
|
-
color:
|
|
48
|
-
transition:
|
|
49
|
-
transitionTimingFunction:
|
|
50
|
-
textAlign:
|
|
39
|
+
position: "absolute",
|
|
40
|
+
left: "1rem",
|
|
41
|
+
right: "1rem",
|
|
42
|
+
overflow: "hidden",
|
|
43
|
+
whiteSpace: "nowrap",
|
|
44
|
+
textOverflow: "ellipsis",
|
|
45
|
+
color: "#999",
|
|
46
|
+
transition: "top 100ms, font-size 100ms",
|
|
47
|
+
transitionTimingFunction: "ease-out",
|
|
48
|
+
textAlign: "left",
|
|
51
49
|
},
|
|
52
50
|
({ hasValue, hasFocus }) => ({
|
|
53
51
|
...(hasValue || hasFocus ? pushedUpLabelStyles : centerLabelStyles),
|
|
54
|
-
|
|
52
|
+
":focus": pushedUpLabelStyles,
|
|
55
53
|
}),
|
|
56
54
|
)
|
|
57
55
|
const DisabledIcon = styled.i({
|
|
58
|
-
|
|
59
|
-
position:
|
|
60
|
-
top:
|
|
61
|
-
right:
|
|
62
|
-
color:
|
|
63
|
-
fontSize:
|
|
56
|
+
"&&": {
|
|
57
|
+
position: "absolute",
|
|
58
|
+
top: "0.4rem",
|
|
59
|
+
right: "0.4rem",
|
|
60
|
+
color: "#5cb85c",
|
|
61
|
+
fontSize: "8px",
|
|
64
62
|
},
|
|
65
63
|
})
|
|
66
64
|
const Input = styled.input({
|
|
67
|
-
width:
|
|
68
|
-
height:
|
|
69
|
-
padding:
|
|
70
|
-
textAlign:
|
|
65
|
+
width: "100%",
|
|
66
|
+
height: "100%",
|
|
67
|
+
padding: "13px",
|
|
68
|
+
textAlign: "left",
|
|
71
69
|
})
|
|
72
70
|
const Textarea = styled.textarea({
|
|
73
|
-
width:
|
|
74
|
-
borderRadius:
|
|
75
|
-
textAlign:
|
|
76
|
-
padding:
|
|
71
|
+
width: "100%",
|
|
72
|
+
borderRadius: "5px",
|
|
73
|
+
textAlign: "left",
|
|
74
|
+
padding: "13px",
|
|
77
75
|
})
|
|
78
76
|
const HoverMessage = styled.span`
|
|
79
77
|
position: relative;
|
|
@@ -109,7 +107,7 @@ const TextInput = ({
|
|
|
109
107
|
}): React.ReactElement => {
|
|
110
108
|
if (value === null || value === undefined) {
|
|
111
109
|
if (nullMessage) value = nullMessage
|
|
112
|
-
else value =
|
|
110
|
+
else value = ""
|
|
113
111
|
} else value = value.toString()
|
|
114
112
|
const [hasFocus, setHasFocus] = useState(false)
|
|
115
113
|
const [isShown, setIsShown] = useState(false)
|
|
@@ -145,43 +143,46 @@ const TextInput = ({
|
|
|
145
143
|
}}
|
|
146
144
|
onMouseLeave={(): void => {
|
|
147
145
|
setIsShown(false)
|
|
148
|
-
}}
|
|
146
|
+
}}
|
|
147
|
+
>
|
|
149
148
|
{label}
|
|
150
149
|
</Label>
|
|
151
150
|
{annotated && <DisabledIcon className="fa fa-asterisk" />}
|
|
152
|
-
{textarea
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
151
|
+
{textarea
|
|
152
|
+
? (
|
|
153
|
+
<Textarea
|
|
154
|
+
ref={textAreaRef}
|
|
155
|
+
name={name}
|
|
156
|
+
value={value}
|
|
157
|
+
onFocus={focusInput}
|
|
158
|
+
onBlur={removeFocus}
|
|
159
|
+
onChange={handleChange}
|
|
160
|
+
onMouseEnter={(): void => {
|
|
161
|
+
setIsShown(true)
|
|
162
|
+
}}
|
|
163
|
+
onMouseLeave={(): void => {
|
|
164
|
+
setIsShown(false)
|
|
165
|
+
}}
|
|
166
|
+
/>
|
|
167
|
+
)
|
|
168
|
+
: (
|
|
169
|
+
<Input
|
|
170
|
+
ref={inputRef}
|
|
171
|
+
name={name}
|
|
172
|
+
value={value}
|
|
173
|
+
disabled={disabled}
|
|
174
|
+
onFocus={focusInput}
|
|
175
|
+
onBlur={removeFocus}
|
|
176
|
+
onChange={handleChange}
|
|
177
|
+
required={required}
|
|
178
|
+
onMouseEnter={(): void => {
|
|
179
|
+
setIsShown(true)
|
|
180
|
+
}}
|
|
181
|
+
onMouseLeave={(): void => {
|
|
182
|
+
setIsShown(false)
|
|
183
|
+
}}
|
|
184
|
+
/>
|
|
185
|
+
)}
|
|
185
186
|
{isShown && hoverText && <HoverMessage>{hoverText}</HoverMessage>}
|
|
186
187
|
</Container>
|
|
187
188
|
)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { datasetCacheId } from
|
|
1
|
+
import { datasetCacheId } from "../cache-id.js"
|
|
2
2
|
|
|
3
|
-
describe(
|
|
4
|
-
describe(
|
|
5
|
-
it(
|
|
6
|
-
expect(datasetCacheId(
|
|
3
|
+
describe("Mutation cache ids", () => {
|
|
4
|
+
describe("datasetCacheId()", () => {
|
|
5
|
+
it("returns the expected cache id for a dataset", () => {
|
|
6
|
+
expect(datasetCacheId("ds000005")).toEqual("Dataset:ds000005")
|
|
7
7
|
})
|
|
8
8
|
})
|
|
9
9
|
})
|
|
@@ -1,192 +1,194 @@
|
|
|
1
|
-
import { fileCacheDeleteFilter } from
|
|
1
|
+
import { fileCacheDeleteFilter } from "../delete-file.jsx"
|
|
2
2
|
|
|
3
|
-
describe(
|
|
4
|
-
describe(
|
|
5
|
-
it(
|
|
3
|
+
describe("DeleteFile mutation", () => {
|
|
4
|
+
describe("fileCacheDeleteFilter", () => {
|
|
5
|
+
it("removes a deleted file", () => {
|
|
6
6
|
expect(
|
|
7
7
|
fileCacheDeleteFilter(
|
|
8
8
|
{
|
|
9
|
-
id:
|
|
10
|
-
key:
|
|
11
|
-
filename:
|
|
9
|
+
id: "DatasetFile:abcdef",
|
|
10
|
+
key: "cdefgh",
|
|
11
|
+
filename: "sub-01:anat:sub-01_T1w.nii.gz",
|
|
12
12
|
directory: false,
|
|
13
13
|
},
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
"sub-01:anat",
|
|
15
|
+
"sub-01_T1w.nii.gz",
|
|
16
16
|
[],
|
|
17
17
|
),
|
|
18
18
|
).toBe(false)
|
|
19
19
|
})
|
|
20
|
-
it(
|
|
20
|
+
it("does not remove a present file", () => {
|
|
21
21
|
expect(
|
|
22
22
|
fileCacheDeleteFilter(
|
|
23
23
|
{
|
|
24
|
-
id:
|
|
25
|
-
key:
|
|
26
|
-
filename:
|
|
24
|
+
id: "DatasetFile:abcdef",
|
|
25
|
+
key: "cdefgh",
|
|
26
|
+
filename: "sub-02:anat:sub-02_T1w.nii.gz",
|
|
27
27
|
directory: false,
|
|
28
28
|
},
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
"sub-01:anat",
|
|
30
|
+
"sub-01_T1w.nii.gz",
|
|
31
31
|
[],
|
|
32
32
|
),
|
|
33
33
|
).toBe(true)
|
|
34
34
|
})
|
|
35
|
-
it(
|
|
35
|
+
it("removes a matching directory", () => {
|
|
36
36
|
expect(
|
|
37
37
|
fileCacheDeleteFilter(
|
|
38
38
|
{
|
|
39
|
-
id:
|
|
40
|
-
key:
|
|
41
|
-
filename:
|
|
39
|
+
id: "DatasetFile:abcdef",
|
|
40
|
+
key: "cdefgh",
|
|
41
|
+
filename: "sub-01:anat",
|
|
42
42
|
directory: true,
|
|
43
43
|
},
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
"sub-01:anat",
|
|
45
|
+
"",
|
|
46
46
|
[],
|
|
47
47
|
),
|
|
48
48
|
).toBe(false)
|
|
49
49
|
})
|
|
50
|
-
it(
|
|
50
|
+
it("removes empty directories with a child being deleted", () => {
|
|
51
51
|
const cachedFileObjects = [
|
|
52
52
|
{
|
|
53
|
-
__typename:
|
|
54
|
-
id:
|
|
55
|
-
key:
|
|
56
|
-
filename:
|
|
53
|
+
__typename: "DatasetFile",
|
|
54
|
+
id: "3d9b15b3ef4e9da06e265e6078d3b4ddf8495102",
|
|
55
|
+
key: "c2ee90bf6c477b9e808e2b649a9492e947493297",
|
|
56
|
+
filename: "CHANGES",
|
|
57
57
|
directory: false,
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
|
-
__typename:
|
|
61
|
-
id:
|
|
62
|
-
key:
|
|
63
|
-
filename:
|
|
60
|
+
__typename: "DatasetFile",
|
|
61
|
+
id: "63888a199a5ce37377b1cd708cda59577dad218f",
|
|
62
|
+
key: "fa84e5f958ec72d42b3e196e592f6db9f7104b19",
|
|
63
|
+
filename: "README",
|
|
64
64
|
directory: false,
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
|
-
__typename:
|
|
68
|
-
id:
|
|
69
|
-
key:
|
|
70
|
-
filename:
|
|
67
|
+
__typename: "DatasetFile",
|
|
68
|
+
id: "aef1717a00106adc115f64990944d86e154d3e03",
|
|
69
|
+
key: "e652e8add021fe2684ce2404b431dee4315c9c95",
|
|
70
|
+
filename: "dataset_description.json",
|
|
71
71
|
directory: false,
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
|
-
__typename:
|
|
75
|
-
id:
|
|
76
|
-
key:
|
|
77
|
-
filename:
|
|
74
|
+
__typename: "DatasetFile",
|
|
75
|
+
id: "0a2a5d8d72a31f03608db59c4cfd650aba77c363",
|
|
76
|
+
key: "b08aa0ec5b5e716479824859524a22140fb2af82",
|
|
77
|
+
filename: "T1w.json",
|
|
78
78
|
directory: false,
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
|
-
__typename:
|
|
82
|
-
id:
|
|
83
|
-
key:
|
|
84
|
-
filename:
|
|
81
|
+
__typename: "DatasetFile",
|
|
82
|
+
id: "f682a32c9538082fa6c8ad11e9a536dc07d1d0cf",
|
|
83
|
+
key: "37ecbdc7ab8ffaf2cddecc338092f6679089287d",
|
|
84
|
+
filename: "participants.tsv",
|
|
85
85
|
directory: false,
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
|
-
__typename:
|
|
89
|
-
id:
|
|
88
|
+
__typename: "DatasetFile",
|
|
89
|
+
id: "c2ffc386e99bb26fbfc0d6bb33713b91b95a51f2",
|
|
90
90
|
key: null,
|
|
91
|
-
filename:
|
|
91
|
+
filename: "sub-01",
|
|
92
92
|
directory: true,
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
|
-
__typename:
|
|
96
|
-
id:
|
|
95
|
+
__typename: "DatasetFile",
|
|
96
|
+
id: "141c63f3373f17477c83f42c9fab01e6825052a0",
|
|
97
97
|
key: null,
|
|
98
|
-
filename:
|
|
98
|
+
filename: "sub-02",
|
|
99
99
|
directory: true,
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
|
-
__typename:
|
|
103
|
-
id:
|
|
102
|
+
__typename: "DatasetFile",
|
|
103
|
+
id: "635818b25263badb6d105aab8e33822f54ebbecf",
|
|
104
104
|
key: null,
|
|
105
|
-
filename:
|
|
105
|
+
filename: "sub-02:anat",
|
|
106
106
|
directory: true,
|
|
107
107
|
},
|
|
108
108
|
{
|
|
109
|
-
__typename:
|
|
110
|
-
id:
|
|
111
|
-
key:
|
|
112
|
-
|
|
109
|
+
__typename: "DatasetFile",
|
|
110
|
+
id: "b6f937773aa2130aa9d06fc3024cd1b150baa70b",
|
|
111
|
+
key:
|
|
112
|
+
"SHA256E-s311112--c3527d7944a9619afb57863a34e6af7ec3fe4f108e56c860d9e700699ff806fb.nii.gz",
|
|
113
|
+
filename: "sub-02:anat:sub-02_T1w.nii.gz",
|
|
113
114
|
directory: false,
|
|
114
115
|
},
|
|
115
116
|
]
|
|
116
117
|
expect(
|
|
117
118
|
fileCacheDeleteFilter(
|
|
118
119
|
{
|
|
119
|
-
id:
|
|
120
|
+
id: "141c63f3373f17477c83f42c9fab01e6825052a0",
|
|
120
121
|
key: null,
|
|
121
|
-
filename:
|
|
122
|
+
filename: "sub-02",
|
|
122
123
|
directory: true,
|
|
123
124
|
},
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
"sub-02:anat",
|
|
126
|
+
"sub-02_T1w.nii.gz",
|
|
126
127
|
cachedFileObjects,
|
|
127
128
|
),
|
|
128
129
|
).toBe(false)
|
|
129
130
|
expect(
|
|
130
131
|
fileCacheDeleteFilter(
|
|
131
132
|
{
|
|
132
|
-
id:
|
|
133
|
+
id: "635818b25263badb6d105aab8e33822f54ebbecf",
|
|
133
134
|
key: null,
|
|
134
|
-
filename:
|
|
135
|
+
filename: "sub-02:anat",
|
|
135
136
|
directory: true,
|
|
136
137
|
},
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
"sub-02:anat",
|
|
139
|
+
"sub-02_T1w.nii.gz",
|
|
139
140
|
cachedFileObjects,
|
|
140
141
|
),
|
|
141
142
|
).toBe(false)
|
|
142
143
|
expect(
|
|
143
144
|
fileCacheDeleteFilter(
|
|
144
145
|
{
|
|
145
|
-
id:
|
|
146
|
-
key:
|
|
147
|
-
|
|
146
|
+
id: "b6f937773aa2130aa9d06fc3024cd1b150baa70b",
|
|
147
|
+
key:
|
|
148
|
+
"SHA256E-s311112--c3527d7944a9619afb57863a34e6af7ec3fe4f108e56c860d9e700699ff806fb.nii.gz",
|
|
149
|
+
filename: "sub-02:anat:sub-02_T1w.nii.gz",
|
|
148
150
|
directory: false,
|
|
149
151
|
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
+
"sub-02:anat",
|
|
153
|
+
"sub-02_T1w.nii.gz",
|
|
152
154
|
cachedFileObjects,
|
|
153
155
|
),
|
|
154
156
|
).toBe(false)
|
|
155
157
|
})
|
|
156
|
-
it(
|
|
158
|
+
it("does not remove non-empty directories with a child being deleted", () => {
|
|
157
159
|
expect(
|
|
158
160
|
fileCacheDeleteFilter(
|
|
159
161
|
{
|
|
160
|
-
id:
|
|
161
|
-
key:
|
|
162
|
-
filename:
|
|
162
|
+
id: "DatasetFile:abcdef",
|
|
163
|
+
key: "cdefgh",
|
|
164
|
+
filename: "sub-02:anat",
|
|
163
165
|
directory: true,
|
|
164
166
|
},
|
|
165
|
-
|
|
166
|
-
|
|
167
|
+
"",
|
|
168
|
+
"sub-02:anat:sub-02_T1w.json",
|
|
167
169
|
[
|
|
168
170
|
{
|
|
169
|
-
id:
|
|
170
|
-
key:
|
|
171
|
-
filename:
|
|
171
|
+
id: "DatasetFile:123456",
|
|
172
|
+
key: "cdefgh",
|
|
173
|
+
filename: "sub-02:anat:sub-02_T1w.nii.gz",
|
|
172
174
|
directory: false,
|
|
173
175
|
},
|
|
174
176
|
],
|
|
175
177
|
),
|
|
176
178
|
).toBe(true)
|
|
177
179
|
})
|
|
178
|
-
it(
|
|
180
|
+
it("does not remove directories that are empty but not having a child deleted", () => {
|
|
179
181
|
// This is also false because the directory has no files in cachedFileObjects
|
|
180
182
|
expect(
|
|
181
183
|
fileCacheDeleteFilter(
|
|
182
184
|
{
|
|
183
|
-
id:
|
|
184
|
-
key:
|
|
185
|
-
filename:
|
|
185
|
+
id: "DatasetFile:abcdef",
|
|
186
|
+
key: "cdefgh",
|
|
187
|
+
filename: "sub-02:anat",
|
|
186
188
|
directory: true,
|
|
187
189
|
},
|
|
188
|
-
|
|
189
|
-
|
|
190
|
+
"sub-01:anat",
|
|
191
|
+
"",
|
|
190
192
|
[],
|
|
191
193
|
),
|
|
192
194
|
).toBe(true)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import {
|
|
3
|
-
import { MockedProvider } from
|
|
4
|
-
import DeleteDataset, { DELETE_DATASET } from
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { fireEvent, render, screen } from "@testing-library/react"
|
|
3
|
+
import { MockedProvider } from "@apollo/client/testing"
|
|
4
|
+
import DeleteDataset, { DELETE_DATASET } from "../delete.jsx"
|
|
5
5
|
|
|
6
|
-
const datasetId =
|
|
6
|
+
const datasetId = "ds999999"
|
|
7
7
|
|
|
8
8
|
const deleteDatasetMock = {
|
|
9
9
|
request: {
|
|
10
10
|
query: DELETE_DATASET,
|
|
11
11
|
variables: {
|
|
12
12
|
id: datasetId,
|
|
13
|
-
reason:
|
|
13
|
+
reason: "test suite delete",
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
newData: vi.fn(() => ({
|
|
@@ -18,8 +18,8 @@ const deleteDatasetMock = {
|
|
|
18
18
|
})),
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
describe(
|
|
22
|
-
it(
|
|
21
|
+
describe("DeleteDataset mutation", () => {
|
|
22
|
+
it("renders with common props", () => {
|
|
23
23
|
const { asFragment } = render(
|
|
24
24
|
<MockedProvider mocks={[deleteDatasetMock]} addTypename={false}>
|
|
25
25
|
<DeleteDataset datasetId="ds001" />
|