@openneuro/app 4.4.9 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/src/scripts/app.tsx +1 -1
- package/src/scripts/{refactor_2021/authentication → authentication}/__tests__/profile.spec.js +0 -0
- package/src/scripts/{refactor_2021/authentication → authentication}/admin-user.jsx +0 -0
- package/src/scripts/{refactor_2021/authentication → authentication}/logged-in.jsx +0 -0
- package/src/scripts/{refactor_2021/authentication → authentication}/logged-out.jsx +0 -0
- package/src/scripts/{refactor_2021/authentication → authentication}/loginCheck.js +0 -0
- package/src/scripts/{refactor_2021/authentication → authentication}/loginUrls.ts +1 -1
- package/src/scripts/{refactor_2021/authentication → authentication}/profile.js +0 -0
- package/src/scripts/{refactor_2021/authentication → authentication}/signOut.ts +0 -0
- package/src/scripts/{refactor_2021/authentication → authentication}/withProfile.jsx +0 -0
- package/src/scripts/{refactor_2021/common → common}/block-navigation.jsx +0 -0
- package/src/scripts/{refactor_2021 → common}/containers/footer.tsx +0 -0
- package/src/scripts/{refactor_2021 → common}/containers/header.tsx +17 -15
- package/src/scripts/{datalad/fragments → common/partials}/freshdesk-widget.jsx +1 -1
- package/src/scripts/common/partials/papaya.jsx +1 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/comments/__tests__/__snapshots__/comment.spec.jsx.snap +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/comments/__tests__/__snapshots__/comments.spec.jsx.snap +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/comments/__tests__/comment.spec.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/comments/__tests__/comments.spec.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/comments/block-style-controls.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/comments/comment-editor.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/comments/comment.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/comments/comments.jsx +1 -1
- package/src/scripts/{refactor_2021/dataset → dataset}/comments/inline-style-controls.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/comments/style-button.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/dataset-query-context.js +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/dataset-query.jsx +15 -15
- package/src/scripts/{refactor_2021/dataset → dataset}/dataset-routes.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/download/__tests__/__snapshots__/download-command-line.spec.jsx.snap +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/download/__tests__/__snapshots__/download-link.spec.jsx.snap +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/download/__tests__/__snapshots__/shell-example.spec.jsx.snap +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/download/__tests__/download-command-line.spec.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/download/__tests__/download-link.spec.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/download/__tests__/download-native.spec.js +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/download/__tests__/shell-example.spec.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/download/download-command-line.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/download/download-datalad.jsx +1 -1
- package/src/scripts/{refactor_2021/dataset → dataset}/download/download-link.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/download/download-native.js +1 -1
- package/src/scripts/{refactor_2021/dataset → dataset}/download/download-query.js +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/download/download-s3.jsx +1 -1
- package/src/scripts/{refactor_2021/dataset → dataset}/download/native-file-toast.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/download/shell-example.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/download/track-download.js +0 -0
- package/src/scripts/dataset/draft-container.tsx +420 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/draft-snapshot-routes.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/files/__tests__/__snapshots__/file-tree.spec.jsx.snap +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/files/__tests__/__snapshots__/file.spec.jsx.snap +2 -2
- package/src/scripts/{refactor_2021/dataset → dataset}/files/__tests__/file-tree-loading.spec.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/files/__tests__/file-tree-unloaded-directory.spec.jsx +1 -1
- package/src/scripts/{refactor_2021/dataset → dataset}/files/__tests__/file-tree.spec.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/files/__tests__/file-viewer-type.spec.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/files/__tests__/file.spec.jsx +11 -4
- package/src/scripts/{refactor_2021/dataset → dataset}/files/__tests__/flat-to-tree.spec.js +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/files/file-display.jsx +2 -2
- package/src/scripts/{refactor_2021/dataset → dataset}/files/file-tree-loading.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/files/file-tree-unloaded-directory.jsx +1 -1
- package/src/scripts/{refactor_2021/dataset → dataset}/files/file-tree.jsx +3 -2
- package/src/scripts/{refactor_2021/dataset → dataset}/files/file-view.jsx +1 -1
- package/src/scripts/{refactor_2021/dataset → dataset}/files/file-viewer-type.jsx +2 -0
- package/src/scripts/{refactor_2021/dataset/files/file.jsx → dataset/files/file.tsx} +30 -13
- package/src/scripts/{refactor_2021/dataset → dataset}/files/files.jsx +1 -1
- package/src/scripts/{refactor_2021/dataset → dataset}/files/flat-to-tree.js +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/files/index.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/__tests__/__snapshots__/file-viewer-json.spec.jsx.snap +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/__tests__/file-viewer-json.spec.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/__tests__/parse-tabular.spec.js +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/file-viewer-csv.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/file-viewer-html.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/file-viewer-json.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/file-viewer-nifti.jsx +1 -1
- package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/file-viewer-table.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/file-viewer-text.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/file-viewer-tsv.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/parse-tabular.js +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/__snapshots__/cancel-button.spec.tsx.snap +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/__snapshots__/edit-button.spec.tsx.snap +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/__snapshots__/edit-list.spec.jsx.snap +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/__snapshots__/save-button.spec.tsx.snap +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/__snapshots__/select-input.spec.tsx.snap +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/cancel-button.spec.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/dataset-alert-draft.spec.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/dataset-citation.spec.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/doi-link.spec.tsx +38 -8
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/edit-button.spec.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/edit-list.spec.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/save-button.spec.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/__tests__/select-input.spec.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/cancel-button.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/comments-fragments.js +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/copyable-tooltip.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/dataset-alert-draft.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/dataset-alert-version.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/dataset-citation.jsx +2 -4
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/dataset-history.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/dataset-reviewers.ts +1 -1
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/doi-link.tsx +9 -6
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/edit-button.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/edit-description-field.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/edit-description-list.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/edit-list.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/number-input.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/save-button.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/select-input.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/text-array-input.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/fragments/text-input.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/__snapshots__/delete.spec.jsx.snap +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/__snapshots__/deprecate-snapshot.spec.tsx.snap +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/__snapshots__/deprecate-version.spec.tsx.snap +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/__snapshots__/description.spec.jsx.snap +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/__snapshots__/update-permissions.spec.jsx.snap +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/cache-id.spec.js +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/delete.spec.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/deprecate-snapshot.spec.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/deprecate-version.spec.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/description.spec.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/remove-permissions.spec.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/__tests__/update-permissions.spec.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/cache-clear.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/cache-id.js +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/comment.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/create-anonymous-reviewer.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/dataset-relations.tsx +2 -3
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/delete-anonymous-reviewer.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/delete-comment.jsx +2 -4
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/delete-dataset-form.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/delete-dir.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/delete-file.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/delete.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/deprecate-version.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/description.jsx +1 -1
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/flag-annex-object.jsx +1 -2
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/follow.tsx +2 -2
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/import-dataset.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/metadata-form.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/publish.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/readme.jsx +1 -1
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/remove-annex-object.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/remove-permissions.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/revalidate.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/snapshot.tsx +1 -1
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/star.tsx +2 -2
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/submit-metadata.jsx +1 -1
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/undo-deprecate-version.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/update-file.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/update-permissions.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/mutations/update-ref.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/routes/__tests__/__snapshots__/publish.spec.jsx.snap +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/routes/__tests__/publish.spec.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/routes/add-metadata.jsx +1 -1
- package/src/scripts/{refactor_2021/dataset → dataset}/routes/admin-datalad.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/routes/admin-exports.jsx +3 -5
- package/src/scripts/{refactor_2021/dataset → dataset}/routes/delete-page.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/routes/deprecate-snapshot-page.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/routes/download-dataset.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/routes/manage-anonymous-reviewers.tsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/routes/manage-permissions.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/routes/publish.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/routes/snapshot.jsx +0 -0
- package/src/scripts/{refactor_2021/dataset → dataset}/snapshot-container.tsx +101 -115
- package/src/scripts/{refactor_2021 → errors}/freshdesk-widget.jsx +1 -1
- package/src/scripts/errors/freshdeskInterface.jsx +1 -1
- package/src/scripts/index.tsx +6 -6
- package/src/scripts/{refactor_2021 → pages}/admin/admin.jsx +1 -1
- package/src/scripts/{refactor_2021 → pages}/admin/flagged-files.jsx +0 -0
- package/src/scripts/{refactor_2021 → pages}/admin/user-fragment.ts +0 -0
- package/src/scripts/{refactor_2021 → pages}/admin/user-tools.tsx +1 -1
- package/src/scripts/{refactor_2021 → pages}/admin/users.jsx +0 -0
- package/src/scripts/{refactor_2021/user → pages}/api.jsx +2 -2
- package/src/scripts/pages/citation-page.tsx +1 -1
- package/src/scripts/{faq → pages/faq}/__tests__/__snapshots__/faq.spec.jsx.snap +1 -1
- package/src/scripts/{faq → pages/faq}/__tests__/faq.spec.jsx +0 -0
- package/src/scripts/{faq → pages/faq}/faq-content.js +3 -5
- package/src/scripts/{faq → pages/faq}/faq.jsx +1 -1
- package/src/scripts/{refactor_2021 → pages/front-page}/aggregate-queries/aggregate-counts-container.tsx +0 -0
- package/src/scripts/{refactor_2021 → pages/front-page}/aggregate-queries/use-participant-count.ts +0 -0
- package/src/scripts/{refactor_2021 → pages/front-page}/aggregate-queries/use-publicDatasets-count.ts +0 -0
- package/src/scripts/{front-page → pages/front-page}/front-page-content.ts +10 -10
- package/src/scripts/{refactor_2021/containers/front-page-container.tsx → pages/front-page/front-page.tsx} +53 -32
- package/src/scripts/pages/front-page-comp.tsx +57 -0
- package/src/scripts/pages/import-dataset.tsx +5 -5
- package/src/scripts/{pet/redirect.tsx → pages/pet-redirect.tsx} +0 -0
- package/src/scripts/{refactor_2021/routes.tsx → routes.tsx} +8 -8
- package/src/scripts/{refactor_2021/search → search}/__tests__/search-container.spec.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/__tests__/search-params-ctx.spec.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/es-query-builders.ts +0 -0
- package/src/scripts/{refactor_2021/search → search}/filters-block-container.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/initial-search-params.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/inputs/__tests__/sort-by-select.spec.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/inputs/admin-allDatasets-toggle.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/inputs/age-range-input.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/inputs/author-input.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/inputs/date-radios.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/inputs/diagnosis-select.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/inputs/index.ts +0 -0
- package/src/scripts/{refactor_2021/search → search}/inputs/keyword-input.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/inputs/modality-select.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/inputs/pet/bodyParts_input.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/inputs/pet/scannerManufacturersModelNames_input.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/inputs/pet/scannerManufacturers_input.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/inputs/pet/tracerNames_input.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/inputs/pet/tracerRadionuclides_input.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/inputs/section-select.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/inputs/sex-radios.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/inputs/show-datasets-radios.tsx +2 -4
- package/src/scripts/{refactor_2021/search → search}/inputs/sort-by-select.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/inputs/species-select.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/inputs/study-domain-input.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/inputs/subject-count-range-input.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/inputs/task-input.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/search-container.tsx +1 -1
- package/src/scripts/{refactor_2021/search → search}/search-params-ctx.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/search-routes.tsx +0 -0
- package/src/scripts/{refactor_2021/search → search}/use-search-results.tsx +0 -0
- package/src/scripts/test-utils.js +1 -1
- package/src/scripts/{refactor_2021/uploader → uploader}/add-path-to-files.js +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/file-select.tsx +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/file-upload.js +1 -1
- package/src/scripts/{refactor_2021/uploader → uploader}/input.jsx +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/upload-button.jsx +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/upload-disclaimer-input.tsx +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/upload-disclaimer.jsx +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/upload-file-status.jsx +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/upload-issues.jsx +2 -1
- package/src/scripts/{refactor_2021/uploader → uploader}/upload-metadata.jsx +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/upload-mutation.js +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/upload-progress-button.jsx +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/upload-progress-class.js +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/upload-progress.jsx +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/upload-rename.jsx +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/upload-resume.jsx +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/upload-select.jsx +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/upload-status.jsx +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/upload-step.jsx +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/uploader-context.js +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/uploader-location.js +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/uploader-modal.jsx +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/uploader-setup-routes.jsx +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/uploader-status-routes.jsx +0 -0
- package/src/scripts/{refactor_2021/uploader → uploader}/uploader-view.jsx +1 -1
- package/src/scripts/{refactor_2021/uploader → uploader}/uploader.jsx +1 -1
- package/src/scripts/{refactor_2021/utils → utils}/cookies.js +0 -0
- package/src/scripts/{refactor_2021 → utils}/user-login-modal-ctx.tsx +1 -2
- package/src/scripts/{refactor_2021/validation → validation}/validation-panel.jsx +0 -0
- package/src/scripts/{refactor_2021/validation → validation}/validation-results.issues.issue.jsx +0 -0
- package/src/scripts/{refactor_2021/validation → validation}/validation-results.issues.jsx +0 -0
- package/src/scripts/{refactor_2021/validation → validation}/validation-results.jsx +0 -0
- package/src/scripts/{refactor_2021/validation → validation}/validation-status.jsx +0 -0
- package/src/scripts/{refactor_2021/validation → validation}/validation.jsx +1 -1
- package/src/scripts/front-page/assets/get_data_browse.png +0 -0
- package/src/scripts/front-page/assets/get_data_download.png +0 -0
- package/src/scripts/front-page/assets/ljaf.png +0 -0
- package/src/scripts/front-page/assets/logo_app.png +0 -0
- package/src/scripts/front-page/assets/logo_cube.png +0 -0
- package/src/scripts/front-page/assets/logo_data.png +0 -0
- package/src/scripts/front-page/assets/logo_users.png +0 -0
- package/src/scripts/front-page/assets/nih.png +0 -0
- package/src/scripts/front-page/assets/nsf.png +0 -0
- package/src/scripts/front-page/assets/share_data_collaborate.png +0 -0
- package/src/scripts/front-page/assets/share_data_publish.png +0 -0
- package/src/scripts/front-page/assets/share_data_validate.png +0 -0
- package/src/scripts/front-page/assets/squishymedia.png +0 -0
- package/src/scripts/front-page/assets/stanford.png +0 -0
- package/src/scripts/front-page/assets/tab-get_data.png +0 -0
- package/src/scripts/front-page/assets/tab-share_data.png +0 -0
- package/src/scripts/front-page/assets/tab-use_data.png +0 -0
- package/src/scripts/front-page/assets/use_data_analyze.png +0 -0
- package/src/scripts/front-page/assets/use_data_snapshot.png +0 -0
- package/src/scripts/mobile/collapsible-wrapper.tsx +0 -93
- package/src/scripts/refactor_2021/common/partials/toast-content.jsx +0 -18
- package/src/scripts/refactor_2021/dataset/draft-container.tsx +0 -435
- package/src/scripts/refactor_2021/utils/datalad.js +0 -13
- package/src/scripts/refactor_2021/utils/gtag.js +0 -22
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Markdown from 'markdown-to-jsx'
|
|
3
|
+
import { useLocation, Redirect } from 'react-router-dom'
|
|
4
|
+
import pluralize from 'pluralize'
|
|
5
|
+
import formatDistanceToNow from 'date-fns/formatDistanceToNow'
|
|
6
|
+
import parseISO from 'date-fns/parseISO'
|
|
7
|
+
|
|
8
|
+
import Validation from '../validation/validation.jsx'
|
|
9
|
+
import Files from './files'
|
|
10
|
+
import { config } from '../config'
|
|
11
|
+
import {
|
|
12
|
+
getUnexpiredProfile,
|
|
13
|
+
hasEditPermissions,
|
|
14
|
+
hasDatasetAdminPermissions,
|
|
15
|
+
} from '../authentication/profile'
|
|
16
|
+
import { useCookies } from 'react-cookie'
|
|
17
|
+
import Comments from './comments/comments.jsx'
|
|
18
|
+
import { DatasetAlertDraft } from './fragments/dataset-alert-draft'
|
|
19
|
+
import {
|
|
20
|
+
MetaDataBlock,
|
|
21
|
+
ModalitiesMetaDataBlock,
|
|
22
|
+
BrainLifeButton,
|
|
23
|
+
ValidationBlock,
|
|
24
|
+
CloneDropdown,
|
|
25
|
+
DatasetHeader,
|
|
26
|
+
DatasetHeaderMeta,
|
|
27
|
+
DatasetGitAccess,
|
|
28
|
+
VersionList,
|
|
29
|
+
DatasetTools,
|
|
30
|
+
} from '@openneuro/components/dataset'
|
|
31
|
+
import { ReadMore } from '@openneuro/components/read-more'
|
|
32
|
+
|
|
33
|
+
import { FollowDataset } from './mutations/follow'
|
|
34
|
+
import { StarDataset } from './mutations/star'
|
|
35
|
+
|
|
36
|
+
import EditDescriptionField from './fragments/edit-description-field.jsx'
|
|
37
|
+
import EditDescriptionList from './fragments/edit-description-list.jsx'
|
|
38
|
+
import { DOILink } from './fragments/doi-link'
|
|
39
|
+
|
|
40
|
+
export interface DraftContainerProps {
|
|
41
|
+
dataset
|
|
42
|
+
tag?: string
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const formatDate = dateObject =>
|
|
46
|
+
new Date(dateObject).toISOString().split('T')[0]
|
|
47
|
+
|
|
48
|
+
// Helper function for getting version from URL
|
|
49
|
+
const snapshotVersion = location => {
|
|
50
|
+
const matches = location.pathname.match(/versions\/(.*?)(\/|$)/)
|
|
51
|
+
return matches && matches[1]
|
|
52
|
+
}
|
|
53
|
+
const DraftContainer: React.FC<DraftContainerProps> = ({ dataset }) => {
|
|
54
|
+
const location = useLocation()
|
|
55
|
+
const activeDataset = snapshotVersion(location) || 'draft'
|
|
56
|
+
|
|
57
|
+
const [selectedVersion, setSelectedVersion] = React.useState(activeDataset)
|
|
58
|
+
|
|
59
|
+
const summary = dataset.draft.summary
|
|
60
|
+
const description = dataset.draft.description
|
|
61
|
+
const datasetId = dataset.id
|
|
62
|
+
|
|
63
|
+
const numSessions =
|
|
64
|
+
summary && summary.sessions.length > 0 ? summary.sessions.length : 1
|
|
65
|
+
|
|
66
|
+
const dateAdded = formatDate(dataset.created)
|
|
67
|
+
const dateAddedDifference = formatDistanceToNow(parseISO(dataset.created))
|
|
68
|
+
const dateModified = formatDate(dataset.draft.modified)
|
|
69
|
+
const dateUpdatedDifference = formatDistanceToNow(
|
|
70
|
+
parseISO(dataset.draft.modified),
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
const [cookies] = useCookies()
|
|
74
|
+
const profile = getUnexpiredProfile(cookies)
|
|
75
|
+
const isAdmin = profile?.admin
|
|
76
|
+
const hasEdit =
|
|
77
|
+
hasEditPermissions(dataset.permissions, profile?.sub) || isAdmin
|
|
78
|
+
const hasDraftChanges =
|
|
79
|
+
dataset.snapshots.length === 0 ||
|
|
80
|
+
dataset.draft.head !==
|
|
81
|
+
dataset.snapshots[dataset.snapshots.length - 1].hexsha
|
|
82
|
+
const isDatasetAdmin =
|
|
83
|
+
hasDatasetAdminPermissions(dataset.permissions, profile?.sub) || isAdmin
|
|
84
|
+
const modality: string = summary?.modalities[0] || ''
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<>
|
|
88
|
+
{dataset.snapshots && !hasEdit && (
|
|
89
|
+
<Redirect
|
|
90
|
+
to={`/datasets/${dataset.id}/versions/${
|
|
91
|
+
dataset.snapshots.length &&
|
|
92
|
+
dataset.snapshots[dataset.snapshots.length - 1].tag
|
|
93
|
+
}`}
|
|
94
|
+
/>
|
|
95
|
+
)}
|
|
96
|
+
<div
|
|
97
|
+
className={`dataset dataset-draft dataset-page dataset-page-${modality?.toLowerCase()}`}>
|
|
98
|
+
<DatasetHeader
|
|
99
|
+
pageHeading={description.Name}
|
|
100
|
+
modality={modality}
|
|
101
|
+
renderEditor={() => (
|
|
102
|
+
<EditDescriptionField
|
|
103
|
+
datasetId={datasetId}
|
|
104
|
+
field="Name"
|
|
105
|
+
rows={2}
|
|
106
|
+
description={description.Name}
|
|
107
|
+
editMode={hasEdit}>
|
|
108
|
+
{description.Name}
|
|
109
|
+
</EditDescriptionField>
|
|
110
|
+
)}
|
|
111
|
+
/>
|
|
112
|
+
<DatasetAlertDraft
|
|
113
|
+
isPrivate={!dataset.public}
|
|
114
|
+
datasetId={dataset.id}
|
|
115
|
+
hasDraftChanges={hasDraftChanges}
|
|
116
|
+
hasSnapshot={dataset.snapshots.length !== 0}
|
|
117
|
+
/>
|
|
118
|
+
<div className="container">
|
|
119
|
+
<div className="grid grid-between dataset-header-meta">
|
|
120
|
+
<div className="col col-8 col-lg">
|
|
121
|
+
{summary && (
|
|
122
|
+
<DatasetHeaderMeta
|
|
123
|
+
size={summary.size}
|
|
124
|
+
totalFiles={summary.totalFiles}
|
|
125
|
+
datasetId={datasetId}
|
|
126
|
+
/>
|
|
127
|
+
)}
|
|
128
|
+
</div>
|
|
129
|
+
<div className="col follow-bookmark">
|
|
130
|
+
<FollowDataset
|
|
131
|
+
profile={profile}
|
|
132
|
+
datasetId={dataset.id}
|
|
133
|
+
following={dataset.following}
|
|
134
|
+
followers={dataset.followers.length}
|
|
135
|
+
/>
|
|
136
|
+
<StarDataset
|
|
137
|
+
profile={profile}
|
|
138
|
+
datasetId={dataset.id}
|
|
139
|
+
starred={dataset.starred}
|
|
140
|
+
stars={dataset.stars.length}
|
|
141
|
+
/>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
<div className="container">
|
|
146
|
+
<div className="grid grid-between">
|
|
147
|
+
<div className="col col-lg col-8">
|
|
148
|
+
<div className="dataset-validation">
|
|
149
|
+
<ValidationBlock>
|
|
150
|
+
<Validation
|
|
151
|
+
datasetId={dataset.id}
|
|
152
|
+
issues={dataset.draft.issues}
|
|
153
|
+
/>
|
|
154
|
+
</ValidationBlock>
|
|
155
|
+
<BrainLifeButton
|
|
156
|
+
datasetId={datasetId}
|
|
157
|
+
onBrainlife={dataset.onBrainlife}
|
|
158
|
+
/>
|
|
159
|
+
<CloneDropdown
|
|
160
|
+
gitAccess={
|
|
161
|
+
<DatasetGitAccess
|
|
162
|
+
hasEdit={hasEdit}
|
|
163
|
+
configGithub={config.github}
|
|
164
|
+
configUrl={config.url}
|
|
165
|
+
worker={dataset.worker}
|
|
166
|
+
datasetId={datasetId}
|
|
167
|
+
gitHash={dataset.draft.head}
|
|
168
|
+
/>
|
|
169
|
+
}
|
|
170
|
+
/>
|
|
171
|
+
</div>
|
|
172
|
+
<div className="dataset-tool-buttons">
|
|
173
|
+
<DatasetTools
|
|
174
|
+
hasEdit={hasEdit}
|
|
175
|
+
isPublic={dataset.public}
|
|
176
|
+
datasetId={datasetId}
|
|
177
|
+
isAdmin={isAdmin}
|
|
178
|
+
hasSnapshot={dataset.snapshots.length !== 0}
|
|
179
|
+
isDatasetAdmin={isDatasetAdmin}
|
|
180
|
+
/>
|
|
181
|
+
</div>
|
|
182
|
+
<ReadMore
|
|
183
|
+
fileTree={true}
|
|
184
|
+
id="collapse-tree"
|
|
185
|
+
expandLabel="Expand File Tree"
|
|
186
|
+
collapseLabel="Collapse File Tree">
|
|
187
|
+
<Files
|
|
188
|
+
datasetId={datasetId}
|
|
189
|
+
snapshotTag={null}
|
|
190
|
+
datasetName={dataset.draft.description.Name}
|
|
191
|
+
files={dataset.draft.files}
|
|
192
|
+
editMode={hasEdit}
|
|
193
|
+
datasetPermissions={dataset.permissions}
|
|
194
|
+
/>
|
|
195
|
+
</ReadMore>
|
|
196
|
+
<MetaDataBlock
|
|
197
|
+
heading="README"
|
|
198
|
+
className="dataset-readme markdown-body"
|
|
199
|
+
item={dataset.draft.readme}
|
|
200
|
+
renderEditor={() => (
|
|
201
|
+
<EditDescriptionField
|
|
202
|
+
datasetId={datasetId}
|
|
203
|
+
field="readme"
|
|
204
|
+
rows={12}
|
|
205
|
+
description={dataset.draft.readme}
|
|
206
|
+
editMode={hasEdit}>
|
|
207
|
+
<ReadMore
|
|
208
|
+
id="readme"
|
|
209
|
+
expandLabel="Read More"
|
|
210
|
+
collapseLabel="Collapse">
|
|
211
|
+
<Markdown>{dataset.draft.readme || 'N/A'}</Markdown>
|
|
212
|
+
</ReadMore>
|
|
213
|
+
</EditDescriptionField>
|
|
214
|
+
)}
|
|
215
|
+
/>
|
|
216
|
+
<Comments
|
|
217
|
+
datasetId={dataset.id}
|
|
218
|
+
uploader={dataset.uploader}
|
|
219
|
+
comments={dataset.comments}
|
|
220
|
+
/>
|
|
221
|
+
</div>
|
|
222
|
+
<div className="col sidebar">
|
|
223
|
+
{' '}
|
|
224
|
+
<EditDescriptionList
|
|
225
|
+
className="dmb-inline-list"
|
|
226
|
+
datasetId={datasetId}
|
|
227
|
+
field="Authors"
|
|
228
|
+
heading="Authors"
|
|
229
|
+
description={description.Authors}
|
|
230
|
+
editMode={hasEdit}>
|
|
231
|
+
{description?.Authors?.length ? description.Authors : ['N/A']}
|
|
232
|
+
</EditDescriptionList>
|
|
233
|
+
{summary && (
|
|
234
|
+
<ModalitiesMetaDataBlock
|
|
235
|
+
items={summary.modalities}
|
|
236
|
+
className="dmb-modalities"
|
|
237
|
+
/>
|
|
238
|
+
)}
|
|
239
|
+
<MetaDataBlock
|
|
240
|
+
heading={dataset.snapshots.length ? 'Versions' : 'Version'}
|
|
241
|
+
item={
|
|
242
|
+
<div className="version-block">
|
|
243
|
+
<VersionList
|
|
244
|
+
datasetId={datasetId}
|
|
245
|
+
hasEdit={hasEdit}
|
|
246
|
+
items={dataset.snapshots}
|
|
247
|
+
className="version-dropdown"
|
|
248
|
+
activeDataset={activeDataset}
|
|
249
|
+
dateModified={dateModified}
|
|
250
|
+
selected={selectedVersion}
|
|
251
|
+
setSelected={setSelectedVersion}
|
|
252
|
+
/>
|
|
253
|
+
</div>
|
|
254
|
+
}
|
|
255
|
+
/>
|
|
256
|
+
{summary && (
|
|
257
|
+
<MetaDataBlock
|
|
258
|
+
heading="Tasks"
|
|
259
|
+
item={summary.tasks.length ? summary.tasks.join(', ') : 'N/A'}
|
|
260
|
+
className="dmb-inline-list"
|
|
261
|
+
/>
|
|
262
|
+
)}
|
|
263
|
+
{summary?.modalities.includes('pet') ||
|
|
264
|
+
summary?.modalities.includes('Pet') ||
|
|
265
|
+
(summary?.modalities.includes('PET') && (
|
|
266
|
+
<>
|
|
267
|
+
<MetaDataBlock
|
|
268
|
+
heading={pluralize('Target', summary.pet?.BodyPart)}
|
|
269
|
+
item={summary.pet?.BodyPart}
|
|
270
|
+
/>
|
|
271
|
+
<MetaDataBlock
|
|
272
|
+
heading={pluralize(
|
|
273
|
+
'Scanner Manufacturer',
|
|
274
|
+
summary.pet?.ScannerManufacturer,
|
|
275
|
+
)}
|
|
276
|
+
item={
|
|
277
|
+
summary.pet?.ScannerManufacturer
|
|
278
|
+
? summary.pet?.ScannerManufacturer
|
|
279
|
+
: 'N/A'
|
|
280
|
+
}
|
|
281
|
+
/>
|
|
282
|
+
|
|
283
|
+
<MetaDataBlock
|
|
284
|
+
heading={pluralize(
|
|
285
|
+
'Scanner Model',
|
|
286
|
+
summary.pet?.ScannerManufacturersModelName,
|
|
287
|
+
)}
|
|
288
|
+
item={
|
|
289
|
+
summary.pet?.ScannerManufacturersModelName
|
|
290
|
+
? summary.pet?.ScannerManufacturersModelName
|
|
291
|
+
: 'N/A'
|
|
292
|
+
}
|
|
293
|
+
/>
|
|
294
|
+
<MetaDataBlock
|
|
295
|
+
heading={pluralize(
|
|
296
|
+
'Radionuclide',
|
|
297
|
+
summary.pet?.TracerRadionuclide,
|
|
298
|
+
)}
|
|
299
|
+
item={
|
|
300
|
+
summary.pet?.TracerRadionuclide
|
|
301
|
+
? summary.pet?.TracerRadionuclide
|
|
302
|
+
: 'N/A'
|
|
303
|
+
}
|
|
304
|
+
/>
|
|
305
|
+
<MetaDataBlock
|
|
306
|
+
heading={pluralize(
|
|
307
|
+
'Radiotracer',
|
|
308
|
+
summary.pet?.TracerName,
|
|
309
|
+
)}
|
|
310
|
+
item={
|
|
311
|
+
summary.pet?.TracerName
|
|
312
|
+
? summary.pet?.TracerName
|
|
313
|
+
: 'N/A'
|
|
314
|
+
}
|
|
315
|
+
/>
|
|
316
|
+
</>
|
|
317
|
+
))}
|
|
318
|
+
<MetaDataBlock
|
|
319
|
+
heading="Uploaded by"
|
|
320
|
+
item={
|
|
321
|
+
<>
|
|
322
|
+
{dataset.uploader.name} on {dateAdded} -{' '}
|
|
323
|
+
{dateAddedDifference} ago
|
|
324
|
+
</>
|
|
325
|
+
}
|
|
326
|
+
/>
|
|
327
|
+
{dataset.snapshots?.length ? (
|
|
328
|
+
<MetaDataBlock
|
|
329
|
+
heading="Last Updated"
|
|
330
|
+
item={
|
|
331
|
+
<>
|
|
332
|
+
{dateModified} - {dateUpdatedDifference} ago
|
|
333
|
+
</>
|
|
334
|
+
}
|
|
335
|
+
/>
|
|
336
|
+
) : null}
|
|
337
|
+
<MetaDataBlock heading="Sessions" item={numSessions} />
|
|
338
|
+
<>
|
|
339
|
+
{summary && (
|
|
340
|
+
<MetaDataBlock
|
|
341
|
+
heading="Participants"
|
|
342
|
+
item={summary.subjects.length}
|
|
343
|
+
/>
|
|
344
|
+
)}
|
|
345
|
+
</>
|
|
346
|
+
<MetaDataBlock
|
|
347
|
+
heading="Dataset DOI"
|
|
348
|
+
item={
|
|
349
|
+
<DOILink DOI={description.DatasetDOI} datasetId={datasetId} />
|
|
350
|
+
}
|
|
351
|
+
/>
|
|
352
|
+
<MetaDataBlock heading="License" item={description.License} />
|
|
353
|
+
<MetaDataBlock
|
|
354
|
+
heading="Acknowledgements"
|
|
355
|
+
item={description.Acknowledgements}
|
|
356
|
+
renderEditor={() => (
|
|
357
|
+
<EditDescriptionField
|
|
358
|
+
datasetId={datasetId}
|
|
359
|
+
field="Acknowledgements"
|
|
360
|
+
rows={2}
|
|
361
|
+
description={description.Acknowledgements}
|
|
362
|
+
editMode={hasEdit}>
|
|
363
|
+
<Markdown>{description.Acknowledgements || 'N/A'}</Markdown>
|
|
364
|
+
</EditDescriptionField>
|
|
365
|
+
)}
|
|
366
|
+
/>
|
|
367
|
+
<MetaDataBlock
|
|
368
|
+
heading="How to Acknowledge"
|
|
369
|
+
item={description.HowToAcknowledge}
|
|
370
|
+
renderEditor={() => (
|
|
371
|
+
<EditDescriptionField
|
|
372
|
+
datasetId={datasetId}
|
|
373
|
+
field="HowToAcknowledge"
|
|
374
|
+
rows={2}
|
|
375
|
+
description={description.HowToAcknowledge}
|
|
376
|
+
editMode={hasEdit}>
|
|
377
|
+
<Markdown>{description.HowToAcknowledge || 'N/A'}</Markdown>
|
|
378
|
+
</EditDescriptionField>
|
|
379
|
+
)}
|
|
380
|
+
/>
|
|
381
|
+
<EditDescriptionList
|
|
382
|
+
className="dmb-list"
|
|
383
|
+
datasetId={datasetId}
|
|
384
|
+
field="Funding"
|
|
385
|
+
heading="Funding"
|
|
386
|
+
description={description.Funding}
|
|
387
|
+
editMode={hasEdit}>
|
|
388
|
+
{description.Funding?.length ? description.Funding : ['N/A']}
|
|
389
|
+
</EditDescriptionList>
|
|
390
|
+
<EditDescriptionList
|
|
391
|
+
className="dmb-list"
|
|
392
|
+
datasetId={datasetId}
|
|
393
|
+
field="ReferencesAndLinks"
|
|
394
|
+
heading="References and Links"
|
|
395
|
+
description={description.ReferencesAndLinks}
|
|
396
|
+
editMode={hasEdit}>
|
|
397
|
+
{description.ReferencesAndLinks?.length
|
|
398
|
+
? description.ReferencesAndLinks
|
|
399
|
+
: ['N/A']}
|
|
400
|
+
</EditDescriptionList>
|
|
401
|
+
<EditDescriptionList
|
|
402
|
+
className="dmb-list"
|
|
403
|
+
datasetId={datasetId}
|
|
404
|
+
field="EthicsApprovals"
|
|
405
|
+
heading="Ethics Approvals"
|
|
406
|
+
description={description.EthicsApprovals}
|
|
407
|
+
editMode={hasEdit}>
|
|
408
|
+
{description.EthicsApprovals?.length
|
|
409
|
+
? description.EthicsApprovals
|
|
410
|
+
: ['N/A']}
|
|
411
|
+
</EditDescriptionList>
|
|
412
|
+
</div>
|
|
413
|
+
</div>
|
|
414
|
+
</div>
|
|
415
|
+
</div>
|
|
416
|
+
</>
|
|
417
|
+
)
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
export default DraftContainer
|
|
File without changes
|
|
File without changes
|
|
@@ -22,7 +22,7 @@ exports[`File component renders for dataset snapshots 1`] = `
|
|
|
22
22
|
<span
|
|
23
23
|
class=" "
|
|
24
24
|
data-flow="up"
|
|
25
|
-
data-tooltip="Download"
|
|
25
|
+
data-tooltip="Download: 500B"
|
|
26
26
|
>
|
|
27
27
|
<span
|
|
28
28
|
class="edit-file download-file"
|
|
@@ -83,7 +83,7 @@ exports[`File component renders with common props 1`] = `
|
|
|
83
83
|
<span
|
|
84
84
|
class=" "
|
|
85
85
|
data-flow="up"
|
|
86
|
-
data-tooltip="Download"
|
|
86
|
+
data-tooltip="Download: 500B"
|
|
87
87
|
>
|
|
88
88
|
<span
|
|
89
89
|
class="edit-file download-file"
|
package/src/scripts/{refactor_2021/dataset → dataset}/files/__tests__/file-tree-loading.spec.jsx
RENAMED
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { render, screen, fireEvent } from '@testing-library/react'
|
|
3
|
-
import DatasetQueryContext from '
|
|
3
|
+
import DatasetQueryContext from '../../../datalad/dataset/dataset-query-context.js'
|
|
4
4
|
import FileTreeUnloadedDirectory, {
|
|
5
5
|
mergeNewFiles,
|
|
6
6
|
} from '../file-tree-unloaded-directory.jsx'
|
|
File without changes
|
package/src/scripts/{refactor_2021/dataset → dataset}/files/__tests__/file-viewer-type.spec.jsx
RENAMED
|
File without changes
|
|
@@ -1,25 +1,31 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { render, screen } from '@testing-library/react'
|
|
3
3
|
import { MemoryRouter } from 'react-router-dom'
|
|
4
|
-
import File from '../file
|
|
4
|
+
import File from '../file'
|
|
5
5
|
|
|
6
6
|
describe('File component', () => {
|
|
7
7
|
it('renders with common props', () => {
|
|
8
8
|
const { asFragment } = render(
|
|
9
|
-
<File datasetId="ds001" path="" filename="README" />,
|
|
9
|
+
<File datasetId="ds001" path="" filename="README" size={500} />,
|
|
10
10
|
{ wrapper: MemoryRouter },
|
|
11
11
|
)
|
|
12
12
|
expect(asFragment()).toMatchSnapshot()
|
|
13
13
|
})
|
|
14
14
|
it('renders for dataset snapshots', () => {
|
|
15
15
|
const { asFragment } = render(
|
|
16
|
-
<File
|
|
16
|
+
<File
|
|
17
|
+
datasetId="ds001"
|
|
18
|
+
snapshotTag="1.0.0"
|
|
19
|
+
path=""
|
|
20
|
+
filename="README"
|
|
21
|
+
size={500}
|
|
22
|
+
/>,
|
|
17
23
|
{ wrapper: MemoryRouter },
|
|
18
24
|
)
|
|
19
25
|
expect(asFragment()).toMatchSnapshot()
|
|
20
26
|
})
|
|
21
27
|
it('generates correct download links for top level files', () => {
|
|
22
|
-
render(<File datasetId="ds001" path="" filename="README" />, {
|
|
28
|
+
render(<File datasetId="ds001" path="" filename="README" size={500} />, {
|
|
23
29
|
wrapper: MemoryRouter,
|
|
24
30
|
})
|
|
25
31
|
expect(screen.getByRole('link', { name: 'download file' })).toHaveAttribute(
|
|
@@ -33,6 +39,7 @@ describe('File component', () => {
|
|
|
33
39
|
datasetId="ds001"
|
|
34
40
|
path="sub-01:anat"
|
|
35
41
|
filename="sub-01_T1w.nii.gz"
|
|
42
|
+
size={2000000}
|
|
36
43
|
/>,
|
|
37
44
|
{ wrapper: MemoryRouter },
|
|
38
45
|
)
|
|
File without changes
|
|
@@ -2,9 +2,9 @@ import React from 'react'
|
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import { Link } from 'react-router-dom'
|
|
4
4
|
import FileView from './file-view.jsx'
|
|
5
|
-
import { apiPath } from './file
|
|
5
|
+
import { apiPath } from './file'
|
|
6
6
|
import styled from '@emotion/styled'
|
|
7
|
-
import { Media } from '
|
|
7
|
+
import { Media } from '../../styles/media'
|
|
8
8
|
|
|
9
9
|
const PathBreadcrumb = styled.div`
|
|
10
10
|
font-size: 14px;
|
|
File without changes
|
package/src/scripts/{refactor_2021/dataset → dataset}/files/file-tree-unloaded-directory.jsx
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useContext, useEffect } from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import DatasetQueryContext from '
|
|
3
|
+
import DatasetQueryContext from '../../datalad/dataset/dataset-query-context.js'
|
|
4
4
|
import FileTreeLoading from './file-tree-loading.jsx'
|
|
5
5
|
import { gql } from '@apollo/client'
|
|
6
6
|
import { AccordionTab } from '@openneuro/components/accordion'
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import File from './file
|
|
3
|
+
import File from './file'
|
|
4
4
|
import UpdateFile from '../mutations/update-file.jsx'
|
|
5
5
|
import DeleteDir from '../mutations/delete-dir.jsx'
|
|
6
6
|
import FileTreeUnloadedDirectory from './file-tree-unloaded-directory.jsx'
|
|
7
|
-
import { Media } from '
|
|
7
|
+
import { Media } from '../../styles/media'
|
|
8
8
|
import { AccordionTab } from '@openneuro/components/accordion'
|
|
9
9
|
|
|
10
10
|
export const sortByFilename = (a, b) => a.filename.localeCompare(b.filename)
|
|
@@ -66,6 +66,7 @@ const FileTree = ({
|
|
|
66
66
|
datasetId={datasetId}
|
|
67
67
|
snapshotTag={snapshotTag}
|
|
68
68
|
path={path}
|
|
69
|
+
size={file.size}
|
|
69
70
|
editMode={editMode}
|
|
70
71
|
toggleFileToDelete={toggleFileToDelete}
|
|
71
72
|
isFileToBeDeleted={isFileToBeDeleted}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import { Loading } from '@openneuro/components/loading'
|
|
3
|
-
import { apiPath } from './file
|
|
3
|
+
import { apiPath } from './file'
|
|
4
4
|
import FileViewerType from './file-viewer-type.jsx'
|
|
5
5
|
|
|
6
6
|
const FileView = ({ datasetId, snapshotTag, path }) => {
|
|
@@ -14,6 +14,8 @@ const FileViewerType = ({ path, url, data }) => {
|
|
|
14
14
|
if (
|
|
15
15
|
path.endsWith('README') ||
|
|
16
16
|
path.endsWith('CHANGES') ||
|
|
17
|
+
path.endsWith('.bidsignore') ||
|
|
18
|
+
path.endsWith('.gitignore') ||
|
|
17
19
|
path.endsWith('.txt')
|
|
18
20
|
) {
|
|
19
21
|
return <FileViewerText data={data} />
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import
|
|
2
|
+
import bytes from 'bytes'
|
|
3
3
|
import { Link } from 'react-router-dom'
|
|
4
4
|
import UpdateFile from '../mutations/update-file.jsx'
|
|
5
5
|
import DeleteFile from '../mutations/delete-file.jsx'
|
|
6
|
-
import { Media } from '
|
|
6
|
+
import { Media } from '../../styles/media'
|
|
7
7
|
import RemoveAnnexObject from '../mutations/remove-annex-object.jsx'
|
|
8
8
|
import FlagAnnexObject from '../mutations/flag-annex-object.jsx'
|
|
9
9
|
import { isAdmin } from '../../authentication/admin-user.jsx'
|
|
@@ -79,8 +79,33 @@ export const apiPath = (datasetId, snapshotTag, filePath) => {
|
|
|
79
79
|
return `/crn/datasets/${datasetId}${snapshotPath}/files/${filePath}`
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
interface FileProps {
|
|
83
|
+
id: string
|
|
84
|
+
size: number
|
|
85
|
+
datasetId: string
|
|
86
|
+
path: string
|
|
87
|
+
filename: string
|
|
88
|
+
snapshotTag: string
|
|
89
|
+
editMode: boolean
|
|
90
|
+
isMobile: boolean
|
|
91
|
+
annexed: boolean
|
|
92
|
+
annexKey: string
|
|
93
|
+
datasetPermissions: string[]
|
|
94
|
+
toggleFileToDelete: ({
|
|
95
|
+
id,
|
|
96
|
+
path,
|
|
97
|
+
filename,
|
|
98
|
+
}: {
|
|
99
|
+
id: string
|
|
100
|
+
path: string
|
|
101
|
+
filename: string
|
|
102
|
+
}) => boolean
|
|
103
|
+
isFileToBeDeleted: (id: string) => boolean
|
|
104
|
+
}
|
|
105
|
+
|
|
82
106
|
const File = ({
|
|
83
107
|
id,
|
|
108
|
+
size,
|
|
84
109
|
datasetId,
|
|
85
110
|
path,
|
|
86
111
|
filename,
|
|
@@ -92,7 +117,7 @@ const File = ({
|
|
|
92
117
|
datasetPermissions,
|
|
93
118
|
toggleFileToDelete,
|
|
94
119
|
isFileToBeDeleted,
|
|
95
|
-
}) => {
|
|
120
|
+
}: FileProps) => {
|
|
96
121
|
const { icon, color } = getFileIcon(filename)
|
|
97
122
|
const snapshotVersionPath = snapshotTag ? `/versions/${snapshotTag}` : ''
|
|
98
123
|
// React route to display the file
|
|
@@ -109,7 +134,7 @@ const File = ({
|
|
|
109
134
|
{filename}
|
|
110
135
|
<span className="filetree-editfile">
|
|
111
136
|
<Media greaterThanOrEqual="medium">
|
|
112
|
-
<Tooltip tooltip=
|
|
137
|
+
<Tooltip tooltip={`Download: ${bytes.format(size) as string}`}>
|
|
113
138
|
<span className="edit-file download-file">
|
|
114
139
|
<a
|
|
115
140
|
href={apiPath(datasetId, snapshotTag, filePath(path, filename))}
|
|
@@ -131,7 +156,7 @@ const File = ({
|
|
|
131
156
|
<Media greaterThanOrEqual="medium">
|
|
132
157
|
<Tooltip tooltip="Update">
|
|
133
158
|
<UpdateFile datasetId={datasetId} path={path}>
|
|
134
|
-
<i className="fa fa-
|
|
159
|
+
<i className="fa fa-cloud-upload" />
|
|
135
160
|
</UpdateFile>
|
|
136
161
|
</Tooltip>
|
|
137
162
|
</Media>
|
|
@@ -205,12 +230,4 @@ const File = ({
|
|
|
205
230
|
)
|
|
206
231
|
}
|
|
207
232
|
|
|
208
|
-
File.propTypes = {
|
|
209
|
-
datasetId: PropTypes.string,
|
|
210
|
-
path: PropTypes.string,
|
|
211
|
-
filename: PropTypes.string,
|
|
212
|
-
snapshotTag: PropTypes.string,
|
|
213
|
-
editMode: PropTypes.bool,
|
|
214
|
-
}
|
|
215
|
-
|
|
216
233
|
export default File
|
|
@@ -2,7 +2,7 @@ import React, { useState } from 'react'
|
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import { flatToTree } from './flat-to-tree.js'
|
|
4
4
|
import FileTree from './file-tree.jsx'
|
|
5
|
-
import { Media } from '
|
|
5
|
+
import { Media } from '../../styles/media'
|
|
6
6
|
import { useMutation, gql } from '@apollo/client'
|
|
7
7
|
import { WarnButton } from '@openneuro/components/warn-button'
|
|
8
8
|
import { AccordionWrap } from '@openneuro/components/accordion'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/scripts/{refactor_2021/dataset → dataset}/files/viewers/__tests__/parse-tabular.spec.js
RENAMED
|
File without changes
|