@openneuro/app 4.1.1 → 4.2.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/package.json +9 -18
- package/src/scripts/common/forms/warn-button.jsx +1 -1
- package/src/scripts/{redesign.tsx → index.tsx} +4 -4
- package/src/scripts/pages/citation-page.tsx +41 -0
- package/src/scripts/refactor_2021/admin/admin.jsx +1 -1
- package/src/scripts/refactor_2021/admin/flagged-files.jsx +2 -1
- package/src/scripts/refactor_2021/admin/user-tools.tsx +3 -5
- package/src/scripts/refactor_2021/admin/users.jsx +7 -10
- package/src/scripts/{authentication → refactor_2021/authentication}/__tests__/profile.spec.js +1 -1
- package/src/scripts/refactor_2021/containers/footer.tsx +1 -3
- package/src/scripts/{datalad/dataset → refactor_2021/dataset/comments}/__tests__/__snapshots__/comment.spec.jsx.snap +0 -8
- package/src/scripts/refactor_2021/dataset/comments/__tests__/__snapshots__/comments.spec.jsx.snap +129 -0
- package/src/scripts/{datalad/dataset → refactor_2021/dataset/comments}/__tests__/comment.spec.jsx +0 -0
- package/src/scripts/{datalad/dataset → refactor_2021/dataset/comments}/__tests__/comments.spec.jsx +0 -0
- package/src/scripts/refactor_2021/dataset/dataset-routes.jsx +14 -4
- package/src/scripts/{datalad → refactor_2021/dataset}/download/__tests__/__snapshots__/download-command-line.spec.jsx.snap +0 -0
- package/src/scripts/{datalad → refactor_2021/dataset}/download/__tests__/__snapshots__/download-link.spec.jsx.snap +645 -105
- package/src/scripts/{datalad → refactor_2021/dataset}/download/__tests__/__snapshots__/shell-example.spec.jsx.snap +6 -3
- package/src/scripts/{datalad → refactor_2021/dataset}/download/__tests__/download-command-line.spec.jsx +0 -0
- package/src/scripts/{datalad → refactor_2021/dataset}/download/__tests__/download-link.spec.jsx +0 -0
- package/src/scripts/{datalad → refactor_2021/dataset}/download/__tests__/download-native.spec.js +0 -0
- package/src/scripts/{datalad → refactor_2021/dataset}/download/__tests__/shell-example.spec.jsx +0 -0
- package/src/scripts/refactor_2021/dataset/download/download-datalad.jsx +45 -10
- package/src/scripts/refactor_2021/dataset/draft-container.tsx +20 -35
- package/src/scripts/refactor_2021/dataset/files/file-tree.jsx +3 -2
- package/src/scripts/refactor_2021/dataset/fragments/__tests__/__snapshots__/cancel-button.spec.tsx.snap +10 -0
- package/src/scripts/refactor_2021/dataset/fragments/__tests__/__snapshots__/edit-button.spec.tsx.snap +10 -0
- package/src/scripts/refactor_2021/dataset/fragments/__tests__/__snapshots__/edit-list.spec.jsx.snap +24 -0
- package/src/scripts/refactor_2021/dataset/fragments/__tests__/__snapshots__/save-button.spec.tsx.snap +10 -0
- package/src/scripts/{datalad/fragments/__tests__/__snapshots__/select-input.spec.jsx.snap → refactor_2021/dataset/fragments/__tests__/__snapshots__/select-input.spec.tsx.snap} +0 -0
- package/src/scripts/{datalad/fragments/__tests__/cancel-button.spec.jsx → refactor_2021/dataset/fragments/__tests__/cancel-button.spec.tsx} +2 -2
- package/src/scripts/{datalad → refactor_2021/dataset}/fragments/__tests__/dataset-citation.spec.jsx +0 -0
- package/src/scripts/{datalad/fragments/__tests__/edit-button.spec.jsx → refactor_2021/dataset/fragments/__tests__/edit-button.spec.tsx} +2 -2
- package/src/scripts/refactor_2021/dataset/fragments/__tests__/edit-list.spec.jsx +27 -0
- package/src/scripts/{datalad/fragments/__tests__/save-button.spec.jsx → refactor_2021/dataset/fragments/__tests__/save-button.spec.tsx} +2 -2
- package/src/scripts/{datalad/fragments/__tests__/select-input.spec.jsx → refactor_2021/dataset/fragments/__tests__/select-input.spec.tsx} +0 -0
- package/src/scripts/refactor_2021/dataset/mutations/__tests__/__snapshots__/delete.spec.jsx.snap +50 -0
- package/src/scripts/{datalad → refactor_2021/dataset}/mutations/__tests__/__snapshots__/description.spec.jsx.snap +0 -0
- package/src/scripts/refactor_2021/dataset/mutations/__tests__/__snapshots__/update-permissions.spec.jsx.snap +27 -0
- package/src/scripts/{datalad → refactor_2021/dataset}/mutations/__tests__/cache-id.spec.js +0 -0
- package/src/scripts/{datalad → refactor_2021/dataset}/mutations/__tests__/delete.spec.jsx +8 -8
- package/src/scripts/{datalad → refactor_2021/dataset}/mutations/__tests__/description.spec.jsx +0 -0
- package/src/scripts/{datalad/mutations/__tests__/remove-permissions.spec.jsx → refactor_2021/dataset/mutations/__tests__/remove-permissions.spec.tsx} +1 -1
- package/src/scripts/refactor_2021/dataset/mutations/__tests__/update-permissions.spec.jsx +28 -0
- package/src/scripts/refactor_2021/dataset/mutations/update-file.jsx +2 -2
- package/src/scripts/refactor_2021/dataset/routes/download-dataset.tsx +76 -0
- package/src/scripts/refactor_2021/dataset/snapshot-container.tsx +10 -4
- package/src/scripts/refactor_2021/routes.tsx +1 -1
- package/src/scripts/refactor_2021/search/__tests__/search-params-ctx.spec.tsx +20 -0
- package/src/scripts/refactor_2021/search/initial-search-params.tsx +7 -7
- package/src/scripts/refactor_2021/search/inputs/__tests__/sort-by-select.spec.tsx +83 -0
- package/src/scripts/refactor_2021/search/inputs/index.ts +2 -2
- package/src/scripts/refactor_2021/search/inputs/{gender-radios.tsx → sex-radios.tsx} +10 -10
- package/src/scripts/refactor_2021/search/inputs/sort-by-select.tsx +38 -8
- package/src/scripts/refactor_2021/search/search-container.tsx +3 -3
- package/src/scripts/refactor_2021/search/search-params-ctx.tsx +3 -3
- package/src/scripts/refactor_2021/search/use-search-results.tsx +4 -3
- package/src/scripts/refactor_2021/user/api.jsx +11 -6
- package/src/server.jsx +1 -5
- package/src/ssr.ts +0 -1
- package/src/sass/_bootstrap-compass.scss +0 -9
- package/src/sass/_bootstrap-mincer.scss +0 -19
- package/src/sass/_bootstrap-sprockets.scss +0 -9
- package/src/sass/_bootstrap.scss +0 -50
- package/src/sass/animate/_attention-seekers/_bounce.scss +0 -15
- package/src/sass/animate/_attention-seekers/_flash.scss +0 -14
- package/src/sass/animate/_attention-seekers/_pulse.scss +0 -17
- package/src/sass/animate/_attention-seekers/_rubberBand.scss +0 -19
- package/src/sass/animate/_attention-seekers/_shake.scss +0 -15
- package/src/sass/animate/_attention-seekers/_swing.scss +0 -19
- package/src/sass/animate/_attention-seekers/_tada.scss +0 -17
- package/src/sass/animate/_attention-seekers/_wobble.scss +0 -21
- package/src/sass/animate/_attention-seekers/attention-seekers.scss +0 -12
- package/src/sass/animate/_bouncing-entrances/_bounceIn.scss +0 -26
- package/src/sass/animate/_bouncing-entrances/_bounceInDown.scss +0 -26
- package/src/sass/animate/_bouncing-entrances/_bounceInLeft.scss +0 -26
- package/src/sass/animate/_bouncing-entrances/_bounceInRight.scss +0 -26
- package/src/sass/animate/_bouncing-entrances/_bounceInUp.scss +0 -26
- package/src/sass/animate/_bouncing-entrances/bouncing-entrances.scss +0 -9
- package/src/sass/animate/_bouncing-exits/_bounceOut.scss +0 -26
- package/src/sass/animate/_bouncing-exits/_bounceOutDown.scss +0 -23
- package/src/sass/animate/_bouncing-exits/_bounceOutLeft.scss +0 -23
- package/src/sass/animate/_bouncing-exits/_bounceOutRight.scss +0 -23
- package/src/sass/animate/_bouncing-exits/_bounceOutUp.scss +0 -23
- package/src/sass/animate/_bouncing-exits/bouncing-exits.scss +0 -4
- package/src/sass/animate/_fading-entrances/_fadeIn.scss +0 -14
- package/src/sass/animate/_fading-entrances/_fadeInDown.scss +0 -20
- package/src/sass/animate/_fading-entrances/_fadeInDownBig.scss +0 -20
- package/src/sass/animate/_fading-entrances/_fadeInLeft.scss +0 -20
- package/src/sass/animate/_fading-entrances/_fadeInLeftBig.scss +0 -20
- package/src/sass/animate/_fading-entrances/_fadeInRight.scss +0 -20
- package/src/sass/animate/_fading-entrances/_fadeInRightBig.scss +0 -20
- package/src/sass/animate/_fading-entrances/_fadeInUp.scss +0 -19
- package/src/sass/animate/_fading-entrances/_fadeInUpBig.scss +0 -20
- package/src/sass/animate/_fading-entrances/fading-entrances.scss +0 -5
- package/src/sass/animate/_fading-exits/_fadeOut.scss +0 -14
- package/src/sass/animate/_fading-exits/_fadeOutDown.scss +0 -20
- package/src/sass/animate/_fading-exits/_fadeOutDownBig.scss +0 -20
- package/src/sass/animate/_fading-exits/_fadeOutLeft.scss +0 -20
- package/src/sass/animate/_fading-exits/_fadeOutLeftBig.scss +0 -20
- package/src/sass/animate/_fading-exits/_fadeOutRight.scss +0 -20
- package/src/sass/animate/_fading-exits/_fadeOutRightBig.scss +0 -20
- package/src/sass/animate/_fading-exits/_fadeOutUp.scss +0 -20
- package/src/sass/animate/_fading-exits/_fadeOutUpBig.scss +0 -20
- package/src/sass/animate/_fading-exits/fading-exits.scss +0 -5
- package/src/sass/animate/_flippers/_flip.scss +0 -33
- package/src/sass/animate/_flippers/_flipInX.scss +0 -26
- package/src/sass/animate/_flippers/_flipInY.scss +0 -26
- package/src/sass/animate/_flippers/_flipOutX.scss +0 -20
- package/src/sass/animate/_flippers/_flipOutY.scss +0 -20
- package/src/sass/animate/_flippers/flippers.scss +0 -8
- package/src/sass/animate/_lightspeed/_lightSpeedIn.scss +0 -29
- package/src/sass/animate/_lightspeed/_lightSpeedOut.scss +0 -21
- package/src/sass/animate/_lightspeed/lightspeed.scss +0 -3
- package/src/sass/animate/_properties.scss +0 -119
- package/src/sass/animate/_rotating-entrances/_rotateIn.scss +0 -22
- package/src/sass/animate/_rotating-entrances/_rotateInDownLeft.scss +0 -22
- package/src/sass/animate/_rotating-entrances/_rotateInDownRight.scss +0 -22
- package/src/sass/animate/_rotating-entrances/_rotateInUpLeft.scss +0 -22
- package/src/sass/animate/_rotating-entrances/_rotateInUpRight.scss +0 -22
- package/src/sass/animate/_rotating-entrances/rotating-entrances.scss +0 -8
- package/src/sass/animate/_rotating-exits/_rotateOut.scss +0 -22
- package/src/sass/animate/_rotating-exits/_rotateOutDownLeft.scss +0 -22
- package/src/sass/animate/_rotating-exits/_rotateOutDownRight.scss +0 -22
- package/src/sass/animate/_rotating-exits/_rotateOutUpLeft.scss +0 -22
- package/src/sass/animate/_rotating-exits/_rotateOutUpRight.scss +0 -22
- package/src/sass/animate/_rotating-exits/rotating-exits.scss +0 -8
- package/src/sass/animate/_sliding-entrances/_slideInDown.scss +0 -19
- package/src/sass/animate/_sliding-entrances/_slideInLeft.scss +0 -19
- package/src/sass/animate/_sliding-entrances/_slideInRight.scss +0 -42
- package/src/sass/animate/_sliding-entrances/_slideInUp.scss +0 -19
- package/src/sass/animate/_sliding-entrances/sliding-entrances.scss +0 -7
- package/src/sass/animate/_sliding-exits/_slideOutDown.scss +0 -19
- package/src/sass/animate/_sliding-exits/_slideOutLeft.scss +0 -19
- package/src/sass/animate/_sliding-exits/_slideOutRight.scss +0 -19
- package/src/sass/animate/_sliding-exits/_slideOutUp.scss +0 -19
- package/src/sass/animate/_sliding-exits/sliding-exits.scss +0 -7
- package/src/sass/animate/_specials/_hinge.scss +0 -37
- package/src/sass/animate/_specials/_rollIn.scss +0 -20
- package/src/sass/animate/_specials/_rollOut.scss +0 -22
- package/src/sass/animate/_specials/specials.scss +0 -6
- package/src/sass/animate/_zooming-entrances/_zoomIn.scss +0 -19
- package/src/sass/animate/_zooming-entrances/_zoomInDown.scss +0 -22
- package/src/sass/animate/_zooming-entrances/_zoomInLeft.scss +0 -22
- package/src/sass/animate/_zooming-entrances/_zoomInRight.scss +0 -22
- package/src/sass/animate/_zooming-entrances/_zoomInUp.scss +0 -22
- package/src/sass/animate/_zooming-entrances/zooming-entrances.scss +0 -4
- package/src/sass/animate/_zooming-exits/_zoomOut.scss +0 -22
- package/src/sass/animate/_zooming-exits/_zoomOutDown.scss +0 -23
- package/src/sass/animate/_zooming-exits/_zoomOutLeft.scss +0 -21
- package/src/sass/animate/_zooming-exits/_zoomOutRight.scss +0 -21
- package/src/sass/animate/_zooming-exits/_zoomOutUp.scss +0 -23
- package/src/sass/animate/_zooming-exits/zooming-exits.scss +0 -4
- package/src/sass/animate/animate.css +0 -7497
- package/src/sass/animate/animate.css.map +0 -7
- package/src/sass/animate/animate.min.css +0 -2
- package/src/sass/animate/animate.min.css.map +0 -7
- package/src/sass/animate/animate.scss +0 -30
- package/src/sass/animate/bower.json +0 -22
- package/src/sass/bootstrap/_alerts.scss +0 -70
- package/src/sass/bootstrap/_badges.scss +0 -68
- package/src/sass/bootstrap/_breadcrumbs.scss +0 -26
- package/src/sass/bootstrap/_button-groups.scss +0 -243
- package/src/sass/bootstrap/_buttons.scss +0 -160
- package/src/sass/bootstrap/_carousel.scss +0 -269
- package/src/sass/bootstrap/_close.scss +0 -36
- package/src/sass/bootstrap/_code.scss +0 -69
- package/src/sass/bootstrap/_component-animations.scss +0 -37
- package/src/sass/bootstrap/_dropdowns.scss +0 -223
- package/src/sass/bootstrap/_forms.scss +0 -613
- package/src/sass/bootstrap/_grid.scss +0 -84
- package/src/sass/bootstrap/_input-groups.scss +0 -166
- package/src/sass/bootstrap/_jumbotron.scss +0 -50
- package/src/sass/bootstrap/_labels.scss +0 -66
- package/src/sass/bootstrap/_list-group.scss +0 -124
- package/src/sass/bootstrap/_media.scss +0 -61
- package/src/sass/bootstrap/_mixins.scss +0 -39
- package/src/sass/bootstrap/_modals.scss +0 -150
- package/src/sass/bootstrap/_navbar.scss +0 -647
- package/src/sass/bootstrap/_navs.scss +0 -243
- package/src/sass/bootstrap/_normalize.scss +0 -427
- package/src/sass/bootstrap/_pager.scss +0 -54
- package/src/sass/bootstrap/_pagination.scss +0 -88
- package/src/sass/bootstrap/_panels.scss +0 -265
- package/src/sass/bootstrap/_popovers.scss +0 -135
- package/src/sass/bootstrap/_print.scss +0 -107
- package/src/sass/bootstrap/_progress-bars.scss +0 -87
- package/src/sass/bootstrap/_responsive-embed.scss +0 -35
- package/src/sass/bootstrap/_responsive-utilities.scss +0 -177
- package/src/sass/bootstrap/_scaffolding.scss +0 -162
- package/src/sass/bootstrap/_tables.scss +0 -234
- package/src/sass/bootstrap/_theme.scss +0 -273
- package/src/sass/bootstrap/_thumbnails.scss +0 -38
- package/src/sass/bootstrap/_tooltip.scss +0 -102
- package/src/sass/bootstrap/_type.scss +0 -298
- package/src/sass/bootstrap/_utilities.scss +0 -55
- package/src/sass/bootstrap/_variables.scss +0 -866
- package/src/sass/bootstrap/_wells.scss +0 -29
- package/src/sass/bootstrap/float-label.scss +0 -70
- package/src/sass/bootstrap/mixins/_alerts.scss +0 -14
- package/src/sass/bootstrap/mixins/_background-variant.scss +0 -11
- package/src/sass/bootstrap/mixins/_border-radius.scss +0 -18
- package/src/sass/bootstrap/mixins/_buttons.scss +0 -52
- package/src/sass/bootstrap/mixins/_center-block.scss +0 -7
- package/src/sass/bootstrap/mixins/_clearfix.scss +0 -22
- package/src/sass/bootstrap/mixins/_forms.scss +0 -88
- package/src/sass/bootstrap/mixins/_gradients.scss +0 -58
- package/src/sass/bootstrap/mixins/_grid-framework.scss +0 -81
- package/src/sass/bootstrap/mixins/_grid.scss +0 -122
- package/src/sass/bootstrap/mixins/_hide-text.scss +0 -21
- package/src/sass/bootstrap/mixins/_image.scss +0 -33
- package/src/sass/bootstrap/mixins/_labels.scss +0 -12
- package/src/sass/bootstrap/mixins/_list-group.scss +0 -31
- package/src/sass/bootstrap/mixins/_nav-divider.scss +0 -10
- package/src/sass/bootstrap/mixins/_nav-vertical-align.scss +0 -9
- package/src/sass/bootstrap/mixins/_opacity.scss +0 -8
- package/src/sass/bootstrap/mixins/_pagination.scss +0 -23
- package/src/sass/bootstrap/mixins/_panels.scss +0 -24
- package/src/sass/bootstrap/mixins/_progress-bar.scss +0 -10
- package/src/sass/bootstrap/mixins/_reset-filter.scss +0 -8
- package/src/sass/bootstrap/mixins/_resize.scss +0 -6
- package/src/sass/bootstrap/mixins/_responsive-visibility.scss +0 -21
- package/src/sass/bootstrap/mixins/_size.scss +0 -10
- package/src/sass/bootstrap/mixins/_tab-focus.scss +0 -9
- package/src/sass/bootstrap/mixins/_table-row.scss +0 -28
- package/src/sass/bootstrap/mixins/_text-emphasis.scss +0 -11
- package/src/sass/bootstrap/mixins/_text-overflow.scss +0 -8
- package/src/sass/bootstrap/mixins/_vendor-prefixes.scss +0 -222
- package/src/sass/crn_app/_admin.admin.scss +0 -205
- package/src/sass/crn_app/_admin.graphs.scss +0 -51
- package/src/sass/crn_app/_admin.tools.scss +0 -24
- package/src/sass/crn_app/_api.scss +0 -65
- package/src/sass/crn_app/_bootstrap.overrides.scss +0 -54
- package/src/sass/crn_app/_colors.scss +0 -88
- package/src/sass/crn_app/_common.click-to-edit.scss +0 -187
- package/src/sass/crn_app/_common.modals.scss +0 -686
- package/src/sass/crn_app/_common.pagination.scss +0 -41
- package/src/sass/crn_app/_common.papaya.scss +0 -348
- package/src/sass/crn_app/_common.progress-bar.scss +0 -26
- package/src/sass/crn_app/_common.spinner.scss +0 -63
- package/src/sass/crn_app/_common.status.scss +0 -103
- package/src/sass/crn_app/_common.tooltip.scss +0 -22
- package/src/sass/crn_app/_common.typeahead.scss +0 -31
- package/src/sass/crn_app/_common.variables.scss +0 -16
- package/src/sass/crn_app/_dashboard.datasets.scss +0 -588
- package/src/sass/crn_app/_dataset.comments.scss +0 -201
- package/src/sass/crn_app/_dataset.dataset.scss +0 -161
- package/src/sass/crn_app/_dataset.file-tree.scss +0 -277
- package/src/sass/crn_app/_dataset.jobs.scss +0 -701
- package/src/sass/crn_app/_dataset.sidebar.scss +0 -265
- package/src/sass/crn_app/_dataset.tools.scss +0 -118
- package/src/sass/crn_app/_elements-wrappers.scss +0 -870
- package/src/sass/crn_app/_faq.scss +0 -37
- package/src/sass/crn_app/_frontPage.scss +0 -569
- package/src/sass/crn_app/_nav.navbar.scss +0 -387
- package/src/sass/crn_app/_theme.scss +0 -87
- package/src/sass/crn_app/_upload.upload.scss +0 -393
- package/src/sass/crn_app/_upload.validation.scss +0 -210
- package/src/sass/draft/draft.scss +0 -11
- package/src/sass/draft/rich-editor.scss +0 -73
- package/src/sass/font-awesome/_animated.scss +0 -34
- package/src/sass/font-awesome/_bordered-pulled.scss +0 -25
- package/src/sass/font-awesome/_core.scss +0 -12
- package/src/sass/font-awesome/_fixed-width.scss +0 -6
- package/src/sass/font-awesome/_font-awesome.scss +0 -17
- package/src/sass/font-awesome/_icons.scss +0 -697
- package/src/sass/font-awesome/_larger.scss +0 -13
- package/src/sass/font-awesome/_list.scss +0 -19
- package/src/sass/font-awesome/_mixins.scss +0 -26
- package/src/sass/font-awesome/_path.scss +0 -15
- package/src/sass/font-awesome/_rotated-flipped.scss +0 -20
- package/src/sass/font-awesome/_stacked.scss +0 -20
- package/src/sass/font-awesome/_variables.scss +0 -713
- package/src/sass/main.scss +0 -317
- package/src/sass/pre-refactor-with-wrapper-main.scss +0 -1549
- package/src/scripts/admin/__tests__/__snapshots__/exports.spec.jsx.snap +0 -112
- package/src/scripts/admin/__tests__/exports.spec.jsx +0 -15
- package/src/scripts/admin/__tests__/users.spec.jsx +0 -15
- package/src/scripts/admin/admin.jsx +0 -53
- package/src/scripts/admin/flagged-files.jsx +0 -178
- package/src/scripts/admin/user-fragment.ts +0 -14
- package/src/scripts/admin/user-tools.tsx +0 -83
- package/src/scripts/admin/users.jsx +0 -224
- package/src/scripts/authentication/admin-user.jsx +0 -23
- package/src/scripts/authentication/buttons.jsx +0 -26
- package/src/scripts/authentication/globus-button.jsx +0 -39
- package/src/scripts/authentication/google-button.jsx +0 -32
- package/src/scripts/authentication/logged-in.jsx +0 -12
- package/src/scripts/authentication/logged-out.jsx +0 -12
- package/src/scripts/authentication/loginCheck.js +0 -7
- package/src/scripts/authentication/orcid-button.jsx +0 -32
- package/src/scripts/authentication/withProfile.jsx +0 -22
- package/src/scripts/classic.tsx +0 -18
- package/src/scripts/common/forms/file-select.tsx +0 -71
- package/src/scripts/common/partials/__tests__/__snapshots__/footer.spec.jsx.snap +0 -42
- package/src/scripts/common/partials/__tests__/__snapshots__/metric.spec.jsx.snap +0 -101
- package/src/scripts/common/partials/__tests__/footer.spec.jsx +0 -10
- package/src/scripts/common/partials/__tests__/metric.spec.jsx +0 -31
- package/src/scripts/common/partials/footer.jsx +0 -40
- package/src/scripts/common/partials/login.jsx +0 -99
- package/src/scripts/common/partials/metric.jsx +0 -73
- package/src/scripts/common/partials/spinner.jsx +0 -34
- package/src/scripts/common/partials/status.jsx +0 -96
- package/src/scripts/common/partials/timeout.jsx +0 -47
- package/src/scripts/common/partials/tooltip.jsx +0 -36
- package/src/scripts/components/__tests__/dropdown-button.spec.tsx +0 -49
- package/src/scripts/components/dropdown-button.tsx +0 -42
- package/src/scripts/components/feature-toggle.tsx +0 -19
- package/src/scripts/components/panel-group.tsx +0 -24
- package/src/scripts/components/panel.tsx +0 -42
- package/src/scripts/datalad/__tests__/snapshotVersion.spec.js +0 -21
- package/src/scripts/datalad/comments/__tests__/comment-editor.spec.jsx +0 -19
- package/src/scripts/datalad/comments/block-style-controls.jsx +0 -46
- package/src/scripts/datalad/comments/comment-editor.jsx +0 -79
- package/src/scripts/datalad/comments/inline-style-controls.jsx +0 -34
- package/src/scripts/datalad/comments/style-button.jsx +0 -28
- package/src/scripts/datalad/dashboard/__tests__/__snapshots__/dashboard.spec.jsx.snap +0 -163
- package/src/scripts/datalad/dashboard/__tests__/dashboard.spec.jsx +0 -21
- package/src/scripts/datalad/dashboard/dashboard.jsx +0 -54
- package/src/scripts/datalad/dashboard/datasets/__tests__/__snapshots__/dataset-filter.spec.jsx.snap +0 -20
- package/src/scripts/datalad/dashboard/datasets/__tests__/__snapshots__/dataset-row-skeleton.spec.jsx.snap +0 -13
- package/src/scripts/datalad/dashboard/datasets/__tests__/__snapshots__/dataset-row.spec.jsx.snap +0 -65
- package/src/scripts/datalad/dashboard/datasets/__tests__/__snapshots__/dataset-sorter.spec.jsx.snap +0 -14
- package/src/scripts/datalad/dashboard/datasets/__tests__/__snapshots__/dataset-virtual-scroller.spec.jsx.snap +0 -17
- package/src/scripts/datalad/dashboard/datasets/__tests__/__snapshots__/uploaded.spec.jsx.snap +0 -27
- package/src/scripts/datalad/dashboard/datasets/__tests__/dataset-filter.spec.jsx +0 -67
- package/src/scripts/datalad/dashboard/datasets/__tests__/dataset-query.spec.jsx +0 -72
- package/src/scripts/datalad/dashboard/datasets/__tests__/dataset-row-skeleton.spec.jsx +0 -9
- package/src/scripts/datalad/dashboard/datasets/__tests__/dataset-row.spec.jsx +0 -53
- package/src/scripts/datalad/dashboard/datasets/__tests__/dataset-sorter.spec.jsx +0 -69
- package/src/scripts/datalad/dashboard/datasets/__tests__/dataset-virtual-scroller.spec.jsx +0 -65
- package/src/scripts/datalad/dashboard/datasets/__tests__/uploaded.spec.jsx +0 -17
- package/src/scripts/datalad/dashboard/datasets/dataset-filter.jsx +0 -78
- package/src/scripts/datalad/dashboard/datasets/dataset-query.jsx +0 -102
- package/src/scripts/datalad/dashboard/datasets/dataset-row-error-boundary.jsx +0 -52
- package/src/scripts/datalad/dashboard/datasets/dataset-row-skeleton.jsx +0 -10
- package/src/scripts/datalad/dashboard/datasets/dataset-row.jsx +0 -58
- package/src/scripts/datalad/dashboard/datasets/dataset-sorter.jsx +0 -148
- package/src/scripts/datalad/dashboard/datasets/dataset-statuses.jsx +0 -44
- package/src/scripts/datalad/dashboard/datasets/dataset-tab.jsx +0 -192
- package/src/scripts/datalad/dashboard/datasets/dataset-virtual-scroller.jsx +0 -126
- package/src/scripts/datalad/dashboard/datasets/row-height.jsx +0 -7
- package/src/scripts/datalad/dashboard/datasets/uploaded.jsx +0 -33
- package/src/scripts/datalad/dataset/__tests__/__snapshots__/comments.spec.jsx.snap +0 -137
- package/src/scripts/datalad/dataset/__tests__/__snapshots__/dataset-page.spec.jsx.snap +0 -69
- package/src/scripts/datalad/dataset/__tests__/__snapshots__/dataset-query.spec.jsx.snap +0 -15
- package/src/scripts/datalad/dataset/__tests__/__snapshots__/left-siderbar.spec.jsx.snap +0 -85
- package/src/scripts/datalad/dataset/__tests__/dataset-page.spec.jsx +0 -33
- package/src/scripts/datalad/dataset/__tests__/dataset-query.spec.jsx +0 -20
- package/src/scripts/datalad/dataset/__tests__/left-siderbar.spec.jsx +0 -106
- package/src/scripts/datalad/dataset/comment.jsx +0 -90
- package/src/scripts/datalad/dataset/comments.jsx +0 -83
- package/src/scripts/datalad/dataset/dataset-description.jsx +0 -111
- package/src/scripts/datalad/dataset/dataset-main.jsx +0 -29
- package/src/scripts/datalad/dataset/dataset-page.jsx +0 -63
- package/src/scripts/datalad/dataset/dataset-query.jsx +0 -192
- package/src/scripts/datalad/dataset/dataset.jsx +0 -22
- package/src/scripts/datalad/dataset/delete-page.tsx +0 -92
- package/src/scripts/datalad/dataset/left-sidebar.jsx +0 -109
- package/src/scripts/datalad/download/__tests__/__snapshots__/download-dataset.spec.jsx.snap +0 -7
- package/src/scripts/datalad/download/__tests__/__snapshots__/download-tool.spec.jsx.snap +0 -26
- package/src/scripts/datalad/download/__tests__/download-dataset.spec.jsx +0 -19
- package/src/scripts/datalad/download/__tests__/download-tool.spec.jsx +0 -19
- package/src/scripts/datalad/download/download-command-line.jsx +0 -43
- package/src/scripts/datalad/download/download-datalad.jsx +0 -58
- package/src/scripts/datalad/download/download-dataset.jsx +0 -61
- package/src/scripts/datalad/download/download-link.jsx +0 -41
- package/src/scripts/datalad/download/download-native.js +0 -118
- package/src/scripts/datalad/download/download-query.js +0 -22
- package/src/scripts/datalad/download/download-s3.jsx +0 -46
- package/src/scripts/datalad/download/download-tool.jsx +0 -44
- package/src/scripts/datalad/download/native-file-toast.jsx +0 -90
- package/src/scripts/datalad/download/shell-example.jsx +0 -9
- package/src/scripts/datalad/download/track-download.js +0 -15
- package/src/scripts/datalad/fragments/__tests__/__snapshots__/cancel-button.spec.jsx.snap +0 -21
- package/src/scripts/datalad/fragments/__tests__/__snapshots__/dataset-analytics.spec.jsx.snap +0 -41
- package/src/scripts/datalad/fragments/__tests__/__snapshots__/dataset-authors.spec.jsx.snap +0 -13
- package/src/scripts/datalad/fragments/__tests__/__snapshots__/dataset-readme.spec.jsx.snap +0 -49
- package/src/scripts/datalad/fragments/__tests__/__snapshots__/dataset-title.spec.jsx.snap +0 -7
- package/src/scripts/datalad/fragments/__tests__/__snapshots__/dataset-tools.spec.jsx.snap +0 -346
- package/src/scripts/datalad/fragments/__tests__/__snapshots__/dataset-uploaded.spec.jsx.snap +0 -7
- package/src/scripts/datalad/fragments/__tests__/__snapshots__/edit-button.spec.jsx.snap +0 -21
- package/src/scripts/datalad/fragments/__tests__/__snapshots__/edit-list.spec.jsx.snap +0 -34
- package/src/scripts/datalad/fragments/__tests__/__snapshots__/edit-readme.spec.jsx.snap +0 -3
- package/src/scripts/datalad/fragments/__tests__/__snapshots__/save-button.spec.jsx.snap +0 -21
- package/src/scripts/datalad/fragments/__tests__/dataset-analytics.spec.jsx +0 -16
- package/src/scripts/datalad/fragments/__tests__/dataset-authors.spec.jsx +0 -22
- package/src/scripts/datalad/fragments/__tests__/dataset-prominent-links.spec.jsx +0 -32
- package/src/scripts/datalad/fragments/__tests__/dataset-readme.spec.jsx +0 -10
- package/src/scripts/datalad/fragments/__tests__/dataset-summary.spec.jsx +0 -55
- package/src/scripts/datalad/fragments/__tests__/dataset-title.spec.jsx +0 -10
- package/src/scripts/datalad/fragments/__tests__/dataset-tools.spec.jsx +0 -55
- package/src/scripts/datalad/fragments/__tests__/dataset-uploaded.spec.jsx +0 -16
- package/src/scripts/datalad/fragments/__tests__/edit-list.spec.jsx +0 -25
- package/src/scripts/datalad/fragments/__tests__/edit-readme.spec.jsx +0 -10
- package/src/scripts/datalad/fragments/cancel-button.jsx +0 -24
- package/src/scripts/datalad/fragments/copyable-tooltip.jsx +0 -82
- package/src/scripts/datalad/fragments/dataset-analytics.jsx +0 -27
- package/src/scripts/datalad/fragments/dataset-authors.jsx +0 -16
- package/src/scripts/datalad/fragments/dataset-citation.jsx +0 -77
- package/src/scripts/datalad/fragments/dataset-files.jsx +0 -50
- package/src/scripts/datalad/fragments/dataset-git-access.jsx +0 -56
- package/src/scripts/datalad/fragments/dataset-git-hash.jsx +0 -27
- package/src/scripts/datalad/fragments/dataset-history.jsx +0 -95
- package/src/scripts/datalad/fragments/dataset-modified.jsx +0 -17
- package/src/scripts/datalad/fragments/dataset-prominent-links.jsx +0 -129
- package/src/scripts/datalad/fragments/dataset-readme.jsx +0 -42
- package/src/scripts/datalad/fragments/dataset-summary.jsx +0 -230
- package/src/scripts/datalad/fragments/dataset-title.jsx +0 -10
- package/src/scripts/datalad/fragments/dataset-tools.jsx +0 -190
- package/src/scripts/datalad/fragments/dataset-uploaded.jsx +0 -25
- package/src/scripts/datalad/fragments/edit-button.jsx +0 -24
- package/src/scripts/datalad/fragments/edit-description-field.jsx +0 -54
- package/src/scripts/datalad/fragments/edit-description-list.jsx +0 -49
- package/src/scripts/datalad/fragments/edit-list.jsx +0 -82
- package/src/scripts/datalad/fragments/edit-readme.jsx +0 -44
- package/src/scripts/datalad/fragments/incomplete-dataset.jsx +0 -23
- package/src/scripts/datalad/fragments/metadata-tool.jsx +0 -34
- package/src/scripts/datalad/fragments/number-input.tsx +0 -126
- package/src/scripts/datalad/fragments/save-button.jsx +0 -24
- package/src/scripts/datalad/fragments/select-input.tsx +0 -247
- package/src/scripts/datalad/fragments/share-dataset-button.jsx +0 -32
- package/src/scripts/datalad/fragments/text-array-input.tsx +0 -119
- package/src/scripts/datalad/fragments/text-input.tsx +0 -206
- package/src/scripts/datalad/mutations/__tests__/__snapshots__/comment.spec.jsx.snap +0 -5
- package/src/scripts/datalad/mutations/__tests__/__snapshots__/delete.spec.jsx.snap +0 -181
- package/src/scripts/datalad/mutations/__tests__/__snapshots__/manage-permissions.spec.jsx.snap +0 -361
- package/src/scripts/datalad/mutations/__tests__/__snapshots__/subscribe-to-newsletter.spec.jsx.snap +0 -83
- package/src/scripts/datalad/mutations/__tests__/__snapshots__/update-file.spec.jsx.snap +0 -25
- package/src/scripts/datalad/mutations/__tests__/__snapshots__/update-permissions.spec.jsx.snap +0 -361
- package/src/scripts/datalad/mutations/__tests__/comment.spec.jsx +0 -154
- package/src/scripts/datalad/mutations/__tests__/manage-permissions.spec.jsx +0 -21
- package/src/scripts/datalad/mutations/__tests__/subscribe-to-newsletter.spec.jsx +0 -10
- package/src/scripts/datalad/mutations/__tests__/update-file.spec.jsx +0 -15
- package/src/scripts/datalad/mutations/__tests__/update-permissions.spec.jsx +0 -21
- package/src/scripts/datalad/mutations/add-metadata.jsx +0 -164
- package/src/scripts/datalad/mutations/comment.jsx +0 -164
- package/src/scripts/datalad/mutations/delete-dataset-form.jsx +0 -82
- package/src/scripts/datalad/mutations/description.jsx +0 -129
- package/src/scripts/datalad/mutations/flag-annex-object.jsx +0 -62
- package/src/scripts/datalad/mutations/metadata-form.jsx +0 -388
- package/src/scripts/datalad/mutations/readme.jsx +0 -53
- package/src/scripts/datalad/mutations/remove-annex-object.jsx +0 -71
- package/src/scripts/datalad/mutations/subscribe-to-newsletter.jsx +0 -26
- package/src/scripts/datalad/mutations/update-file.jsx +0 -51
- package/src/scripts/datalad/routes/__tests__/__snapshots__/manage-permissions.spec.jsx.snap +0 -159
- package/src/scripts/datalad/routes/__tests__/__snapshots__/snapshot.spec.jsx.snap +0 -31
- package/src/scripts/datalad/routes/__tests__/dataset-content.spec.jsx +0 -108
- package/src/scripts/datalad/routes/__tests__/file-display.spec.jsx +0 -22
- package/src/scripts/datalad/routes/__tests__/manage-permissions.spec.jsx +0 -101
- package/src/scripts/datalad/routes/__tests__/snapshot.spec.jsx +0 -49
- package/src/scripts/datalad/routes/admin-datalad.jsx +0 -45
- package/src/scripts/datalad/routes/admin-exports.jsx +0 -125
- package/src/scripts/datalad/routes/dataset-content.jsx +0 -198
- package/src/scripts/datalad/routes/dataset-routes.jsx +0 -162
- package/src/scripts/datalad/routes/file-display.jsx +0 -84
- package/src/scripts/datalad/routes/manage-permissions.jsx +0 -128
- package/src/scripts/datalad/routes/snapshot-content.jsx +0 -135
- package/src/scripts/datalad/routes/snapshot.jsx +0 -131
- package/src/scripts/datalad/snapshotVersion.js +0 -7
- package/src/scripts/datalad/validation/validation-panel.jsx +0 -48
- package/src/scripts/datalad/validation/validation-status.jsx +0 -120
- package/src/scripts/datalad/validation/validation.jsx +0 -40
- package/src/scripts/dataset/dataset.metrics.jsx +0 -61
- package/src/scripts/file-tree/__tests__/__snapshots__/file-tree-unloaded-directory.spec.jsx.snap +0 -26
- package/src/scripts/file-tree/__tests__/__snapshots__/file-tree.spec.jsx.snap +0 -18
- package/src/scripts/file-tree/__tests__/__snapshots__/file.spec.jsx.snap +0 -81
- package/src/scripts/file-tree/__tests__/file-tree-loading.spec.jsx +0 -18
- package/src/scripts/file-tree/__tests__/file-tree-unloaded-directory.spec.jsx +0 -74
- package/src/scripts/file-tree/__tests__/file-tree.spec.jsx +0 -94
- package/src/scripts/file-tree/__tests__/file-viewer-type.spec.jsx +0 -15
- package/src/scripts/file-tree/__tests__/file.spec.jsx +0 -44
- package/src/scripts/file-tree/__tests__/flat-to-tree.spec.js +0 -55
- package/src/scripts/file-tree/file-tree-loading.jsx +0 -64
- package/src/scripts/file-tree/file-tree-unloaded-directory.jsx +0 -108
- package/src/scripts/file-tree/file-tree.jsx +0 -133
- package/src/scripts/file-tree/file-view.jsx +0 -31
- package/src/scripts/file-tree/file-viewer-type.jsx +0 -45
- package/src/scripts/file-tree/file.jsx +0 -123
- package/src/scripts/file-tree/files.jsx +0 -126
- package/src/scripts/file-tree/flat-to-tree.js +0 -49
- package/src/scripts/file-tree/viewers/__tests__/__snapshots__/file-viewer-json.spec.jsx.snap +0 -51
- package/src/scripts/file-tree/viewers/__tests__/file-viewer-json.spec.jsx +0 -15
- package/src/scripts/file-tree/viewers/__tests__/parse-tabular.spec.js +0 -24
- package/src/scripts/file-tree/viewers/file-viewer-csv.jsx +0 -16
- package/src/scripts/file-tree/viewers/file-viewer-html.jsx +0 -20
- package/src/scripts/file-tree/viewers/file-viewer-json.jsx +0 -50
- package/src/scripts/file-tree/viewers/file-viewer-nifti.jsx +0 -11
- package/src/scripts/file-tree/viewers/file-viewer-table.jsx +0 -34
- package/src/scripts/file-tree/viewers/file-viewer-text.jsx +0 -13
- package/src/scripts/file-tree/viewers/file-viewer-tsv.jsx +0 -16
- package/src/scripts/file-tree/viewers/parse-tabular.js +0 -18
- package/src/scripts/front-page/__tests__/__snapshots__/email-subscription-box.spec.jsx.snap +0 -190
- package/src/scripts/front-page/__tests__/__snapshots__/front-page-stats.spec.jsx.snap +0 -29
- package/src/scripts/front-page/__tests__/__snapshots__/front-page-top-datasets.spec.jsx.snap +0 -464
- package/src/scripts/front-page/__tests__/dataset-count.spec.jsx +0 -33
- package/src/scripts/front-page/__tests__/email-subscription-box.spec.jsx +0 -57
- package/src/scripts/front-page/__tests__/front-page-stats.spec.jsx +0 -10
- package/src/scripts/front-page/__tests__/front-page-top-datasets.spec.jsx +0 -27
- package/src/scripts/front-page/__tests__/participant-count.spec.jsx +0 -31
- package/src/scripts/front-page/dataset-count.jsx +0 -29
- package/src/scripts/front-page/email-subscription-box.jsx +0 -131
- package/src/scripts/front-page/front-page-additional-info.jsx +0 -15
- package/src/scripts/front-page/front-page-collaborators.jsx +0 -117
- package/src/scripts/front-page/front-page-stats.jsx +0 -71
- package/src/scripts/front-page/front-page-support.jsx +0 -30
- package/src/scripts/front-page/front-page-tabs.jsx +0 -166
- package/src/scripts/front-page/front-page-top-datasets.jsx +0 -203
- package/src/scripts/front-page/front-page.jsx +0 -95
- package/src/scripts/front-page/participant-count.jsx +0 -25
- package/src/scripts/hooks/use-measure.js +0 -15
- package/src/scripts/hooks/use-previous.js +0 -7
- package/src/scripts/index.jsx +0 -16
- package/src/scripts/nav/assets/brand_mark.png +0 -0
- package/src/scripts/nav/assets/favicon-upload.png +0 -0
- package/src/scripts/nav/assets/logo_app.png +0 -0
- package/src/scripts/nav/navbar.jsx +0 -144
- package/src/scripts/nav/navbar.navmenu.jsx +0 -106
- package/src/scripts/nav/navbar.usermenu.jsx +0 -52
- package/src/scripts/pages/citation-page.jsx +0 -43
- package/src/scripts/pet/__tests__/__snapshots__/dummy.spec.jsx.snap +0 -70
- package/src/scripts/pet/__tests__/dummy.spec.jsx +0 -10
- package/src/scripts/pet/dummy.jsx +0 -61
- package/src/scripts/refactor_2021/dataset/dataset-pre-refactor-container.tsx +0 -12
- package/src/scripts/refactor_2021/dataset/routes/download-dataset.jsx +0 -70
- package/src/scripts/refactor_2021/redesign-form.jsx +0 -427
- package/src/scripts/routes.tsx +0 -36
- package/src/scripts/search/search-input.tsx +0 -42
- package/src/scripts/search/search-results.tsx +0 -114
- package/src/scripts/styles/capitalized.jsx +0 -6
- package/src/scripts/styles/uppercase.jsx +0 -6
- package/src/scripts/uploader/__tests__/add-path-to-files.spec.js +0 -29
- package/src/scripts/uploader/__tests__/file-upload.spec.js +0 -116
- package/src/scripts/uploader/__tests__/upload-disclaimer.spec.jsx +0 -67
- package/src/scripts/uploader/__tests__/upload-mutation.spec.js +0 -57
- package/src/scripts/uploader/__tests__/uploader.spec.js +0 -31
- package/src/scripts/uploader/add-path-to-files.js +0 -19
- package/src/scripts/uploader/file-upload.js +0 -88
- package/src/scripts/uploader/upload-button.jsx +0 -18
- package/src/scripts/uploader/upload-disclaimer.jsx +0 -92
- package/src/scripts/uploader/upload-file-status.jsx +0 -20
- package/src/scripts/uploader/upload-issues.jsx +0 -131
- package/src/scripts/uploader/upload-metadata.jsx +0 -59
- package/src/scripts/uploader/upload-mutation.js +0 -111
- package/src/scripts/uploader/upload-progress-button.jsx +0 -20
- package/src/scripts/uploader/upload-progress-class.js +0 -36
- package/src/scripts/uploader/upload-progress.jsx +0 -15
- package/src/scripts/uploader/upload-rename.jsx +0 -33
- package/src/scripts/uploader/upload-resume.jsx +0 -35
- package/src/scripts/uploader/upload-select.jsx +0 -29
- package/src/scripts/uploader/upload-status.jsx +0 -23
- package/src/scripts/uploader/upload-step.jsx +0 -48
- package/src/scripts/uploader/uploader-context.js +0 -6
- package/src/scripts/uploader/uploader-location.js +0 -5
- package/src/scripts/uploader/uploader-modal.jsx +0 -27
- package/src/scripts/uploader/uploader-setup-routes.jsx +0 -52
- package/src/scripts/uploader/uploader-status-routes.jsx +0 -30
- package/src/scripts/uploader/uploader-view.jsx +0 -45
- package/src/scripts/uploader/uploader.jsx +0 -388
- package/src/scripts/user/__mocks__/user.store.js +0 -1
- package/src/scripts/user/api.jsx +0 -132
- package/src/scripts/user/avatar.jsx +0 -40
- package/src/scripts/utils/crn.js +0 -15
- package/src/scripts/utils/request.js +0 -107
- package/src/scripts/utils/user.js +0 -18
- package/src/scripts/validation/validation-results.issues.issue.jsx +0 -90
- package/src/scripts/validation/validation-results.issues.jsx +0 -79
- package/src/scripts/validation/validation-results.jsx +0 -96
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { shallow } from 'enzyme'
|
|
3
|
-
import { SortField } from '../dataset-sorter.jsx'
|
|
4
|
-
|
|
5
|
-
describe('dashboard/datasets/DatasetSorter', () => {
|
|
6
|
-
describe('SortField', () => {
|
|
7
|
-
it('renders successfully', () => {
|
|
8
|
-
expect(
|
|
9
|
-
shallow(<SortField field="created" queryVariables={{ orderBy: {} }} />),
|
|
10
|
-
).toMatchSnapshot()
|
|
11
|
-
})
|
|
12
|
-
it('calls refetch on click', () => {
|
|
13
|
-
const refetch = jest.fn()
|
|
14
|
-
const wrapper = shallow(
|
|
15
|
-
<SortField
|
|
16
|
-
field="created"
|
|
17
|
-
queryVariables={{ orderBy: {} }}
|
|
18
|
-
refetch={refetch}
|
|
19
|
-
/>,
|
|
20
|
-
)
|
|
21
|
-
wrapper.simulate('click')
|
|
22
|
-
expect(refetch).toHaveBeenCalled()
|
|
23
|
-
})
|
|
24
|
-
it('switches ascending to descending field when clicked', () => {
|
|
25
|
-
const refetch = jest.fn()
|
|
26
|
-
const wrapper = shallow(
|
|
27
|
-
<SortField
|
|
28
|
-
field="created"
|
|
29
|
-
queryVariables={{ orderBy: { created: 'ascending' } }}
|
|
30
|
-
refetch={refetch}
|
|
31
|
-
/>,
|
|
32
|
-
)
|
|
33
|
-
wrapper.simulate('click')
|
|
34
|
-
expect(refetch).toHaveBeenCalledWith({
|
|
35
|
-
orderBy: { created: 'descending' },
|
|
36
|
-
})
|
|
37
|
-
})
|
|
38
|
-
it('switches to a new sort field when clicked', () => {
|
|
39
|
-
const refetch = jest.fn()
|
|
40
|
-
const wrapper = shallow(
|
|
41
|
-
<SortField
|
|
42
|
-
field="stars"
|
|
43
|
-
queryVariables={{ orderBy: { created: 'ascending' } }}
|
|
44
|
-
refetch={refetch}
|
|
45
|
-
/>,
|
|
46
|
-
)
|
|
47
|
-
wrapper.simulate('click')
|
|
48
|
-
expect(refetch).toHaveBeenCalledWith({ orderBy: { stars: 'descending' } })
|
|
49
|
-
})
|
|
50
|
-
it('preserves unrelated fields when clicked', () => {
|
|
51
|
-
const refetch = jest.fn()
|
|
52
|
-
const wrapper = shallow(
|
|
53
|
-
<SortField
|
|
54
|
-
field="created"
|
|
55
|
-
queryVariables={{
|
|
56
|
-
orderBy: { created: 'ascending' },
|
|
57
|
-
filterBy: { public: true },
|
|
58
|
-
}}
|
|
59
|
-
refetch={refetch}
|
|
60
|
-
/>,
|
|
61
|
-
)
|
|
62
|
-
wrapper.simulate('click')
|
|
63
|
-
expect(refetch).toHaveBeenCalledWith({
|
|
64
|
-
orderBy: { created: 'descending' },
|
|
65
|
-
filterBy: { public: true },
|
|
66
|
-
})
|
|
67
|
-
})
|
|
68
|
-
})
|
|
69
|
-
})
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { shallow } from 'enzyme'
|
|
3
|
-
import DatasetVirtualScroller from '../dataset-virtual-scroller.jsx'
|
|
4
|
-
|
|
5
|
-
const defProps = {
|
|
6
|
-
datasets: [{ id: 1 }, { id: 2 }, { id: 3 }],
|
|
7
|
-
pageInfo: {
|
|
8
|
-
count: 3,
|
|
9
|
-
},
|
|
10
|
-
loadMoreRows: jest.fn(),
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
describe('dashboard/datasets/DatasetVirtualScroller', () => {
|
|
14
|
-
it('shallow renders successfully', () => {
|
|
15
|
-
expect(shallow(<DatasetVirtualScroller {...defProps} />)).toMatchSnapshot()
|
|
16
|
-
})
|
|
17
|
-
describe('_isRowLoaded()', () => {
|
|
18
|
-
it('is bounded to pageInfo.count', () => {
|
|
19
|
-
const wrapper = shallow(<DatasetVirtualScroller {...defProps} />)
|
|
20
|
-
const instance = wrapper.instance()
|
|
21
|
-
expect(instance._isRowLoaded({ index: 0 })).toBe(true)
|
|
22
|
-
expect(instance._isRowLoaded({ index: 5 })).toBe(false)
|
|
23
|
-
expect(instance._isRowLoaded({ index: 2 })).toBe(true)
|
|
24
|
-
})
|
|
25
|
-
})
|
|
26
|
-
describe('shouldComponentUpdate()', () => {
|
|
27
|
-
it('returns true with different dataset counts', () => {
|
|
28
|
-
const wrapper = shallow(<DatasetVirtualScroller {...defProps} />)
|
|
29
|
-
const instance = wrapper.instance()
|
|
30
|
-
expect(instance.shouldComponentUpdate({ datasets: [] })).toBe(true)
|
|
31
|
-
})
|
|
32
|
-
it('returns true with the same list sorted differently', () => {
|
|
33
|
-
const wrapper = shallow(<DatasetVirtualScroller {...defProps} />)
|
|
34
|
-
const instance = wrapper.instance()
|
|
35
|
-
expect(
|
|
36
|
-
instance.shouldComponentUpdate({
|
|
37
|
-
datasets: [
|
|
38
|
-
defProps.datasets[1],
|
|
39
|
-
defProps.datasets[0],
|
|
40
|
-
defProps.datasets[2],
|
|
41
|
-
],
|
|
42
|
-
}),
|
|
43
|
-
).toBe(true)
|
|
44
|
-
})
|
|
45
|
-
it('returns false for the same list', () => {
|
|
46
|
-
const wrapper = shallow(<DatasetVirtualScroller {...defProps} />)
|
|
47
|
-
const instance = wrapper.instance()
|
|
48
|
-
expect(
|
|
49
|
-
instance.shouldComponentUpdate({
|
|
50
|
-
datasets: [...defProps.datasets],
|
|
51
|
-
}),
|
|
52
|
-
).toBe(false)
|
|
53
|
-
})
|
|
54
|
-
it('returns false for the same list if another prop changes', () => {
|
|
55
|
-
const wrapper = shallow(<DatasetVirtualScroller {...defProps} />)
|
|
56
|
-
const instance = wrapper.instance()
|
|
57
|
-
expect(
|
|
58
|
-
instance.shouldComponentUpdate({
|
|
59
|
-
datasets: [...defProps.datasets],
|
|
60
|
-
loadMoreRows: jest.fn(),
|
|
61
|
-
}),
|
|
62
|
-
).toBe(false)
|
|
63
|
-
})
|
|
64
|
-
})
|
|
65
|
-
})
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { shallow } from 'enzyme'
|
|
3
|
-
import Uploaded from '../uploaded.jsx'
|
|
4
|
-
|
|
5
|
-
const defProps = {
|
|
6
|
-
uploader: {
|
|
7
|
-
name: 'A User',
|
|
8
|
-
},
|
|
9
|
-
created: null, // Avoid testing the current date
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
describe('dashboard/datasets/Uploaded', () => {
|
|
13
|
-
it('renders successfully', () => {
|
|
14
|
-
const wrapper = shallow(<Uploaded {...defProps} />)
|
|
15
|
-
expect(wrapper).toMatchSnapshot()
|
|
16
|
-
})
|
|
17
|
-
})
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import PropTypes from 'prop-types'
|
|
3
|
-
import { useCookies } from 'react-cookie'
|
|
4
|
-
import Capitalized from '../../../styles/capitalized.jsx'
|
|
5
|
-
import { getProfile } from '../../../refactor_2021/authentication/profile.js'
|
|
6
|
-
|
|
7
|
-
// DatasetFilter GraphQL fields
|
|
8
|
-
const filterFields = ['public', 'shared', 'invalid']
|
|
9
|
-
const filterIcons = {
|
|
10
|
-
public: 'fa-globe',
|
|
11
|
-
shared: 'fa-user',
|
|
12
|
-
invalid: 'fa-exclamation-circle',
|
|
13
|
-
all: 'fa-magic',
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const FilterField = ({ field, queryVariables, refetch }) => {
|
|
17
|
-
const fieldValue =
|
|
18
|
-
field in queryVariables.filterBy && queryVariables.filterBy[field]
|
|
19
|
-
const filterBy = () => {
|
|
20
|
-
const newQueryVariables = { ...queryVariables }
|
|
21
|
-
// Clear existing sorts
|
|
22
|
-
newQueryVariables.filterBy = {}
|
|
23
|
-
// Apply (or toggle) based on previous sort
|
|
24
|
-
newQueryVariables.filterBy[field] =
|
|
25
|
-
queryVariables.filterBy[field] === true ? false : true
|
|
26
|
-
refetch(newQueryVariables)
|
|
27
|
-
}
|
|
28
|
-
const icon = filterIcons[field]
|
|
29
|
-
return (
|
|
30
|
-
<button
|
|
31
|
-
key={field}
|
|
32
|
-
className={
|
|
33
|
-
fieldValue
|
|
34
|
-
? `btn-filter name active filter-${field}`
|
|
35
|
-
: `btn-filter name filter-${field}`
|
|
36
|
-
}
|
|
37
|
-
onClick={filterBy}>
|
|
38
|
-
<Capitalized>
|
|
39
|
-
<i className={`fa ${icon}`} />
|
|
40
|
-
<span className="filter-text">{field}</span>
|
|
41
|
-
</Capitalized>
|
|
42
|
-
</button>
|
|
43
|
-
)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
FilterField.propTypes = {
|
|
47
|
-
field: PropTypes.string,
|
|
48
|
-
queryVariables: PropTypes.object,
|
|
49
|
-
refetch: PropTypes.func,
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const DatasetFilter = ({ queryVariables, refetch }) => {
|
|
53
|
-
const [cookies] = useCookies()
|
|
54
|
-
const profile = getProfile(cookies)
|
|
55
|
-
let fields = filterFields
|
|
56
|
-
if (profile && 'admin' in profile && profile.admin) {
|
|
57
|
-
fields = [...filterFields, 'all']
|
|
58
|
-
}
|
|
59
|
-
return (
|
|
60
|
-
<>
|
|
61
|
-
{fields.map(field => (
|
|
62
|
-
<FilterField
|
|
63
|
-
field={field}
|
|
64
|
-
queryVariables={queryVariables}
|
|
65
|
-
refetch={refetch}
|
|
66
|
-
key={field}
|
|
67
|
-
/>
|
|
68
|
-
))}
|
|
69
|
-
</>
|
|
70
|
-
)
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
DatasetFilter.propTypes = {
|
|
74
|
-
queryVariables: PropTypes.object,
|
|
75
|
-
refetch: PropTypes.func,
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export default DatasetFilter
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
/* eslint react/prop-types: 0, react/display-name: 0 */
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import PropTypes from 'prop-types'
|
|
4
|
-
import { Query } from '@apollo/client/react/components'
|
|
5
|
-
import { datasets } from '@openneuro/client'
|
|
6
|
-
import DatasetTab from './dataset-tab.jsx'
|
|
7
|
-
import ErrorBoundary from '../../../../scripts/errors/errorBoundary.jsx'
|
|
8
|
-
|
|
9
|
-
export const updateQuery = (previousResult, { fetchMoreResult }) => {
|
|
10
|
-
const newEdges = fetchMoreResult.datasets.edges
|
|
11
|
-
const pageInfo = fetchMoreResult.datasets.pageInfo
|
|
12
|
-
return {
|
|
13
|
-
datasets: {
|
|
14
|
-
__typename: previousResult.datasets.__typename,
|
|
15
|
-
edges: [
|
|
16
|
-
...previousResult.datasets.edges,
|
|
17
|
-
...newEdges.filter(
|
|
18
|
-
n =>
|
|
19
|
-
!previousResult.datasets.edges.some(e => e.node.id === n.node.id),
|
|
20
|
-
),
|
|
21
|
-
],
|
|
22
|
-
pageInfo,
|
|
23
|
-
},
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Load additional datasets based on next data cursor
|
|
29
|
-
* @param {object} data Next data cursor
|
|
30
|
-
* @param {function} fetchMore Apollo fetchMore function from the original query
|
|
31
|
-
*/
|
|
32
|
-
export const loadMoreRows = (data, fetchMore) => {
|
|
33
|
-
// Last cursor loaded (the pending promise)
|
|
34
|
-
let loadingCursor
|
|
35
|
-
// Pending promise to chain to if we need to delay a load
|
|
36
|
-
let loadingPromise
|
|
37
|
-
const loadMoreInner = cursor => {
|
|
38
|
-
// Is an update fetch in progress?
|
|
39
|
-
if (loadingCursor !== cursor) {
|
|
40
|
-
// No, start a new fetch
|
|
41
|
-
loadingPromise = fetchMore({
|
|
42
|
-
variables: {
|
|
43
|
-
cursor,
|
|
44
|
-
},
|
|
45
|
-
updateQuery,
|
|
46
|
-
})
|
|
47
|
-
loadingCursor = cursor
|
|
48
|
-
return loadingPromise
|
|
49
|
-
} else {
|
|
50
|
-
// Yes, wait for the previous request to continue
|
|
51
|
-
return loadingPromise.then(({ data }) =>
|
|
52
|
-
loadMoreInner(data.datasets.pageInfo.endCursor),
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return () => loadMoreInner(data.datasets.pageInfo.endCursor)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export const datasetQueryDisplay =
|
|
60
|
-
(isPublic, isSaved) =>
|
|
61
|
-
({ loading, data, fetchMore, refetch, variables, error = null }) => {
|
|
62
|
-
return (
|
|
63
|
-
<DatasetTab
|
|
64
|
-
loading={loading}
|
|
65
|
-
data={data}
|
|
66
|
-
error={error}
|
|
67
|
-
loadMoreRows={
|
|
68
|
-
loading
|
|
69
|
-
? () => {
|
|
70
|
-
/* No op while loading */
|
|
71
|
-
}
|
|
72
|
-
: loadMoreRows(data, fetchMore)
|
|
73
|
-
}
|
|
74
|
-
refetch={refetch}
|
|
75
|
-
queryVariables={variables}
|
|
76
|
-
publicDashboard={isPublic}
|
|
77
|
-
savedDashboard={isSaved}
|
|
78
|
-
/>
|
|
79
|
-
)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const DatasetQuery = ({ public: isPublic, saved: isSaved }) => (
|
|
83
|
-
<ErrorBoundary subject="Error loading dashboard">
|
|
84
|
-
<Query
|
|
85
|
-
query={datasets.getDatasets}
|
|
86
|
-
variables={{
|
|
87
|
-
filterBy: { public: isPublic, starred: isSaved },
|
|
88
|
-
myDatasets: !(isPublic || isSaved),
|
|
89
|
-
}}
|
|
90
|
-
errorPolicy="all"
|
|
91
|
-
fetchPolicy="cache-and-network"
|
|
92
|
-
nextFetchPolicy="cache-first">
|
|
93
|
-
{datasetQueryDisplay(isPublic, isSaved)}
|
|
94
|
-
</Query>
|
|
95
|
-
</ErrorBoundary>
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
DatasetQuery.propTypes = {
|
|
99
|
-
public: PropTypes.bool,
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export default DatasetQuery
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import PropTypes from 'prop-types'
|
|
3
|
-
import RowHeight from './row-height.jsx'
|
|
4
|
-
import { apm } from '../../../apm'
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Don't prevent rendering all of the other results if one has failed to load
|
|
8
|
-
*/
|
|
9
|
-
class DatasetRowErrorBoundary extends React.Component {
|
|
10
|
-
constructor(props) {
|
|
11
|
-
super(props)
|
|
12
|
-
this.state = { hasError: false, eventId: null }
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
static getDerivedStateFromError() {
|
|
16
|
-
return { hasError: true }
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
componentDidCatch(error) {
|
|
20
|
-
apm.captureError(error)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
render() {
|
|
24
|
-
if (this.state.hasError) {
|
|
25
|
-
return (
|
|
26
|
-
<div className="panel panel-default">
|
|
27
|
-
<RowHeight className="panel-heading">
|
|
28
|
-
<div className="header clearfix">
|
|
29
|
-
<h4 className="dataset-title">
|
|
30
|
-
An error occurred while displaying this result
|
|
31
|
-
</h4>
|
|
32
|
-
</div>
|
|
33
|
-
<div className="clearfix minimal-summary">
|
|
34
|
-
<div className="summary-data">
|
|
35
|
-
<strong>If this persists, contact support</strong>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
38
|
-
</RowHeight>
|
|
39
|
-
</div>
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return this.props.children
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
DatasetRowErrorBoundary.propTypes = {
|
|
48
|
-
datasetId: PropTypes.string,
|
|
49
|
-
children: PropTypes.node,
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export default DatasetRowErrorBoundary
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import PropTypes from 'prop-types'
|
|
3
|
-
import Statuses from './dataset-statuses.jsx'
|
|
4
|
-
import Metrics from '../../../dataset/dataset.metrics.jsx'
|
|
5
|
-
import Uploaded from './uploaded.jsx'
|
|
6
|
-
import Summary from '../../fragments/dataset-summary.jsx'
|
|
7
|
-
import { Link } from 'react-router-dom'
|
|
8
|
-
import RowHeight from './row-height.jsx'
|
|
9
|
-
|
|
10
|
-
const sortByDate = (a, b) =>
|
|
11
|
-
new Date(b.created).getTime() - new Date(a.created).getTime()
|
|
12
|
-
|
|
13
|
-
export const genLinkTarget = (dataset, publicDashboard) => {
|
|
14
|
-
const linkTarget = '/datasets/' + dataset.id
|
|
15
|
-
if (dataset.snapshots.length > 0 && publicDashboard) {
|
|
16
|
-
const sortedSnapshots = [...dataset.snapshots].sort(sortByDate)
|
|
17
|
-
const newestSnapshot = sortedSnapshots[0]
|
|
18
|
-
return `${linkTarget}/versions/${newestSnapshot.tag}`
|
|
19
|
-
} else {
|
|
20
|
-
return linkTarget
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
class DatasetRow extends React.Component {
|
|
25
|
-
shouldComponentUpdate(nextProps) {
|
|
26
|
-
return this.props.dataset.id !== nextProps.dataset.id
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
render() {
|
|
30
|
-
const dataset = this.props.dataset
|
|
31
|
-
return (
|
|
32
|
-
<div className="panel panel-default">
|
|
33
|
-
<RowHeight className="panel-heading">
|
|
34
|
-
<div className="header clearfix">
|
|
35
|
-
<Link to={genLinkTarget(dataset, this.props.publicDashboard)}>
|
|
36
|
-
<h4 className="dataset-name">{dataset.draft.description.Name}</h4>
|
|
37
|
-
<Uploaded uploader={dataset.uploader} created={dataset.created} />
|
|
38
|
-
</Link>
|
|
39
|
-
<div className="metric-container">
|
|
40
|
-
<Metrics dataset={dataset} fromDashboard />
|
|
41
|
-
</div>
|
|
42
|
-
<div className="status-container">
|
|
43
|
-
<Statuses dataset={dataset} minimal={true} />
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
<Summary summary={dataset.draft.summary} minimal={true} />
|
|
47
|
-
</RowHeight>
|
|
48
|
-
</div>
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
DatasetRow.propTypes = {
|
|
54
|
-
dataset: PropTypes.object,
|
|
55
|
-
publicDashboard: PropTypes.bool,
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export default DatasetRow
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import PropTypes from 'prop-types'
|
|
3
|
-
import Capitalized from '../../../styles/capitalized.jsx'
|
|
4
|
-
import { Media } from '../../../styles/media'
|
|
5
|
-
|
|
6
|
-
// DatasetSort GraphQL fields
|
|
7
|
-
const sortFields = ['created', 'name', 'stars', 'downloads', 'subscriptions']
|
|
8
|
-
|
|
9
|
-
// Sort fields and variables for mobile dropdown
|
|
10
|
-
const ASC = 'ascending'
|
|
11
|
-
const DESC = 'descending'
|
|
12
|
-
|
|
13
|
-
const sortFieldsMobile = [
|
|
14
|
-
{
|
|
15
|
-
field: 'created',
|
|
16
|
-
order: ASC,
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
field: 'name',
|
|
20
|
-
order: ASC,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
field: 'stars',
|
|
24
|
-
order: ASC,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
field: 'downloads',
|
|
28
|
-
order: ASC,
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
field: 'subscriptions',
|
|
32
|
-
order: ASC,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
field: 'created',
|
|
36
|
-
order: DESC,
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
field: 'name',
|
|
40
|
-
order: DESC,
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
field: 'stars',
|
|
44
|
-
order: DESC,
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
field: 'downloads',
|
|
48
|
-
order: DESC,
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
field: 'subscriptions',
|
|
52
|
-
order: DESC,
|
|
53
|
-
},
|
|
54
|
-
]
|
|
55
|
-
|
|
56
|
-
export const SortField = ({ field, queryVariables, refetch }) => {
|
|
57
|
-
// Disable sorts that are not in the original query
|
|
58
|
-
if (!queryVariables.hasOwnProperty('orderBy')) return null
|
|
59
|
-
const fieldValue =
|
|
60
|
-
field in queryVariables.orderBy && queryVariables.orderBy[field]
|
|
61
|
-
let icon
|
|
62
|
-
if (fieldValue) {
|
|
63
|
-
if (fieldValue === 'ascending') {
|
|
64
|
-
icon = <i className="fa fa-sort-asc" />
|
|
65
|
-
} else {
|
|
66
|
-
icon = <i className="fa fa-sort-desc" />
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
const sortBy = () => {
|
|
70
|
-
const newQueryVariables = { ...queryVariables }
|
|
71
|
-
// Clear existing sorts
|
|
72
|
-
newQueryVariables.orderBy = {}
|
|
73
|
-
// Apply (or toggle) based on previous sort
|
|
74
|
-
newQueryVariables.orderBy[field] =
|
|
75
|
-
queryVariables.orderBy[field] === 'descending'
|
|
76
|
-
? 'ascending'
|
|
77
|
-
: 'descending'
|
|
78
|
-
refetch(newQueryVariables)
|
|
79
|
-
}
|
|
80
|
-
return (
|
|
81
|
-
<a
|
|
82
|
-
key={field}
|
|
83
|
-
className={fieldValue ? 'btn-sort name active' : 'btn-sort name'}
|
|
84
|
-
onClick={sortBy}>
|
|
85
|
-
<Capitalized>{field}</Capitalized> {icon}
|
|
86
|
-
</a>
|
|
87
|
-
)
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
SortField.propTypes = {
|
|
91
|
-
field: PropTypes.string,
|
|
92
|
-
queryVariables: PropTypes.object,
|
|
93
|
-
refetch: PropTypes.func,
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const DatasetSorter = ({ queryVariables, refetch }) => {
|
|
97
|
-
const onChange = event => {
|
|
98
|
-
const newQueryVariables = { ...queryVariables }
|
|
99
|
-
// Clear existing sorts
|
|
100
|
-
newQueryVariables.orderBy = {}
|
|
101
|
-
// grab sort order (custom data attribute) from selected option
|
|
102
|
-
newQueryVariables.orderBy[event.target.value] = event.target[
|
|
103
|
-
event.target.selectedIndex
|
|
104
|
-
].getAttribute('data-order')
|
|
105
|
-
refetch(newQueryVariables)
|
|
106
|
-
}
|
|
107
|
-
return (
|
|
108
|
-
<>
|
|
109
|
-
<Media greaterThanOrEqual="medium">
|
|
110
|
-
<div>
|
|
111
|
-
{sortFields.map(field => (
|
|
112
|
-
<SortField
|
|
113
|
-
field={field}
|
|
114
|
-
queryVariables={queryVariables}
|
|
115
|
-
refetch={refetch}
|
|
116
|
-
key={field}
|
|
117
|
-
/>
|
|
118
|
-
))}
|
|
119
|
-
</div>
|
|
120
|
-
</Media>
|
|
121
|
-
<Media at="small">
|
|
122
|
-
<select
|
|
123
|
-
defaultValue={'DEFAULT'}
|
|
124
|
-
className="mobile-dropdown"
|
|
125
|
-
onChange={onChange}>
|
|
126
|
-
<option value="DEFAULT" disabled>
|
|
127
|
-
Sort by...
|
|
128
|
-
</option>
|
|
129
|
-
{sortFieldsMobile.map((sortField, i) => (
|
|
130
|
-
<option
|
|
131
|
-
value={sortField.field}
|
|
132
|
-
data-order={sortField.order}
|
|
133
|
-
key={`${i}:${sortField.field}`}>
|
|
134
|
-
{`${sortField.field} (${sortField.order})`}
|
|
135
|
-
</option>
|
|
136
|
-
))}
|
|
137
|
-
</select>
|
|
138
|
-
</Media>
|
|
139
|
-
</>
|
|
140
|
-
)
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
DatasetSorter.propTypes = {
|
|
144
|
-
queryVariables: PropTypes.object,
|
|
145
|
-
refetch: PropTypes.func,
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export default DatasetSorter
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// This version of Statuses works with the native GraphQL data structure
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import PropTypes from 'prop-types'
|
|
4
|
-
import Status from '../../../common/partials/status.jsx'
|
|
5
|
-
import withProfile from '../../../authentication/withProfile.jsx'
|
|
6
|
-
|
|
7
|
-
class Statuses extends React.PureComponent {
|
|
8
|
-
// life cycle events --------------------------------------------------
|
|
9
|
-
|
|
10
|
-
render() {
|
|
11
|
-
const uploading = false
|
|
12
|
-
const dataset = this.props.dataset
|
|
13
|
-
const minimal = this.props.minimal
|
|
14
|
-
const profile = this.props.profile
|
|
15
|
-
const uploaderSubscribed = dataset.followers.some(
|
|
16
|
-
follower => follower.userId === dataset.uploader.id,
|
|
17
|
-
)
|
|
18
|
-
const invalid =
|
|
19
|
-
!dataset.draft.issues ||
|
|
20
|
-
dataset.draft.issues.some(issue => issue.severity === 'error')
|
|
21
|
-
const shared = !dataset.public && dataset.uploader.id !== profile.sub
|
|
22
|
-
return (
|
|
23
|
-
<span className="status-wrap">
|
|
24
|
-
<Status type="public" minimal={minimal} display={dataset.public} />
|
|
25
|
-
<Status type="shared" minimal={minimal} display={shared} />
|
|
26
|
-
<Status type="inProgress" minimal={minimal} display={uploading} />
|
|
27
|
-
<Status type="invalid" minimal={minimal} display={invalid && minimal} />
|
|
28
|
-
<Status type="monitored" display={uploaderSubscribed && !minimal} />
|
|
29
|
-
</span>
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
Statuses.defaultProps = {
|
|
35
|
-
minimal: false,
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
Statuses.propTypes = {
|
|
39
|
-
dataset: PropTypes.object,
|
|
40
|
-
profile: PropTypes.object,
|
|
41
|
-
minimal: PropTypes.bool,
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export default withProfile(Statuses)
|