@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,54 +1,54 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import Helmet from
|
|
3
|
-
import { gql, useQuery } from
|
|
4
|
-
import { DatasetPageTabContainer } from
|
|
5
|
-
import DatasetQueryContext from
|
|
6
|
-
import { Link, useLocation, useParams } from
|
|
7
|
-
import pluralize from
|
|
8
|
-
import formatDistanceToNow from
|
|
9
|
-
import parseISO from
|
|
10
|
-
import { pageTitle } from
|
|
11
|
-
import Validation from
|
|
12
|
-
import { config } from
|
|
13
|
-
import DatasetCitation from
|
|
14
|
-
import { DatasetAlertVersion } from
|
|
1
|
+
import React from "react"
|
|
2
|
+
import Helmet from "react-helmet"
|
|
3
|
+
import { gql, useQuery } from "@apollo/client"
|
|
4
|
+
import { DatasetPageTabContainer } from "./routes/styles/dataset-page-tab-container"
|
|
5
|
+
import DatasetQueryContext from "../datalad/dataset/dataset-query-context.js"
|
|
6
|
+
import { Link, useLocation, useParams } from "react-router-dom"
|
|
7
|
+
import pluralize from "pluralize"
|
|
8
|
+
import formatDistanceToNow from "date-fns/formatDistanceToNow"
|
|
9
|
+
import parseISO from "date-fns/parseISO"
|
|
10
|
+
import { pageTitle } from "../resources/strings.js"
|
|
11
|
+
import Validation from "../validation/validation.jsx"
|
|
12
|
+
import { config } from "../config"
|
|
13
|
+
import DatasetCitation from "./fragments/dataset-citation.jsx"
|
|
14
|
+
import { DatasetAlertVersion } from "./fragments/dataset-alert-version"
|
|
15
15
|
|
|
16
16
|
import {
|
|
17
|
-
ModalitiesMetaDataBlock,
|
|
18
|
-
MetaDataBlock,
|
|
19
|
-
NemarButton,
|
|
20
17
|
BrainLifeButton,
|
|
21
|
-
ValidationBlock,
|
|
22
18
|
CloneDropdown,
|
|
23
|
-
DatasetHeader,
|
|
24
19
|
DatasetGitAccess,
|
|
25
|
-
|
|
20
|
+
DatasetHeader,
|
|
26
21
|
DatasetTools,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
MetaDataBlock,
|
|
23
|
+
ModalitiesMetaDataBlock,
|
|
24
|
+
NemarButton,
|
|
25
|
+
ValidationBlock,
|
|
26
|
+
VersionList,
|
|
27
|
+
} from "@openneuro/components/dataset"
|
|
28
|
+
import { Username } from "../users/username"
|
|
29
|
+
import { Loading } from "@openneuro/components/loading"
|
|
30
30
|
|
|
31
31
|
import {
|
|
32
32
|
getUnexpiredProfile,
|
|
33
|
-
hasEditPermissions,
|
|
34
33
|
hasDatasetAdminPermissions,
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
hasEditPermissions,
|
|
35
|
+
} from "../authentication/profile"
|
|
36
|
+
import { useCookies } from "react-cookie"
|
|
37
37
|
|
|
38
|
-
import { FollowDataset } from
|
|
39
|
-
import { StarDataset } from
|
|
38
|
+
import { FollowDataset } from "./mutations/follow"
|
|
39
|
+
import { StarDataset } from "./mutations/star"
|
|
40
40
|
|
|
41
|
-
import { SNAPSHOT_FIELDS } from
|
|
42
|
-
import { DOILink } from
|
|
43
|
-
import { TabRoutesSnapshot } from
|
|
44
|
-
import schemaGenerator from
|
|
45
|
-
import { FollowToggles } from
|
|
41
|
+
import { SNAPSHOT_FIELDS } from "../datalad/dataset/dataset-query-fragments.js"
|
|
42
|
+
import { DOILink } from "./fragments/doi-link"
|
|
43
|
+
import { TabRoutesSnapshot } from "./routes/tab-routes-snapshot"
|
|
44
|
+
import schemaGenerator from "../utils/json-ld.js"
|
|
45
|
+
import { FollowToggles } from "./common/follow-toggles"
|
|
46
46
|
|
|
47
|
-
const formatDate = dateObject =>
|
|
48
|
-
new Date(dateObject).toISOString().split(
|
|
47
|
+
const formatDate = (dateObject) =>
|
|
48
|
+
new Date(dateObject).toISOString().split("T")[0]
|
|
49
49
|
|
|
50
50
|
// Helper function for getting version from URL
|
|
51
|
-
const snapshotVersion = location => {
|
|
51
|
+
const snapshotVersion = (location) => {
|
|
52
52
|
const matches = location.pathname.match(/versions\/(.*?)(\/|$)/)
|
|
53
53
|
return matches && matches[1]
|
|
54
54
|
}
|
|
@@ -65,7 +65,7 @@ export const SnapshotContainer: React.FC<SnapshotContainerProps> = ({
|
|
|
65
65
|
snapshot,
|
|
66
66
|
}) => {
|
|
67
67
|
const location = useLocation()
|
|
68
|
-
const activeDataset = snapshotVersion(location) ||
|
|
68
|
+
const activeDataset = snapshotVersion(location) || "draft"
|
|
69
69
|
|
|
70
70
|
const [selectedVersion, setSelectedVersion] = React.useState(activeDataset)
|
|
71
71
|
|
|
@@ -73,8 +73,9 @@ export const SnapshotContainer: React.FC<SnapshotContainerProps> = ({
|
|
|
73
73
|
const description = snapshot.description
|
|
74
74
|
const datasetId = dataset.id
|
|
75
75
|
|
|
76
|
-
const numSessions =
|
|
77
|
-
|
|
76
|
+
const numSessions = summary && summary.sessions.length > 0
|
|
77
|
+
? summary.sessions.length
|
|
78
|
+
: 1
|
|
78
79
|
|
|
79
80
|
const dateAdded = formatDate(dataset.created)
|
|
80
81
|
const dateAddedDifference = formatDistanceToNow(parseISO(dataset.created))
|
|
@@ -84,11 +85,11 @@ export const SnapshotContainer: React.FC<SnapshotContainerProps> = ({
|
|
|
84
85
|
const [cookies] = useCookies()
|
|
85
86
|
const profile = getUnexpiredProfile(cookies)
|
|
86
87
|
const isAdmin = profile?.admin
|
|
87
|
-
const hasEdit =
|
|
88
|
-
|
|
88
|
+
const hasEdit = hasEditPermissions(dataset.permissions, profile?.sub) ||
|
|
89
|
+
isAdmin
|
|
89
90
|
const isDatasetAdmin =
|
|
90
91
|
hasDatasetAdminPermissions(dataset.permissions, profile?.sub) || isAdmin
|
|
91
|
-
const modality: string = summary?.modalities[0] ||
|
|
92
|
+
const modality: string = summary?.modalities[0] || ""
|
|
92
93
|
const hasDerivatives = dataset?.derivatives.length > 0
|
|
93
94
|
|
|
94
95
|
return (
|
|
@@ -100,12 +101,14 @@ export const SnapshotContainer: React.FC<SnapshotContainerProps> = ({
|
|
|
100
101
|
<script type="application/ld+json">{schemaGenerator(snapshot)}</script>
|
|
101
102
|
</Helmet>
|
|
102
103
|
<div
|
|
103
|
-
className={`dataset dataset-draft dataset-page dataset-page-${modality?.toLowerCase()}`}
|
|
104
|
+
className={`dataset dataset-draft dataset-page dataset-page-${modality?.toLowerCase()}`}
|
|
105
|
+
>
|
|
104
106
|
{summary && (
|
|
105
107
|
<>
|
|
106
108
|
<DatasetHeader
|
|
107
109
|
pageHeading={description.Name}
|
|
108
|
-
modality={summary?.modalities[0]}
|
|
110
|
+
modality={summary?.modalities[0]}
|
|
111
|
+
>
|
|
109
112
|
<FollowToggles>
|
|
110
113
|
<FollowDataset
|
|
111
114
|
profile={profile !== null}
|
|
@@ -140,11 +143,9 @@ export const SnapshotContainer: React.FC<SnapshotContainerProps> = ({
|
|
|
140
143
|
</ValidationBlock>
|
|
141
144
|
<NemarButton
|
|
142
145
|
datasetId={datasetId}
|
|
143
|
-
onNemar={
|
|
144
|
-
summary?.modalities.includes(
|
|
145
|
-
summary?.modalities.includes(
|
|
146
|
-
summary?.modalities.includes('MEG')
|
|
147
|
-
}
|
|
146
|
+
onNemar={summary?.modalities.includes("EEG") ||
|
|
147
|
+
summary?.modalities.includes("iEEG") ||
|
|
148
|
+
summary?.modalities.includes("MEG")}
|
|
148
149
|
/>
|
|
149
150
|
<BrainLifeButton
|
|
150
151
|
datasetId={datasetId}
|
|
@@ -186,11 +187,9 @@ export const SnapshotContainer: React.FC<SnapshotContainerProps> = ({
|
|
|
186
187
|
/>
|
|
187
188
|
<MetaDataBlock
|
|
188
189
|
heading="Authors"
|
|
189
|
-
item={
|
|
190
|
-
description
|
|
191
|
-
|
|
192
|
-
: 'N/A'
|
|
193
|
-
}
|
|
190
|
+
item={description?.Authors?.length
|
|
191
|
+
? description.Authors.join(", ")
|
|
192
|
+
: "N/A"}
|
|
194
193
|
className="dmb-inline-list"
|
|
195
194
|
/>
|
|
196
195
|
<>
|
|
@@ -222,62 +221,54 @@ export const SnapshotContainer: React.FC<SnapshotContainerProps> = ({
|
|
|
222
221
|
{summary && (
|
|
223
222
|
<MetaDataBlock
|
|
224
223
|
heading="Tasks"
|
|
225
|
-
item={summary.tasks.length ? summary.tasks.join(
|
|
224
|
+
item={summary.tasks.length ? summary.tasks.join(", ") : "N/A"}
|
|
226
225
|
className="dmb-inline-list"
|
|
227
226
|
/>
|
|
228
227
|
)}
|
|
229
|
-
{summary?.modalities.includes(
|
|
230
|
-
summary?.modalities.includes(
|
|
231
|
-
(summary?.modalities.includes(
|
|
228
|
+
{summary?.modalities.includes("pet") ||
|
|
229
|
+
summary?.modalities.includes("Pet") ||
|
|
230
|
+
(summary?.modalities.includes("PET") && (
|
|
232
231
|
<>
|
|
233
232
|
<MetaDataBlock
|
|
234
|
-
heading={pluralize(
|
|
233
|
+
heading={pluralize("Target", summary.pet?.BodyPart)}
|
|
235
234
|
item={summary.pet?.BodyPart}
|
|
236
235
|
/>
|
|
237
236
|
<MetaDataBlock
|
|
238
237
|
heading={pluralize(
|
|
239
|
-
|
|
238
|
+
"Scanner Manufacturer",
|
|
240
239
|
summary.pet?.ScannerManufacturer,
|
|
241
240
|
)}
|
|
242
|
-
item={
|
|
243
|
-
summary.pet?.ScannerManufacturer
|
|
244
|
-
|
|
245
|
-
: 'N/A'
|
|
246
|
-
}
|
|
241
|
+
item={summary.pet?.ScannerManufacturer
|
|
242
|
+
? summary.pet?.ScannerManufacturer
|
|
243
|
+
: "N/A"}
|
|
247
244
|
/>
|
|
248
245
|
|
|
249
246
|
<MetaDataBlock
|
|
250
247
|
heading={pluralize(
|
|
251
|
-
|
|
248
|
+
"Scanner Model",
|
|
252
249
|
summary.pet?.ScannerManufacturersModelName,
|
|
253
250
|
)}
|
|
254
|
-
item={
|
|
255
|
-
summary.pet?.ScannerManufacturersModelName
|
|
256
|
-
|
|
257
|
-
: 'N/A'
|
|
258
|
-
}
|
|
251
|
+
item={summary.pet?.ScannerManufacturersModelName
|
|
252
|
+
? summary.pet?.ScannerManufacturersModelName
|
|
253
|
+
: "N/A"}
|
|
259
254
|
/>
|
|
260
255
|
<MetaDataBlock
|
|
261
256
|
heading={pluralize(
|
|
262
|
-
|
|
257
|
+
"Radionuclide",
|
|
263
258
|
summary.pet?.TracerRadionuclide,
|
|
264
259
|
)}
|
|
265
|
-
item={
|
|
266
|
-
summary.pet?.TracerRadionuclide
|
|
267
|
-
|
|
268
|
-
: 'N/A'
|
|
269
|
-
}
|
|
260
|
+
item={summary.pet?.TracerRadionuclide
|
|
261
|
+
? summary.pet?.TracerRadionuclide
|
|
262
|
+
: "N/A"}
|
|
270
263
|
/>
|
|
271
264
|
<MetaDataBlock
|
|
272
265
|
heading={pluralize(
|
|
273
|
-
|
|
266
|
+
"Radiotracer",
|
|
274
267
|
summary.pet?.TracerName,
|
|
275
268
|
)}
|
|
276
|
-
item={
|
|
277
|
-
summary.pet?.TracerName
|
|
278
|
-
|
|
279
|
-
: 'N/A'
|
|
280
|
-
}
|
|
269
|
+
item={summary.pet?.TracerName
|
|
270
|
+
? summary.pet?.TracerName
|
|
271
|
+
: "N/A"}
|
|
281
272
|
/>
|
|
282
273
|
</>
|
|
283
274
|
))}
|
|
@@ -286,7 +277,7 @@ export const SnapshotContainer: React.FC<SnapshotContainerProps> = ({
|
|
|
286
277
|
heading="Uploaded by"
|
|
287
278
|
item={
|
|
288
279
|
<>
|
|
289
|
-
<Username user={dataset.uploader} /> on {dateAdded} -{
|
|
280
|
+
<Username user={dataset.uploader} /> on {dateAdded} -{" "}
|
|
290
281
|
{dateAddedDifference} ago
|
|
291
282
|
</>
|
|
292
283
|
}
|
|
@@ -386,7 +377,7 @@ const SnapshotLoader: React.FC<SnapshotLoaderProps> = ({ dataset }) => {
|
|
|
386
377
|
datasetId: dataset.id,
|
|
387
378
|
tag,
|
|
388
379
|
},
|
|
389
|
-
errorPolicy:
|
|
380
|
+
errorPolicy: "all",
|
|
390
381
|
})
|
|
391
382
|
if (loading) {
|
|
392
383
|
return (
|
|
@@ -404,7 +395,8 @@ const SnapshotLoader: React.FC<SnapshotLoaderProps> = ({ dataset }) => {
|
|
|
404
395
|
datasetId: dataset.id,
|
|
405
396
|
fetchMore,
|
|
406
397
|
error: null,
|
|
407
|
-
}}
|
|
398
|
+
}}
|
|
399
|
+
>
|
|
408
400
|
<SnapshotContainer
|
|
409
401
|
dataset={dataset}
|
|
410
402
|
tag={tag}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import React, { FC } from
|
|
2
|
-
import { Link } from
|
|
3
|
-
import styled from
|
|
1
|
+
import React, { FC } from "react"
|
|
2
|
+
import { Link } from "react-router-dom"
|
|
3
|
+
import styled from "@emotion/styled"
|
|
4
4
|
|
|
5
5
|
type ContainerProps = {
|
|
6
6
|
styleContext: string
|
|
7
7
|
}
|
|
8
8
|
const Container = styled.div<ContainerProps>(({ styleContext }) => {
|
|
9
9
|
switch (styleContext) {
|
|
10
|
-
case
|
|
10
|
+
case "topLevel":
|
|
11
11
|
return {
|
|
12
|
-
margin:
|
|
12
|
+
margin: "50px 25px",
|
|
13
13
|
}
|
|
14
|
-
case
|
|
14
|
+
case "dataset":
|
|
15
15
|
return {
|
|
16
|
-
margin:
|
|
16
|
+
margin: "20px 0",
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
})
|
|
@@ -25,9 +25,9 @@ interface FourOThreePageProps {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
const FourOThreePage: FC<FourOThreePageProps> = ({
|
|
28
|
-
redirectRoute =
|
|
29
|
-
redirectRouteName =
|
|
30
|
-
theme =
|
|
28
|
+
redirectRoute = "/",
|
|
29
|
+
redirectRouteName = "the home page",
|
|
30
|
+
theme = "topLevel",
|
|
31
31
|
}) => {
|
|
32
32
|
return (
|
|
33
33
|
<Container styleContext={theme}>
|
|
@@ -36,7 +36,7 @@ const FourOThreePage: FC<FourOThreePageProps> = ({
|
|
|
36
36
|
</h3>
|
|
37
37
|
<p>
|
|
38
38
|
Click <Link to={redirectRoute}>here</Link> to go to
|
|
39
|
-
{
|
|
39
|
+
{" " + redirectRouteName}.
|
|
40
40
|
</p>
|
|
41
41
|
</Container>
|
|
42
42
|
)
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import React, { FC } from
|
|
2
|
-
import { Link } from
|
|
3
|
-
import styled from
|
|
1
|
+
import React, { FC } from "react"
|
|
2
|
+
import { Link } from "react-router-dom"
|
|
3
|
+
import styled from "@emotion/styled"
|
|
4
4
|
|
|
5
5
|
type ContainerProps = {
|
|
6
6
|
styleContext: string
|
|
7
7
|
}
|
|
8
8
|
const Container = styled.div<ContainerProps>(({ styleContext }) => {
|
|
9
9
|
switch (styleContext) {
|
|
10
|
-
case
|
|
10
|
+
case "topLevel":
|
|
11
11
|
return {
|
|
12
|
-
margin:
|
|
12
|
+
margin: "50px 25px",
|
|
13
13
|
}
|
|
14
|
-
case
|
|
14
|
+
case "dataset":
|
|
15
15
|
return {
|
|
16
|
-
margin:
|
|
16
|
+
margin: "20px 0",
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
})
|
|
@@ -26,10 +26,10 @@ interface FourOFourPageProps {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
const FourOFourPage: FC<FourOFourPageProps> = ({
|
|
29
|
-
redirectRoute =
|
|
30
|
-
redirectRouteName =
|
|
31
|
-
theme =
|
|
32
|
-
message =
|
|
29
|
+
redirectRoute = "/",
|
|
30
|
+
redirectRouteName = "the home page",
|
|
31
|
+
theme = "topLevel",
|
|
32
|
+
message = "",
|
|
33
33
|
}) => {
|
|
34
34
|
return (
|
|
35
35
|
<Container styleContext={theme}>
|
|
@@ -37,7 +37,7 @@ const FourOFourPage: FC<FourOFourPageProps> = ({
|
|
|
37
37
|
{message && <p>{message}</p>}
|
|
38
38
|
<p>
|
|
39
39
|
Click <Link to={redirectRoute}>here</Link> to go to
|
|
40
|
-
{
|
|
40
|
+
{" " + redirectRouteName}.
|
|
41
41
|
</p>
|
|
42
42
|
</Container>
|
|
43
43
|
)
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { apm } from
|
|
2
|
-
import React from
|
|
3
|
-
import PropTypes from
|
|
4
|
-
import FreshdeskInterface from
|
|
1
|
+
import { apm } from "../apm"
|
|
2
|
+
import React from "react"
|
|
3
|
+
import PropTypes from "prop-types"
|
|
4
|
+
import FreshdeskInterface from "./freshdeskInterface.jsx"
|
|
5
5
|
|
|
6
6
|
// raises error if catchErrorIf returns true
|
|
7
7
|
const getDerivedStateFromErrorOnCondition = (error, catchErrorIf) => {
|
|
8
|
-
const raiseError =
|
|
9
|
-
|
|
8
|
+
const raiseError = typeof catchErrorIf === "function"
|
|
9
|
+
? catchErrorIf(error)
|
|
10
|
+
: true
|
|
10
11
|
return raiseError
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
// trigger error component
|
|
13
|
+
? { hasError: true, supportModal: false, error: error }
|
|
14
|
+
// don't show error handling component
|
|
15
|
+
: { hasError: false, supportModal: false, error: error }
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
class ErrorBoundary extends React.Component {
|
|
@@ -20,7 +21,7 @@ class ErrorBoundary extends React.Component {
|
|
|
20
21
|
this.state = {
|
|
21
22
|
hasError: false,
|
|
22
23
|
eventId: null,
|
|
23
|
-
message:
|
|
24
|
+
message: "",
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
|
|
@@ -84,7 +85,7 @@ class ErrorBoundaryAssertionFailureException extends ErrorBoundary {
|
|
|
84
85
|
return getDerivedStateFromErrorOnCondition(
|
|
85
86
|
error,
|
|
86
87
|
// ErrorBoundary not triggered for "assertion failure"
|
|
87
|
-
error => error.toString() !==
|
|
88
|
+
(error) => error.toString() !== "Error: assertion failure",
|
|
88
89
|
)
|
|
89
90
|
}
|
|
90
91
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Route for nice display of backend errors
|
|
3
3
|
*/
|
|
4
|
-
import React from
|
|
5
|
-
import { Route, Routes } from
|
|
6
|
-
import OrcidGeneral from
|
|
7
|
-
import OrcidEmail from
|
|
8
|
-
import OrcidGiven from
|
|
9
|
-
import OrcidFamily from
|
|
4
|
+
import React from "react"
|
|
5
|
+
import { Route, Routes } from "react-router-dom"
|
|
6
|
+
import OrcidGeneral from "./orcid/general.jsx"
|
|
7
|
+
import OrcidEmail from "./orcid/email.jsx"
|
|
8
|
+
import OrcidGiven from "./orcid/given.jsx"
|
|
9
|
+
import OrcidFamily from "./orcid/family.jsx"
|
|
10
10
|
|
|
11
11
|
class ErrorRoute extends React.Component {
|
|
12
12
|
render() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import PropTypes from
|
|
3
|
-
import { useCookies } from
|
|
4
|
-
import { getProfile } from
|
|
5
|
-
import { config } from
|
|
1
|
+
import React from "react"
|
|
2
|
+
import PropTypes from "prop-types"
|
|
3
|
+
import { useCookies } from "react-cookie"
|
|
4
|
+
import { getProfile } from "../authentication/profile"
|
|
5
|
+
import { config } from "../config"
|
|
6
6
|
|
|
7
7
|
const buildCustomQuery = (customText, prepopulatedFields) => {
|
|
8
8
|
const customizerQueries = [
|
|
@@ -11,7 +11,7 @@ const buildCustomQuery = (customText, prepopulatedFields) => {
|
|
|
11
11
|
.filter(([, value]) => value)
|
|
12
12
|
.map(([key, value]) => `helpdesk_ticket[${key}]=${value}`),
|
|
13
13
|
]
|
|
14
|
-
return customizerQueries.length ? `&${customizerQueries.join(
|
|
14
|
+
return customizerQueries.length ? `&${customizerQueries.join(";")}` : ""
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
function FreshdeskWidget({ subject, error, sentryId, description }) {
|
|
@@ -19,17 +19,17 @@ function FreshdeskWidget({ subject, error, sentryId, description }) {
|
|
|
19
19
|
const profile = getProfile(cookies)
|
|
20
20
|
const sentry = sentryId && `Sentry ID: ${sentryId}`
|
|
21
21
|
const joinedDescription = [sentry, description, error]
|
|
22
|
-
.filter(item => item)
|
|
23
|
-
.join(
|
|
22
|
+
.filter((item) => item)
|
|
23
|
+
.join(" \u2014 ")
|
|
24
24
|
|
|
25
25
|
const customText = {
|
|
26
|
-
widgetType:
|
|
27
|
-
formTitle:
|
|
28
|
-
submitTitle:
|
|
26
|
+
widgetType: "embedded",
|
|
27
|
+
formTitle: "Report+an+Issue",
|
|
28
|
+
submitTitle: "Request+Support",
|
|
29
29
|
submitThanks:
|
|
30
|
-
|
|
31
|
-
screenshot:
|
|
32
|
-
captcha:
|
|
30
|
+
"Thank+you+for+taking+the+time+to+report+your+case.+A+support+representative+will+be+reviewing+your+request+and+will+send+you+a+personal+response+within+24+to+48+hours.",
|
|
31
|
+
screenshot: "No",
|
|
32
|
+
captcha: "yes",
|
|
33
33
|
}
|
|
34
34
|
const prepopulatedFields = {
|
|
35
35
|
requester: profile && profile.email,
|
|
@@ -43,17 +43,14 @@ function FreshdeskWidget({ subject, error, sentryId, description }) {
|
|
|
43
43
|
src="https://s3.amazonaws.com/assets.freshdesk.com/widget/freshwidget.js"
|
|
44
44
|
/>
|
|
45
45
|
<style type="text/css" media="screen, projection">
|
|
46
|
-
{
|
|
47
|
-
'@import url(https://s3.amazonaws.com/assets.freshdesk.com/widget/freshwidget.css); '
|
|
48
|
-
}
|
|
46
|
+
{"@import url(https://s3.amazonaws.com/assets.freshdesk.com/widget/freshwidget.css); "}
|
|
49
47
|
</style>
|
|
50
48
|
<iframe
|
|
51
49
|
title="Feedback Form"
|
|
52
50
|
className="freshwidget-embedded-form"
|
|
53
51
|
id="freshwidget-embedded-form"
|
|
54
|
-
src={
|
|
55
|
-
|
|
56
|
-
}
|
|
52
|
+
src={config.support.url +
|
|
53
|
+
buildCustomQuery(customText, prepopulatedFields)}
|
|
57
54
|
scrolling="no"
|
|
58
55
|
height="500px"
|
|
59
56
|
width="100%"
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import React, { useState } from
|
|
2
|
-
import FreshdeskWidget from
|
|
1
|
+
import React, { useState } from "react"
|
|
2
|
+
import FreshdeskWidget from "./freshdesk-widget.jsx"
|
|
3
3
|
import {
|
|
4
|
-
Overlay,
|
|
5
|
-
ModalContainer,
|
|
6
4
|
ExitButton,
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
ModalContainer,
|
|
6
|
+
Overlay,
|
|
7
|
+
} from "../styles/support-modal.jsx"
|
|
8
|
+
import PropTypes from "prop-types"
|
|
9
9
|
|
|
10
|
-
const FreshdeskInterface = props => {
|
|
10
|
+
const FreshdeskInterface = (props) => {
|
|
11
11
|
const [showModal, setShowModal] = useState(false)
|
|
12
12
|
return (
|
|
13
13
|
<>
|
|
14
14
|
<p className="generic-error-message">
|
|
15
|
-
{props.message ||
|
|
15
|
+
{props.message || "An error has occurred."}
|
|
16
16
|
<br />
|
|
17
|
-
Please support us by documenting the issue with{
|
|
17
|
+
Please support us by documenting the issue with{" "}
|
|
18
18
|
<a onClick={() => setShowModal(true)}>
|
|
19
19
|
<u>FreshDesk</u>
|
|
20
20
|
</a>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react"
|
|
2
2
|
|
|
3
3
|
const EmailError = () => (
|
|
4
4
|
<div className="panel-body">
|
|
5
5
|
Your ORCID account does not have an e-mail, or your e-mail is not public.
|
|
6
|
-
Visit your <a href="https://orcid.org/my-orcid">ORCID profile</a>
|
|
7
|
-
you have a public e-mail address and try again.
|
|
6
|
+
Visit your <a href="https://orcid.org/my-orcid">ORCID profile</a>{" "}
|
|
7
|
+
and verify you have a public e-mail address and try again.
|
|
8
8
|
</div>
|
|
9
9
|
)
|
|
10
10
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react"
|
|
2
2
|
|
|
3
3
|
const FamilyError = () => (
|
|
4
4
|
<div className="panel-body">
|
|
5
5
|
Your ORCID account does not have a credit name or family name, or your name
|
|
6
|
-
is not public. Visit your{
|
|
7
|
-
<a href="https://orcid.org/my-orcid">ORCID profile</a>
|
|
8
|
-
have a publicly available name set.
|
|
6
|
+
is not public. Visit your{" "}
|
|
7
|
+
<a href="https://orcid.org/my-orcid">ORCID profile</a>{" "}
|
|
8
|
+
and verify verify you have a publicly available name set.
|
|
9
9
|
</div>
|
|
10
10
|
)
|
|
11
11
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react"
|
|
2
2
|
|
|
3
3
|
const GivenError = () => (
|
|
4
4
|
<div className="panel-body">
|
|
5
5
|
Your ORCID account does not have a credit name or given name, or your name
|
|
6
|
-
is not public. Visit your{
|
|
7
|
-
<a href="https://orcid.org/my-orcid">ORCID profile</a>
|
|
8
|
-
publicly available name set.
|
|
6
|
+
is not public. Visit your{" "}
|
|
7
|
+
<a href="https://orcid.org/my-orcid">ORCID profile</a>{" "}
|
|
8
|
+
and verify you have a publicly available name set.
|
|
9
9
|
</div>
|
|
10
10
|
)
|
|
11
11
|
|