@openneuro/app 4.1.2 → 4.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +13 -22
- 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 +4 -2
- 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,190 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import PropTypes from 'prop-types'
|
|
3
|
-
import { useHistory, useLocation } from 'react-router-dom'
|
|
4
|
-
import { useCookies } from 'react-cookie'
|
|
5
|
-
import snapshotVersion from '../snapshotVersion.js'
|
|
6
|
-
import WarnButton from '../../common/forms/warn-button.jsx'
|
|
7
|
-
import FollowDataset from '../mutations/follow.jsx'
|
|
8
|
-
import StarDataset from '../mutations/star.jsx'
|
|
9
|
-
import ShareDatasetLink from '../fragments/share-dataset-button.jsx'
|
|
10
|
-
import DatasetMetadata from './metadata-tool.jsx'
|
|
11
|
-
import LoggedIn from '../../authentication/logged-in.jsx'
|
|
12
|
-
import DeletePage from '../dataset/delete-page'
|
|
13
|
-
import AdminUser from '../../authentication/admin-user.jsx'
|
|
14
|
-
import {
|
|
15
|
-
getProfile,
|
|
16
|
-
hasEditPermissions,
|
|
17
|
-
} from '../../refactor_2021/authentication/profile.js'
|
|
18
|
-
import {
|
|
19
|
-
Overlay,
|
|
20
|
-
ModalContainer,
|
|
21
|
-
ExitButton,
|
|
22
|
-
} from '../../styles/support-modal.jsx'
|
|
23
|
-
import { Media } from '../../styles/media'
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Immediate redirect to a dataset or snapshot route
|
|
27
|
-
* @param {object} history react-router-dom history
|
|
28
|
-
* @param {*} rootPath base path for relative redirects
|
|
29
|
-
* @param {*} path target path for redirect
|
|
30
|
-
*/
|
|
31
|
-
const toolRedirect = (history, rootPath, path) => {
|
|
32
|
-
history.push(`${rootPath}/${path}`)
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Toolbar parent component
|
|
36
|
-
*
|
|
37
|
-
* Dataset is the API object for the context (dataset or snapshot)
|
|
38
|
-
*/
|
|
39
|
-
const DatasetTools = ({ dataset }) => {
|
|
40
|
-
const history = useHistory()
|
|
41
|
-
const location = useLocation()
|
|
42
|
-
const snapshot = snapshotVersion(location)
|
|
43
|
-
const rootPath = snapshot
|
|
44
|
-
? `/datasets/${dataset.id}/versions/${snapshot}`
|
|
45
|
-
: `/datasets/${dataset.id}`
|
|
46
|
-
// TODO - disable if you lack write access to the draft
|
|
47
|
-
const edit = snapshot ? false : true
|
|
48
|
-
const [showDeleteModal, setShowDeleteModal] = React.useState(false)
|
|
49
|
-
const [cookies] = useCookies()
|
|
50
|
-
const user = getProfile(cookies)
|
|
51
|
-
const hasEdit =
|
|
52
|
-
(user && user.admin) ||
|
|
53
|
-
hasEditPermissions(dataset.permissions, user && user.sub)
|
|
54
|
-
const hasSnapshot = !!dataset.snapshots.length
|
|
55
|
-
|
|
56
|
-
return (
|
|
57
|
-
<>
|
|
58
|
-
{showDeleteModal && (
|
|
59
|
-
<Overlay className="delete-modal">
|
|
60
|
-
<ModalContainer>
|
|
61
|
-
<ExitButton onClick={() => setShowDeleteModal(false)}>
|
|
62
|
-
×
|
|
63
|
-
</ExitButton>
|
|
64
|
-
<DeletePage
|
|
65
|
-
dataset={dataset}
|
|
66
|
-
returnToDataset={() => setShowDeleteModal(false)}
|
|
67
|
-
/>
|
|
68
|
-
</ModalContainer>
|
|
69
|
-
</Overlay>
|
|
70
|
-
)}
|
|
71
|
-
<div className="col-xs-12 dataset-tools-wrap">
|
|
72
|
-
<div className="tools clearfix">
|
|
73
|
-
<LoggedIn>
|
|
74
|
-
<div role="presentation" className="tool">
|
|
75
|
-
{!dataset.public && edit && hasSnapshot && (
|
|
76
|
-
<WarnButton
|
|
77
|
-
tooltip="Publish Dataset"
|
|
78
|
-
icon="fa-globe icon-plus"
|
|
79
|
-
warn={false}
|
|
80
|
-
action={cb => {
|
|
81
|
-
toolRedirect(history, rootPath, 'publish')
|
|
82
|
-
cb()
|
|
83
|
-
}}
|
|
84
|
-
/>
|
|
85
|
-
)}
|
|
86
|
-
</div>
|
|
87
|
-
{hasEdit && (
|
|
88
|
-
<div role="presentation" className="tool">
|
|
89
|
-
<span>
|
|
90
|
-
<button
|
|
91
|
-
className="btn-warn-component warning"
|
|
92
|
-
onClick={() => setShowDeleteModal(true)}>
|
|
93
|
-
<i className="fa fa-trash" />
|
|
94
|
-
</button>
|
|
95
|
-
</span>
|
|
96
|
-
</div>
|
|
97
|
-
)}
|
|
98
|
-
<div role="presentation" className="tool">
|
|
99
|
-
{edit && (
|
|
100
|
-
<WarnButton
|
|
101
|
-
tooltip="Manage Dataset Permissions"
|
|
102
|
-
icon="fa-user icon-plus"
|
|
103
|
-
warn={false}
|
|
104
|
-
action={cb => {
|
|
105
|
-
toolRedirect(history, rootPath, 'share')
|
|
106
|
-
cb()
|
|
107
|
-
}}
|
|
108
|
-
/>
|
|
109
|
-
)}
|
|
110
|
-
</div>
|
|
111
|
-
<div role="presentation" className="tool">
|
|
112
|
-
{edit && (
|
|
113
|
-
<Media greaterThanOrEqual="medium">
|
|
114
|
-
<WarnButton
|
|
115
|
-
tooltip="Create Snapshot"
|
|
116
|
-
icon="fa-camera-retro icon-plus"
|
|
117
|
-
warn={false}
|
|
118
|
-
action={cb => {
|
|
119
|
-
toolRedirect(history, rootPath, 'snapshot')
|
|
120
|
-
cb()
|
|
121
|
-
}}
|
|
122
|
-
/>
|
|
123
|
-
</Media>
|
|
124
|
-
)}
|
|
125
|
-
</div>
|
|
126
|
-
<div role="presentation" className="tool">
|
|
127
|
-
<FollowDataset
|
|
128
|
-
datasetId={dataset.id}
|
|
129
|
-
following={dataset.following}
|
|
130
|
-
/>
|
|
131
|
-
</div>
|
|
132
|
-
<div role="presentation" className="tool">
|
|
133
|
-
<StarDataset datasetId={dataset.id} starred={dataset.starred} />
|
|
134
|
-
</div>
|
|
135
|
-
<div role="presentation" className="tool">
|
|
136
|
-
{edit && (
|
|
137
|
-
<Media greaterThanOrEqual="medium">
|
|
138
|
-
<AdminUser>
|
|
139
|
-
<WarnButton
|
|
140
|
-
tooltip="Admin Datalad Tools"
|
|
141
|
-
icon="fa-magic"
|
|
142
|
-
warn={false}
|
|
143
|
-
action={cb => {
|
|
144
|
-
toolRedirect(history, rootPath, 'admin-datalad')
|
|
145
|
-
cb()
|
|
146
|
-
}}
|
|
147
|
-
/>
|
|
148
|
-
</AdminUser>
|
|
149
|
-
</Media>
|
|
150
|
-
)}
|
|
151
|
-
</div>
|
|
152
|
-
<div role="presentation" className="tool">
|
|
153
|
-
{edit && (
|
|
154
|
-
<Media greaterThanOrEqual="medium">
|
|
155
|
-
<AdminUser>
|
|
156
|
-
<WarnButton
|
|
157
|
-
tooltip="Admin Remote Export Tools"
|
|
158
|
-
icon="fa-cloud-upload"
|
|
159
|
-
warn={false}
|
|
160
|
-
action={cb => {
|
|
161
|
-
toolRedirect(history, rootPath, 'admin-exports')
|
|
162
|
-
cb()
|
|
163
|
-
}}
|
|
164
|
-
/>
|
|
165
|
-
</AdminUser>
|
|
166
|
-
</Media>
|
|
167
|
-
)}
|
|
168
|
-
</div>
|
|
169
|
-
<Media at="small">
|
|
170
|
-
<div role="presentation" className="tool">
|
|
171
|
-
<ShareDatasetLink url={`https://openneuro.org${rootPath}`} />
|
|
172
|
-
</div>
|
|
173
|
-
</Media>
|
|
174
|
-
</LoggedIn>
|
|
175
|
-
<div role="presentation" className="tool">
|
|
176
|
-
<DatasetMetadata
|
|
177
|
-
datasetId={dataset.id}
|
|
178
|
-
metadata={dataset.metadata}
|
|
179
|
-
/>
|
|
180
|
-
</div>
|
|
181
|
-
</div>
|
|
182
|
-
</div>
|
|
183
|
-
</>
|
|
184
|
-
)
|
|
185
|
-
}
|
|
186
|
-
DatasetTools.propTypes = {
|
|
187
|
-
dataset: PropTypes.object,
|
|
188
|
-
edit: PropTypes.bool,
|
|
189
|
-
}
|
|
190
|
-
export default DatasetTools
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import PropTypes from 'prop-types'
|
|
3
|
-
import { formatDate } from '../../utils/date.js'
|
|
4
|
-
import parseISO from 'date-fns/parseISO'
|
|
5
|
-
import formatDistanceToNow from 'date-fns/formatDistanceToNow'
|
|
6
|
-
|
|
7
|
-
const DatasetUploaded = ({ uploader, created, testDifference }) => {
|
|
8
|
-
const dateAdded = formatDate(created)
|
|
9
|
-
const difference = testDifference || formatDistanceToNow(parseISO(created))
|
|
10
|
-
return (
|
|
11
|
-
<h6>
|
|
12
|
-
{`uploaded by ${uploader.name} on ${dateAdded} - ${difference} ago`}
|
|
13
|
-
</h6>
|
|
14
|
-
)
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
DatasetUploaded.propTypes = {
|
|
18
|
-
uploader: PropTypes.object,
|
|
19
|
-
created: PropTypes.string,
|
|
20
|
-
|
|
21
|
-
// Ensures deterministic snapshot test
|
|
22
|
-
testDifference: PropTypes.string,
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default DatasetUploaded
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import WarnButton from '../../common/forms/warn-button.jsx'
|
|
3
|
-
import PropTypes from 'prop-types'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* An edit button, calls action when clicked
|
|
7
|
-
*/
|
|
8
|
-
const EditButton = ({ action }) => (
|
|
9
|
-
<WarnButton
|
|
10
|
-
message="Edit"
|
|
11
|
-
icon="fa-edit"
|
|
12
|
-
warn={false}
|
|
13
|
-
action={cb => {
|
|
14
|
-
action()
|
|
15
|
-
cb()
|
|
16
|
-
}}
|
|
17
|
-
/>
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
EditButton.propTypes = {
|
|
21
|
-
action: PropTypes.func,
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default EditButton
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
import UpdateDescription from '../mutations/description.jsx'
|
|
3
|
-
import CancelButton from './cancel-button.jsx'
|
|
4
|
-
import EditButton from './edit-button.jsx'
|
|
5
|
-
import { Media } from '../../styles/media'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* This is a hopefully less confusing click-to-edit component
|
|
9
|
-
*
|
|
10
|
-
* Editing is standardized but display is handled by any child component
|
|
11
|
-
*/
|
|
12
|
-
const EditDescriptionField = ({
|
|
13
|
-
datasetId,
|
|
14
|
-
description,
|
|
15
|
-
field,
|
|
16
|
-
children,
|
|
17
|
-
editMode,
|
|
18
|
-
rows = 1,
|
|
19
|
-
}) => {
|
|
20
|
-
const [editing, setEditing] = useState(false)
|
|
21
|
-
const [value, setValue] = useState(description[field] || '')
|
|
22
|
-
|
|
23
|
-
if (editing) {
|
|
24
|
-
return (
|
|
25
|
-
<>
|
|
26
|
-
<textarea
|
|
27
|
-
rows={rows}
|
|
28
|
-
onChange={e => setValue(e.target.value)}
|
|
29
|
-
value={value}
|
|
30
|
-
/>
|
|
31
|
-
<UpdateDescription
|
|
32
|
-
datasetId={datasetId}
|
|
33
|
-
field={field}
|
|
34
|
-
value={value}
|
|
35
|
-
done={() => setEditing(false)}
|
|
36
|
-
/>
|
|
37
|
-
<CancelButton action={() => setEditing(false)} />
|
|
38
|
-
</>
|
|
39
|
-
)
|
|
40
|
-
} else {
|
|
41
|
-
return (
|
|
42
|
-
<>
|
|
43
|
-
{children}
|
|
44
|
-
{editMode && (
|
|
45
|
-
<Media greaterThanOrEqual="medium">
|
|
46
|
-
<EditButton action={() => setEditing(true)} />
|
|
47
|
-
</Media>
|
|
48
|
-
)}
|
|
49
|
-
</>
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export default EditDescriptionField
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
import UpdateDescription from '../mutations/description.jsx'
|
|
3
|
-
import CancelButton from './cancel-button.jsx'
|
|
4
|
-
import EditButton from './edit-button.jsx'
|
|
5
|
-
import EditList from './edit-list.jsx'
|
|
6
|
-
import { Media } from '../../styles/media'
|
|
7
|
-
|
|
8
|
-
const EditDescriptionList = ({
|
|
9
|
-
datasetId,
|
|
10
|
-
description,
|
|
11
|
-
field,
|
|
12
|
-
children,
|
|
13
|
-
editMode,
|
|
14
|
-
}) => {
|
|
15
|
-
const [editing, setEditing] = useState(false)
|
|
16
|
-
const [rows, setRows] = useState(description[field] || [])
|
|
17
|
-
|
|
18
|
-
if (editing) {
|
|
19
|
-
return (
|
|
20
|
-
<>
|
|
21
|
-
<EditList
|
|
22
|
-
placeholder="Add new item"
|
|
23
|
-
elements={rows}
|
|
24
|
-
setElements={setRows}
|
|
25
|
-
/>
|
|
26
|
-
<UpdateDescription
|
|
27
|
-
datasetId={datasetId}
|
|
28
|
-
field={field}
|
|
29
|
-
value={rows}
|
|
30
|
-
done={() => setEditing(false)}
|
|
31
|
-
/>
|
|
32
|
-
<CancelButton action={() => setEditing(false)} />
|
|
33
|
-
</>
|
|
34
|
-
)
|
|
35
|
-
} else {
|
|
36
|
-
return (
|
|
37
|
-
<>
|
|
38
|
-
{children}
|
|
39
|
-
{editMode && (
|
|
40
|
-
<Media greaterThanOrEqual="medium">
|
|
41
|
-
<EditButton action={() => setEditing(true)} />
|
|
42
|
-
</Media>
|
|
43
|
-
)}
|
|
44
|
-
</>
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export default EditDescriptionList
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
import PropTypes from 'prop-types'
|
|
3
|
-
import styled from '@emotion/styled'
|
|
4
|
-
|
|
5
|
-
const EditListButton = styled.button`
|
|
6
|
-
min-width: 6em;
|
|
7
|
-
`
|
|
8
|
-
|
|
9
|
-
const EditListRow = styled.div`
|
|
10
|
-
margin-top: 6px;
|
|
11
|
-
margin-bottom: 6px;
|
|
12
|
-
`
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Generic add/remove strings from an Array list
|
|
16
|
-
*/
|
|
17
|
-
const EditList = ({ placeholder, elements = [], setElements }) => {
|
|
18
|
-
const [newElement, updateNewElement] = useState('')
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Remove one element from list
|
|
22
|
-
* @param {number} index Which entry to remove
|
|
23
|
-
*/
|
|
24
|
-
const removeElement = index => () => {
|
|
25
|
-
// Avoid mutating elements array directly
|
|
26
|
-
const newElements = [...elements]
|
|
27
|
-
newElements.splice(index, 1)
|
|
28
|
-
setElements(newElements)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return (
|
|
32
|
-
<>
|
|
33
|
-
<div className="input-group">
|
|
34
|
-
<input
|
|
35
|
-
type="text"
|
|
36
|
-
className="form-control"
|
|
37
|
-
placeholder={placeholder}
|
|
38
|
-
value={newElement}
|
|
39
|
-
onChange={e => updateNewElement(e.target.value)}
|
|
40
|
-
/>
|
|
41
|
-
<span className="input-group-btn">
|
|
42
|
-
<EditListButton
|
|
43
|
-
className="btn btn-default"
|
|
44
|
-
type="button"
|
|
45
|
-
onClick={() => {
|
|
46
|
-
setElements([...elements, newElement])
|
|
47
|
-
updateNewElement('')
|
|
48
|
-
}}>
|
|
49
|
-
Add
|
|
50
|
-
</EditListButton>
|
|
51
|
-
</span>
|
|
52
|
-
</div>
|
|
53
|
-
<div>
|
|
54
|
-
{elements.map((element, index) => (
|
|
55
|
-
<EditListRow key={index}>
|
|
56
|
-
<div className="input-group">
|
|
57
|
-
<span className="input-group-addon" style={{ width: '100%' }}>
|
|
58
|
-
{element}
|
|
59
|
-
</span>
|
|
60
|
-
<div className="input-group-btn">
|
|
61
|
-
<EditListButton
|
|
62
|
-
className="btn btn-default"
|
|
63
|
-
onClick={removeElement(index)}>
|
|
64
|
-
<i className="fa fa-times" />
|
|
65
|
-
Remove
|
|
66
|
-
</EditListButton>
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
</EditListRow>
|
|
70
|
-
))}
|
|
71
|
-
</div>
|
|
72
|
-
</>
|
|
73
|
-
)
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
EditList.propTypes = {
|
|
77
|
-
placeholder: PropTypes.string,
|
|
78
|
-
elements: PropTypes.array,
|
|
79
|
-
setElements: PropTypes.func,
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export default EditList
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
import UpdateReadme from '../mutations/readme.jsx'
|
|
3
|
-
import EditButton from './edit-button.jsx'
|
|
4
|
-
import CancelButton from './cancel-button.jsx'
|
|
5
|
-
import { Media } from '../../styles/media'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* This extends EditDescriptionField with Markdown display and a custom mutation
|
|
9
|
-
*/
|
|
10
|
-
const EditReadme = ({ datasetId, content, children, hasEdit }) => {
|
|
11
|
-
const [editing, setEditing] = useState(false)
|
|
12
|
-
const [value, setValue] = useState(content || '')
|
|
13
|
-
|
|
14
|
-
if (editing) {
|
|
15
|
-
return (
|
|
16
|
-
<>
|
|
17
|
-
<textarea
|
|
18
|
-
rows={12}
|
|
19
|
-
onChange={e => setValue(e.target.value)}
|
|
20
|
-
value={value}
|
|
21
|
-
/>
|
|
22
|
-
<UpdateReadme
|
|
23
|
-
datasetId={datasetId}
|
|
24
|
-
value={value}
|
|
25
|
-
done={() => setEditing(false)}
|
|
26
|
-
/>
|
|
27
|
-
<CancelButton action={() => setEditing(false)} />
|
|
28
|
-
</>
|
|
29
|
-
)
|
|
30
|
-
} else {
|
|
31
|
-
return (
|
|
32
|
-
<>
|
|
33
|
-
{children}
|
|
34
|
-
{hasEdit && (
|
|
35
|
-
<Media greaterThanOrEqual="medium">
|
|
36
|
-
<EditButton action={() => setEditing(true)} />
|
|
37
|
-
</Media>
|
|
38
|
-
)}
|
|
39
|
-
</>
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export default EditReadme
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import PropTypes from 'prop-types'
|
|
3
|
-
import { Panel } from '../../components/panel'
|
|
4
|
-
import { PanelGroup } from '../../components/panel-group'
|
|
5
|
-
import UploadResume from '../../uploader/upload-resume.jsx'
|
|
6
|
-
|
|
7
|
-
const IncompleteDataset = ({ datasetId }) => (
|
|
8
|
-
<div className="fade-in col-xs-12 validation">
|
|
9
|
-
<h3 className="metaheader">Incomplete Upload or Edit</h3>
|
|
10
|
-
<PanelGroup accordion className="validation-wrap">
|
|
11
|
-
<Panel className="status">
|
|
12
|
-
<p>An upload or edit may have been interrupted.</p>
|
|
13
|
-
<UploadResume datasetId={datasetId} />
|
|
14
|
-
</Panel>
|
|
15
|
-
</PanelGroup>
|
|
16
|
-
</div>
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
IncompleteDataset.propTypes = {
|
|
20
|
-
datasetId: PropTypes.string,
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export default IncompleteDataset
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import PropTypes from 'prop-types'
|
|
3
|
-
import { useLocation, useHistory } from 'react-router-dom'
|
|
4
|
-
import WarnButton from '../../common/forms/warn-button.jsx'
|
|
5
|
-
|
|
6
|
-
const MetadataTool = ({ datasetId, metadata }) => {
|
|
7
|
-
const history = useHistory()
|
|
8
|
-
const location = useLocation()
|
|
9
|
-
const hasMetadata = metadata !== null
|
|
10
|
-
return (
|
|
11
|
-
<WarnButton
|
|
12
|
-
tooltip={hasMetadata ? 'Metadata' : 'Add Metadata'}
|
|
13
|
-
icon={hasMetadata ? 'fa-file-code-o' : 'fa-file-code-o icon-plus'}
|
|
14
|
-
warn={false}
|
|
15
|
-
action={cb => {
|
|
16
|
-
history.push({
|
|
17
|
-
pathname: `/datasets/${datasetId}/metadata`,
|
|
18
|
-
state: {
|
|
19
|
-
submitPath: location.pathname,
|
|
20
|
-
},
|
|
21
|
-
})
|
|
22
|
-
cb()
|
|
23
|
-
}}
|
|
24
|
-
/>
|
|
25
|
-
)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
MetadataTool.propTypes = {
|
|
29
|
-
metadata: PropTypes.object,
|
|
30
|
-
following: PropTypes.object,
|
|
31
|
-
datasetId: PropTypes.string,
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export default MetadataTool
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import React, { useState, createRef } from 'react'
|
|
2
|
-
import PropTypes from 'prop-types'
|
|
3
|
-
import styled from '@emotion/styled'
|
|
4
|
-
|
|
5
|
-
const Container = styled.div({
|
|
6
|
-
position: 'relative',
|
|
7
|
-
width: '100%',
|
|
8
|
-
height: '4.5rem',
|
|
9
|
-
marginBottom: '0.5rem',
|
|
10
|
-
borderRadius: '5px',
|
|
11
|
-
border: '2px inset #eee',
|
|
12
|
-
})
|
|
13
|
-
const centerLabelStyles = {
|
|
14
|
-
top: '1rem',
|
|
15
|
-
fontSize: '1em',
|
|
16
|
-
}
|
|
17
|
-
const pushedUpLabelStyles = {
|
|
18
|
-
top: '0.4rem',
|
|
19
|
-
fontSize: '0.75em',
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
interface NumberInputLabelProps {
|
|
23
|
-
hasValue: boolean
|
|
24
|
-
hasFocus: boolean
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const Label = styled.label<NumberInputLabelProps>(
|
|
28
|
-
{
|
|
29
|
-
position: 'absolute',
|
|
30
|
-
left: '1rem',
|
|
31
|
-
right: '1rem',
|
|
32
|
-
overflow: 'hidden',
|
|
33
|
-
whiteSpace: 'nowrap',
|
|
34
|
-
textOverflow: 'ellipsis',
|
|
35
|
-
color: '#999',
|
|
36
|
-
transition: 'top 100ms, font-size 100ms',
|
|
37
|
-
transitionTimingFunction: 'ease-out',
|
|
38
|
-
textAlign: 'left',
|
|
39
|
-
},
|
|
40
|
-
({ hasValue, hasFocus }) => ({
|
|
41
|
-
...(hasValue || hasFocus ? pushedUpLabelStyles : centerLabelStyles),
|
|
42
|
-
':focus': pushedUpLabelStyles,
|
|
43
|
-
}),
|
|
44
|
-
)
|
|
45
|
-
const DisabledIcon = styled.i({
|
|
46
|
-
position: 'absolute',
|
|
47
|
-
top: '0.4rem',
|
|
48
|
-
right: '0.4rem',
|
|
49
|
-
color: '#5cb85c',
|
|
50
|
-
})
|
|
51
|
-
const Input = styled.input({
|
|
52
|
-
width: '100%',
|
|
53
|
-
height: '100%',
|
|
54
|
-
border: 'none',
|
|
55
|
-
padding: '1.5rem 0.8rem 0.3rem',
|
|
56
|
-
textAlign: 'left',
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
const NumberInput = ({
|
|
60
|
-
name,
|
|
61
|
-
label,
|
|
62
|
-
value,
|
|
63
|
-
min,
|
|
64
|
-
max,
|
|
65
|
-
disabled,
|
|
66
|
-
annotated,
|
|
67
|
-
required,
|
|
68
|
-
onChange,
|
|
69
|
-
}): React.ReactElement => {
|
|
70
|
-
const [hasFocus, setHasFocus] = useState(false)
|
|
71
|
-
|
|
72
|
-
const input = createRef<HTMLInputElement>()
|
|
73
|
-
|
|
74
|
-
const focusInput = (): void => {
|
|
75
|
-
input.current.focus()
|
|
76
|
-
setHasFocus(true)
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const removeFocus = (): void => {
|
|
80
|
-
setHasFocus(false)
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const handleChange = (e): void => {
|
|
84
|
-
onChange(e.target.name, parseInt(e.target.value))
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
return (
|
|
88
|
-
<Container>
|
|
89
|
-
<Label
|
|
90
|
-
htmlFor={name}
|
|
91
|
-
hasValue={Boolean(value)}
|
|
92
|
-
hasFocus={hasFocus}
|
|
93
|
-
onClick={focusInput}>
|
|
94
|
-
{label}
|
|
95
|
-
</Label>
|
|
96
|
-
{annotated && <DisabledIcon className="fa fa-asterisk" />}
|
|
97
|
-
<Input
|
|
98
|
-
type="number"
|
|
99
|
-
ref={input}
|
|
100
|
-
name={name}
|
|
101
|
-
value={value}
|
|
102
|
-
min={min}
|
|
103
|
-
max={max}
|
|
104
|
-
disabled={disabled}
|
|
105
|
-
required={required}
|
|
106
|
-
onFocus={focusInput}
|
|
107
|
-
onBlur={removeFocus}
|
|
108
|
-
onChange={handleChange}
|
|
109
|
-
/>
|
|
110
|
-
</Container>
|
|
111
|
-
)
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
NumberInput.propTypes = {
|
|
115
|
-
min: PropTypes.number,
|
|
116
|
-
max: PropTypes.number,
|
|
117
|
-
disabled: PropTypes.bool,
|
|
118
|
-
annotated: PropTypes.bool,
|
|
119
|
-
required: PropTypes.bool,
|
|
120
|
-
name: PropTypes.string,
|
|
121
|
-
label: PropTypes.string,
|
|
122
|
-
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
123
|
-
onChange: PropTypes.func,
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export default NumberInput
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import PropTypes from 'prop-types'
|
|
3
|
-
import WarnButton from '../../common/forms/warn-button.jsx'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* A save button, calls action when clicked
|
|
7
|
-
*/
|
|
8
|
-
const SaveButton = ({ action }) => (
|
|
9
|
-
<WarnButton
|
|
10
|
-
message="Save"
|
|
11
|
-
icon="fa-save"
|
|
12
|
-
warn={false}
|
|
13
|
-
action={async cb => {
|
|
14
|
-
await action()
|
|
15
|
-
cb()
|
|
16
|
-
}}
|
|
17
|
-
/>
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
SaveButton.propTypes = {
|
|
21
|
-
action: PropTypes.func,
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default SaveButton
|