@openneuro/app 4.33.4 → 4.34.0-alpha.0
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 +4 -3
- package/src/client.jsx +2 -1
- package/src/scripts/authentication/signOut.ts +1 -1
- package/src/scripts/common/containers/footer.tsx +1 -1
- package/src/scripts/common/containers/header.tsx +3 -2
- package/src/scripts/common/content/affiliate-content.jsx +72 -0
- package/src/scripts/common/content/assets/affiliates/bids.jpg +0 -0
- package/src/scripts/common/content/assets/affiliates/datalad.jpg +0 -0
- package/src/scripts/common/content/assets/affiliates/nih-bi-logo.png +0 -0
- package/src/scripts/common/content/assets/front-page/brand_mark.png +0 -0
- package/src/scripts/common/content/assets/front-page/cube-get.png +0 -0
- package/src/scripts/common/content/assets/front-page/cube-share.png +0 -0
- package/src/scripts/common/content/assets/front-page/cube-use.png +0 -0
- package/src/scripts/common/content/assets/front-page/ljaf.png +0 -0
- package/src/scripts/common/content/assets/front-page/logo_app.png +0 -0
- package/src/scripts/common/content/assets/front-page/logo_cube.png +0 -0
- package/src/scripts/common/content/assets/front-page/logo_data.png +0 -0
- package/src/scripts/common/content/assets/front-page/logo_users.png +0 -0
- package/src/scripts/common/content/assets/front-page/novo-logo.png +0 -0
- package/src/scripts/common/content/assets/front-page/nru-logo.png +0 -0
- package/src/scripts/common/content/assets/front-page/nsf.png +0 -0
- package/src/scripts/common/content/assets/front-page/sqm-logo.png +0 -0
- package/src/scripts/common/content/assets/front-page/squishymedia.png +0 -0
- package/src/scripts/common/content/assets/front-page/stanford.png +0 -0
- package/src/scripts/common/content/assets/modality-cubes/brain-initiative.jpg +0 -0
- package/src/scripts/common/content/assets/modality-cubes/eeg.jpg +0 -0
- package/src/scripts/common/content/assets/modality-cubes/ieeg.jpg +0 -0
- package/src/scripts/common/content/assets/modality-cubes/meg.jpg +0 -0
- package/src/scripts/common/content/assets/modality-cubes/mri.jpg +0 -0
- package/src/scripts/common/content/assets/modality-cubes/nih_cube.jpg +0 -0
- package/src/scripts/common/content/assets/modality-cubes/nirs.jpg +0 -0
- package/src/scripts/common/content/assets/modality-cubes/pet-scan.jpg +0 -0
- package/src/scripts/common/content/assets/portal-content/nih-bi-brand.png +0 -0
- package/src/scripts/common/content/facet-content.jsx +186 -0
- package/src/scripts/common/content/front-page-content.jsx +177 -0
- package/src/scripts/common/content/image-attribution.tsx +3 -3
- package/src/scripts/common/content/modality-cube-content.jsx +92 -0
- package/src/scripts/common/content/portal-content.jsx +149 -0
- package/src/scripts/common/content/portal-grant-content.jsx +30 -0
- package/src/scripts/common/content/sortby-list.jsx +18 -0
- package/src/scripts/common/forms/warn-button.jsx +1 -1
- package/src/scripts/components/accordion/AccordionTab.tsx +68 -0
- package/src/scripts/components/accordion/AccordionWrap.tsx +22 -0
- package/src/scripts/components/accordion/__tests__/AccordionTab.spec.tsx +35 -0
- package/src/scripts/components/accordion/accordion.scss +68 -0
- package/src/scripts/components/activity-slider/ActivitySlider.tsx +121 -0
- package/src/scripts/components/activity-slider/slider.scss +130 -0
- package/src/scripts/components/affiliate-article/AffiliateArticle.tsx +26 -0
- package/src/scripts/components/affiliate-article/affiliate.scss +32 -0
- package/src/scripts/components/aggregate-count/AggregateCount.tsx +20 -0
- package/src/scripts/components/assets/activity-icon.png +0 -0
- package/src/scripts/components/assets/close-button.png +0 -0
- package/src/scripts/components/assets/favicon copy.ico +0 -0
- package/src/scripts/components/assets/favicon.ico +0 -0
- package/src/scripts/components/assets/get_data_browse.png +0 -0
- package/src/scripts/components/assets/get_data_download.png +0 -0
- package/src/scripts/components/assets/ljaf copy.png +0 -0
- package/src/scripts/components/assets/logo_app copy.png +0 -0
- package/src/scripts/components/assets/logo_cube copy.png +0 -0
- package/src/scripts/components/assets/logo_data copy.png +0 -0
- package/src/scripts/components/assets/logo_users copy.png +0 -0
- package/src/scripts/components/assets/mri-scan.jpg +0 -0
- package/src/scripts/components/assets/nih copy.png +0 -0
- package/src/scripts/components/assets/nih-bi-brand.jpg +0 -0
- package/src/scripts/components/assets/nih-stanford.jpg +0 -0
- package/src/scripts/components/assets/nih.png +0 -0
- package/src/scripts/components/assets/nimh.png +0 -0
- package/src/scripts/components/assets/nsf copy.png +0 -0
- package/src/scripts/components/assets/on-dark-horz.svg +1 -0
- package/src/scripts/components/assets/on-dark.svg +1 -0
- package/src/scripts/components/assets/on-light-horz.svg +1 -0
- package/src/scripts/components/assets/on-light.svg +1 -0
- package/src/scripts/components/assets/orcid_24x24 copy.png +0 -0
- package/src/scripts/components/assets/orcid_24x24.png +0 -0
- package/src/scripts/components/assets/share_data_collaborate.png +0 -0
- package/src/scripts/components/assets/share_data_publish.png +0 -0
- package/src/scripts/components/assets/share_data_validate.png +0 -0
- package/src/scripts/components/assets/squishymedia copy.png +0 -0
- package/src/scripts/components/assets/stanford copy.png +0 -0
- package/src/scripts/components/assets/tab-get_data.png +0 -0
- package/src/scripts/components/assets/tab-share_data.png +0 -0
- package/src/scripts/components/assets/tab-use_data.png +0 -0
- package/src/scripts/components/assets/use_data_analyze.png +0 -0
- package/src/scripts/components/assets/use_data_snapshot.png +0 -0
- package/src/scripts/components/button/Button.tsx +113 -0
- package/src/scripts/components/button/__tests__/Button.spec.tsx +21 -0
- package/src/scripts/components/button/button.scss +140 -0
- package/src/scripts/components/count-toggle/CountToggle.tsx +65 -0
- package/src/scripts/components/count-toggle/__tests__/CountToggle.spec.tsx +31 -0
- package/src/scripts/components/count-toggle/count-toggle.scss +34 -0
- package/src/scripts/components/dropdown/Dropdown.tsx +38 -0
- package/src/scripts/components/dropdown/dropdown.scss +29 -0
- package/src/scripts/components/facets/FacetRadio.tsx +43 -0
- package/src/scripts/components/facets/FacetRange.tsx +35 -0
- package/src/scripts/components/facets/FacetSearch.tsx +66 -0
- package/src/scripts/components/facets/FacetSelect.tsx +87 -0
- package/src/scripts/components/facets/SingleSelect.tsx +39 -0
- package/src/scripts/components/facets/__tests__/FacetSelect.spec.tsx +14 -0
- package/src/scripts/components/facets/__tests__/SingleSelect.spec.tsx +58 -0
- package/src/scripts/components/facets/facet.scss +244 -0
- package/src/scripts/components/footer/Footer.tsx +52 -0
- package/src/scripts/components/footer/footer.scss +20 -0
- package/src/scripts/components/formatting/__tests__/modality-label.spec.tsx +34 -0
- package/src/scripts/components/formatting/modality-label.tsx +34 -0
- package/src/scripts/components/front-page/ActivityHeader.tsx +12 -0
- package/src/scripts/components/front-page/AffiliateBlock.tsx +22 -0
- package/src/scripts/components/front-page/Contributors.tsx +28 -0
- package/src/scripts/components/front-page/GetUpdates.tsx +99 -0
- package/src/scripts/components/front-page/Infographic.tsx +36 -0
- package/src/scripts/components/front-page/front-page.scss +295 -0
- package/src/scripts/components/header/Header.tsx +151 -0
- package/src/scripts/components/header/LandingExpandedHeader.tsx +110 -0
- package/src/scripts/components/header/header.scss +409 -0
- package/src/scripts/components/icon/Icon.tsx +55 -0
- package/src/scripts/components/icon/__tests__/Icon.spec.tsx +10 -0
- package/src/scripts/components/icon/icon.scss +8 -0
- package/src/scripts/components/input/Input.tsx +137 -0
- package/src/scripts/components/input/TermSearch.tsx +101 -0
- package/src/scripts/components/input/input.scss +147 -0
- package/src/scripts/components/input/term-search.scss +68 -0
- package/src/scripts/components/json-tree/ExpandableProperty.tsx +35 -0
- package/src/scripts/components/json-tree/RecursiveProperty.tsx +67 -0
- package/src/scripts/components/json-tree/json-tree.scss +19 -0
- package/src/scripts/components/loading/Loading.tsx +19 -0
- package/src/scripts/components/loading/__tests__/Loading.spec.tsx +12 -0
- package/src/scripts/components/loading/loading.scss +141 -0
- package/src/scripts/components/logo/Logo.tsx +44 -0
- package/src/scripts/components/logo/__tests__/Logo.spec.tsx +22 -0
- package/src/scripts/components/modal/Modal.tsx +51 -0
- package/src/scripts/components/modal/ModalExample.tsx +25 -0
- package/src/scripts/components/modal/UserLoginModal.tsx +74 -0
- package/src/scripts/components/modal/__tests__/UserLoginModal.spec.tsx +37 -0
- package/src/scripts/components/modal/modal.scss +60 -0
- package/src/scripts/components/modality-cube/ModalityCube.tsx +60 -0
- package/src/scripts/components/modality-cube/modality-cube.scss +303 -0
- package/src/scripts/components/page/Page.tsx +61 -0
- package/src/scripts/components/page/page.scss +408 -0
- package/src/scripts/components/progress-bar/ProgressBar.tsx +16 -0
- package/src/scripts/components/progress-bar/progress-bar.scss +34 -0
- package/src/scripts/components/radio/Radio.tsx +33 -0
- package/src/scripts/components/radio/RadioGroup.tsx +45 -0
- package/src/scripts/components/radio/__tests__/RadioGroup.spec.tsx +31 -0
- package/src/scripts/components/radio/radio.scss +335 -0
- package/src/scripts/components/range/TwoHandleRange.scss +108 -0
- package/src/scripts/components/range/TwoHandleRange.tsx +128 -0
- package/src/scripts/components/range/__tests__/TwoHandleRange.spec.tsx +34 -0
- package/src/scripts/components/read-more/ReadMore.tsx +50 -0
- package/src/scripts/components/read-more/__tests__/ReadMore.spec.tsx +14 -0
- package/src/scripts/components/read-more/read-more.scss +79 -0
- package/src/scripts/components/scss/_flex-grid.scss +216 -0
- package/src/scripts/components/scss/_helper-classes.scss +162 -0
- package/src/scripts/components/scss/_normalize.scss +614 -0
- package/src/scripts/components/scss/_variables.scss +245 -0
- package/src/scripts/components/scss/global.scss +124 -0
- package/src/scripts/components/scss/toasts.scss +33 -0
- package/src/scripts/components/scss/upload-modal.scss +479 -0
- package/src/scripts/components/search-page/CommunityHeader.tsx +27 -0
- package/src/scripts/components/search-page/FacetBlockContainerExample.tsx +6 -0
- package/src/scripts/components/search-page/FilterDateItem.tsx +44 -0
- package/src/scripts/components/search-page/FilterListItem.tsx +62 -0
- package/src/scripts/components/search-page/FiltersBlock.tsx +277 -0
- package/src/scripts/components/search-page/ModalityHeader.tsx +64 -0
- package/src/scripts/components/search-page/NeurobagelSearch.tsx +59 -0
- package/src/scripts/components/search-page/SearchPage.tsx +114 -0
- package/src/scripts/components/search-page/SearchResultItem.tsx +417 -0
- package/src/scripts/components/search-page/SearchResultsList.tsx +48 -0
- package/src/scripts/components/search-page/SearchSort.tsx +52 -0
- package/src/scripts/components/search-page/SearchSortContainerExample.tsx +9 -0
- package/src/scripts/components/search-page/TermListItem.tsx +41 -0
- package/src/scripts/components/search-page/__tests__/NuerobagelSearch.spec.tsx +17 -0
- package/src/scripts/components/search-page/filters-block.scss +99 -0
- package/src/scripts/components/search-page/neurobagel_logo.svg +75 -0
- package/src/scripts/components/search-page/search-page.scss +505 -0
- package/src/scripts/components/search-page/search-result.scss +117 -0
- package/src/scripts/components/search-page/search-sort.scss +56 -0
- package/src/scripts/components/select/SelectGroup.tsx +41 -0
- package/src/scripts/components/select/__tests__/SelectGroup.spec.tsx +43 -0
- package/src/scripts/components/select/select.scss +40 -0
- package/src/scripts/components/textarea/Textarea.tsx +68 -0
- package/src/scripts/components/textarea/__tests__/Textarea.spec.tsx +53 -0
- package/src/scripts/components/tooltip/Tooltip.tsx +30 -0
- package/src/scripts/components/tooltip/__tests__/Tooltip.spec.tsx +14 -0
- package/src/scripts/components/tooltip/tooltip.scss +159 -0
- package/src/scripts/components/user/UserMenu.tsx +72 -0
- package/src/scripts/components/user/user-menu.scss +88 -0
- package/src/scripts/components/warn-button/WarnButton.tsx +97 -0
- package/src/scripts/components/warn-button/warn-button.scss +39 -0
- package/src/scripts/datalad/dataset/dataset-query-context.js +2 -0
- package/src/scripts/dataset/comments/comment.jsx +1 -1
- package/src/scripts/dataset/components/AnalyzeDropdown.tsx +2 -2
- package/src/scripts/dataset/components/CloneDropdown.tsx +2 -2
- package/src/scripts/dataset/components/DatasetEventItem.tsx +105 -0
- package/src/scripts/dataset/components/DatasetGitAccess.tsx +2 -2
- package/src/scripts/dataset/components/DatasetToolButton.tsx +2 -2
- package/src/scripts/dataset/components/ModalitiesMetaDataBlock.tsx +2 -10
- package/src/scripts/dataset/components/ValidationBlock.tsx +37 -2
- package/src/scripts/dataset/components/VersionList.tsx +1 -1
- package/src/scripts/dataset/components/scss/dataset-events.module.scss +41 -0
- package/src/scripts/dataset/dataset-query.jsx +12 -11
- package/src/scripts/dataset/download/__tests__/__snapshots__/download-command-line.spec.jsx.snap +7 -1
- package/src/scripts/dataset/download/__tests__/download-command-line.spec.jsx +2 -2
- package/src/scripts/dataset/download/download-command-line.jsx +17 -13
- package/src/scripts/dataset/download/download-datalad.jsx +6 -3
- package/src/scripts/dataset/download/download-link.jsx +1 -1
- package/src/scripts/dataset/download/download-s3.jsx +0 -4
- package/src/scripts/dataset/files/file-display.jsx +1 -1
- package/src/scripts/dataset/files/file-tree-unloaded-directory.jsx +1 -1
- package/src/scripts/dataset/files/file-tree.tsx +1 -1
- package/src/scripts/dataset/files/file-view.jsx +1 -1
- package/src/scripts/dataset/files/file-viewer-type.jsx +5 -1
- package/src/scripts/dataset/files/file.tsx +2 -2
- package/src/scripts/dataset/files/files.tsx +3 -3
- package/src/scripts/dataset/files/viewers/file-viewer-json.jsx +1 -1
- package/src/scripts/dataset/files/viewers/file-viewer-markdown.tsx +13 -0
- package/src/scripts/dataset/fragments/cancel-button.tsx +1 -1
- package/src/scripts/dataset/fragments/dataset-citation.jsx +2 -2
- package/src/scripts/dataset/fragments/edit-button.tsx +1 -1
- package/src/scripts/dataset/fragments/edit-list.jsx +1 -1
- package/src/scripts/dataset/fragments/save-button.tsx +1 -1
- package/src/scripts/dataset/mutations/admin-exports.jsx +1 -1
- package/src/scripts/dataset/mutations/cache-clear.jsx +1 -1
- package/src/scripts/dataset/mutations/create-anonymous-reviewer.tsx +2 -2
- package/src/scripts/dataset/mutations/dataset-events.tsx +187 -0
- package/src/scripts/dataset/mutations/dataset-relations.tsx +1 -1
- package/src/scripts/dataset/mutations/delete-anonymous-reviewer.tsx +1 -1
- package/src/scripts/dataset/mutations/delete-comment.jsx +1 -1
- package/src/scripts/dataset/mutations/delete-file.jsx +1 -1
- package/src/scripts/dataset/mutations/deprecate-version.tsx +1 -1
- package/src/scripts/dataset/mutations/flag-annex-object.jsx +2 -2
- package/src/scripts/dataset/mutations/follow.tsx +1 -1
- package/src/scripts/dataset/mutations/import-dataset.tsx +1 -1
- package/src/scripts/dataset/mutations/publish.jsx +1 -1
- package/src/scripts/dataset/mutations/remove-annex-object.jsx +2 -2
- package/src/scripts/dataset/mutations/remove-permissions.tsx +1 -1
- package/src/scripts/dataset/mutations/revalidate.jsx +2 -2
- package/src/scripts/dataset/mutations/snapshot.tsx +1 -1
- package/src/scripts/dataset/mutations/star.tsx +1 -1
- package/src/scripts/dataset/mutations/submit-metadata.jsx +1 -1
- package/src/scripts/dataset/mutations/undo-deprecate-version.tsx +2 -2
- package/src/scripts/dataset/mutations/update-permissions.tsx +1 -1
- package/src/scripts/dataset/routes/admin-datalad.jsx +4 -0
- package/src/scripts/dataset/routes/dataset-default.tsx +1 -1
- package/src/scripts/dataset/routes/delete-page.tsx +7 -3
- package/src/scripts/dataset/routes/deprecate-snapshot-page.tsx +1 -1
- package/src/scripts/dataset/routes/manage-permissions.jsx +1 -1
- package/src/scripts/dataset/routes/snapshot-default.tsx +1 -1
- package/src/scripts/dataset/routes/snapshot.tsx +1 -1
- package/src/scripts/dataset/snapshot-container.tsx +14 -8
- package/src/scripts/pages/admin/flagged-files.jsx +1 -1
- package/src/scripts/pages/admin/user-tools.tsx +1 -1
- package/src/scripts/pages/admin/users.tsx +2 -2
- package/src/scripts/pages/api.jsx +2 -2
- package/src/scripts/pages/front-page/aggregate-queries/aggregate-counts-container.tsx +6 -7
- package/src/scripts/pages/front-page/front-page.tsx +7 -9
- package/src/scripts/pages/metadata/dataset-metadata.tsx +1 -1
- package/src/scripts/search/__tests__/search-container.spec.tsx +7 -7
- package/src/scripts/search/filters-block-container.tsx +66 -9
- package/src/scripts/search/initial-search-params.tsx +7 -7
- package/src/scripts/search/inputs/__tests__/sort-by-select.spec.tsx +1 -1
- package/src/scripts/search/inputs/admin-allDatasets-toggle.tsx +1 -1
- package/src/scripts/search/inputs/age-range-input.tsx +3 -2
- package/src/scripts/search/inputs/author-input.tsx +3 -2
- package/src/scripts/search/inputs/dataset-type-select.tsx +3 -2
- package/src/scripts/search/inputs/date-radios.tsx +3 -2
- package/src/scripts/search/inputs/diagnosis-select.tsx +3 -2
- package/src/scripts/search/inputs/initiative-select.tsx +12 -6
- package/src/scripts/search/inputs/keyword-input.tsx +2 -2
- package/src/scripts/search/inputs/modality-select.tsx +28 -26
- package/src/scripts/search/inputs/pet/bodyParts_input.tsx +4 -3
- package/src/scripts/search/inputs/pet/scannerManufacturersModelNames_input.tsx +4 -3
- package/src/scripts/search/inputs/pet/scannerManufacturers_input.tsx +4 -3
- package/src/scripts/search/inputs/pet/tracerNames_input.tsx +4 -3
- package/src/scripts/search/inputs/pet/tracerRadionuclides_input.tsx +4 -3
- package/src/scripts/search/inputs/section-select.tsx +3 -2
- package/src/scripts/search/inputs/sex-radios.tsx +3 -2
- package/src/scripts/search/inputs/show-datasets-radios.tsx +4 -3
- package/src/scripts/search/inputs/sort-by-select.tsx +1 -1
- package/src/scripts/search/inputs/species-select.tsx +3 -2
- package/src/scripts/search/inputs/study-domain-input.tsx +4 -3
- package/src/scripts/search/inputs/subject-count-range-input.tsx +3 -2
- package/src/scripts/search/inputs/task-input.tsx +4 -3
- package/src/scripts/search/search-container.tsx +14 -17
- package/src/scripts/search/search-params-ctx.tsx +28 -5
- package/src/scripts/search/search-routes.tsx +2 -4
- package/src/scripts/search/use-search-results.tsx +14 -13
- package/src/scripts/uploader/upload-issues.tsx +1 -1
- package/src/scripts/uploader/upload-progress.jsx +1 -1
- package/src/scripts/uploader/uploader-modal.jsx +1 -1
- package/src/scripts/users/components/close-button.tsx +1 -1
- package/src/scripts/users/components/edit-button.tsx +1 -1
- package/src/scripts/users/components/edit-list.tsx +1 -1
- package/src/scripts/users/components/edit-string.tsx +1 -1
- package/src/scripts/users/dataset-card.tsx +2 -2
- package/src/scripts/users/user-notification-accordion.tsx +1 -1
- package/src/scripts/utils/user-login-modal-ctx.tsx +1 -1
- package/src/scripts/validation/validation-issues.tsx +2 -1
- package/src/scripts/validation/validation-panel.tsx +2 -1
- package/src/scripts/validation/validation-results.tsx +4 -3
- package/src/scripts/validation-legacy/validation-panel.jsx +2 -1
- package/src/scripts/validation-legacy/validation-results.issues.jsx +2 -3
- package/src/scripts/validation-legacy/validation-results.tsx +3 -4
- package/tsconfig.json +1 -4
|
@@ -8,6 +8,7 @@ import FileViewerCsv from "./viewers/file-viewer-csv.jsx"
|
|
|
8
8
|
import FileViewerHtml from "./viewers/file-viewer-html.jsx"
|
|
9
9
|
import { FileViewerNeurosift } from "./viewers/file-viewer-neurosift"
|
|
10
10
|
import { isNifti } from "./file-types"
|
|
11
|
+
import FileViewerMarkdown from "./viewers/file-viewer-markdown"
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Choose the right viewer for each file type
|
|
@@ -18,13 +19,16 @@ const FileViewerType = ({ path, url, data }) => {
|
|
|
18
19
|
path.endsWith("CHANGES") ||
|
|
19
20
|
path.endsWith(".bidsignore") ||
|
|
20
21
|
path.endsWith(".gitignore") ||
|
|
21
|
-
path.endsWith(".txt")
|
|
22
|
+
path.endsWith(".txt") ||
|
|
23
|
+
path.endsWith(".rst")
|
|
22
24
|
) {
|
|
23
25
|
return <FileViewerText data={data} />
|
|
24
26
|
} else if (
|
|
25
27
|
isNifti(path)
|
|
26
28
|
) {
|
|
27
29
|
return <FileViewerNifti imageUrl={url} />
|
|
30
|
+
} else if (path.endsWith(".md")) {
|
|
31
|
+
return <FileViewerMarkdown data={data} />
|
|
28
32
|
} else if (path.endsWith(".json")) {
|
|
29
33
|
return <FileViewerJson data={data} />
|
|
30
34
|
} else if (path.endsWith(".tsv")) {
|
|
@@ -8,8 +8,8 @@ import RemoveAnnexObject from "../mutations/remove-annex-object.jsx"
|
|
|
8
8
|
import FlagAnnexObject from "../mutations/flag-annex-object.jsx"
|
|
9
9
|
import { isAdmin } from "../../authentication/admin-user.jsx"
|
|
10
10
|
import { getProfile, hasEditPermissions } from "../../authentication/profile"
|
|
11
|
-
import { Icon } from "
|
|
12
|
-
import { Tooltip } from "
|
|
11
|
+
import { Icon } from "../../components/icon/Icon"
|
|
12
|
+
import { Tooltip } from "../../components/tooltip/Tooltip"
|
|
13
13
|
import { useCookies } from "react-cookie"
|
|
14
14
|
import { useAgreement } from "../../components/agreement"
|
|
15
15
|
|
|
@@ -3,10 +3,10 @@ import PropTypes from "prop-types"
|
|
|
3
3
|
import FileTree from "./file-tree"
|
|
4
4
|
import { Media } from "../../styles/media"
|
|
5
5
|
import { gql, useMutation } from "@apollo/client"
|
|
6
|
-
import { WarnButton } from "
|
|
7
|
-
import { AccordionWrap } from "
|
|
6
|
+
import { WarnButton } from "../../components/warn-button/WarnButton"
|
|
7
|
+
import { AccordionWrap } from "../../components/accordion/AccordionWrap"
|
|
8
8
|
import styled from "@emotion/styled"
|
|
9
|
-
import { Tooltip } from "
|
|
9
|
+
import { Tooltip } from "../../components/tooltip/Tooltip"
|
|
10
10
|
import type { DatasetFile } from "../../types/dataset-file"
|
|
11
11
|
import bytes from "bytes"
|
|
12
12
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import PropTypes from "prop-types"
|
|
3
3
|
import styled from "@emotion/styled"
|
|
4
|
-
import { RecursiveProperty } from "
|
|
4
|
+
import { RecursiveProperty } from "../../../components/json-tree/RecursiveProperty"
|
|
5
5
|
|
|
6
6
|
const WrappedPre = styled.pre`
|
|
7
7
|
white-space: pre-wrap;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { Markdown } from "../../../utils/markdown"
|
|
3
|
+
|
|
4
|
+
interface FileViewerMarkdownProps {
|
|
5
|
+
data: ArrayBuffer
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const FileViewerMarkdown = ({ data }: FileViewerMarkdownProps) => {
|
|
9
|
+
const decoder = new TextDecoder()
|
|
10
|
+
return <Markdown>{decoder.decode(data)}</Markdown>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default FileViewerMarkdown
|
|
@@ -3,8 +3,8 @@ import PropTypes from "prop-types"
|
|
|
3
3
|
import getYear from "date-fns/getYear"
|
|
4
4
|
import parseISO from "date-fns/parseISO"
|
|
5
5
|
import { CopyToClipboard } from "react-copy-to-clipboard"
|
|
6
|
-
import { Button } from "
|
|
7
|
-
import { Tooltip } from "
|
|
6
|
+
import { Button } from "../../components/button/Button"
|
|
7
|
+
import { Tooltip } from "../../components/tooltip/Tooltip"
|
|
8
8
|
|
|
9
9
|
export const formatCitation = (snapshot, style) => {
|
|
10
10
|
const year = getYear(parseISO(snapshot.created))
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import { gql, useMutation } from "@apollo/client"
|
|
3
3
|
import PropTypes from "prop-types"
|
|
4
|
-
import { Button } from "
|
|
4
|
+
import { Button } from "../../components/button/Button"
|
|
5
5
|
import styled from "@emotion/styled"
|
|
6
6
|
|
|
7
7
|
const ButtonRow = styled.div`
|
|
@@ -2,7 +2,7 @@ import React from "react"
|
|
|
2
2
|
import PropTypes from "prop-types"
|
|
3
3
|
import { gql } from "@apollo/client"
|
|
4
4
|
import { Mutation } from "@apollo/client/react/components"
|
|
5
|
-
import { Button } from "
|
|
5
|
+
import { Button } from "../../components/button/Button"
|
|
6
6
|
const CACHE_CLEAR = gql`
|
|
7
7
|
mutation cacheClear($datasetId: ID!) {
|
|
8
8
|
cacheClear(datasetId: $datasetId)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import type { FC } from "react"
|
|
3
3
|
import { gql, useMutation } from "@apollo/client"
|
|
4
|
-
import { Tooltip } from "
|
|
5
|
-
import { Button } from "
|
|
4
|
+
import { Tooltip } from "../../components/tooltip/Tooltip"
|
|
5
|
+
import { Button } from "../../components/button/Button"
|
|
6
6
|
|
|
7
7
|
const CREATE_LINK = gql`
|
|
8
8
|
mutation createReviewer($datasetId: ID!) {
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import React, { useState } from "react"
|
|
2
|
+
import { gql, useMutation, useQuery } from "@apollo/client"
|
|
3
|
+
import { toast } from "react-toastify"
|
|
4
|
+
import ToastContent from "../../common/partials/toast-content.jsx"
|
|
5
|
+
import * as Sentry from "@sentry/react"
|
|
6
|
+
import { DatasetEventItem } from "../components/DatasetEventItem"
|
|
7
|
+
import styles from "../components/scss/dataset-events.module.scss"
|
|
8
|
+
|
|
9
|
+
// Query to fetch events for the given dataset
|
|
10
|
+
const GET_DATASET_EVENTS = gql`
|
|
11
|
+
query GetDatasetEvents($datasetId: ID!) {
|
|
12
|
+
dataset(id: $datasetId) {
|
|
13
|
+
events {
|
|
14
|
+
id
|
|
15
|
+
note
|
|
16
|
+
success
|
|
17
|
+
timestamp
|
|
18
|
+
user {
|
|
19
|
+
email
|
|
20
|
+
name
|
|
21
|
+
}
|
|
22
|
+
event {
|
|
23
|
+
type
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`
|
|
29
|
+
|
|
30
|
+
const SAVE_ADMIN_NOTE_MUTATION = gql`
|
|
31
|
+
mutation SaveAdminNote($datasetId: ID!, $note: String!) {
|
|
32
|
+
saveAdminNote(datasetId: $datasetId, note: $note) {
|
|
33
|
+
note
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
`
|
|
37
|
+
|
|
38
|
+
const UPDATE_ADMIN_NOTE_MUTATION = gql`
|
|
39
|
+
mutation SaveAdminNote(
|
|
40
|
+
$note: String!
|
|
41
|
+
$datasetId: ID!
|
|
42
|
+
$saveAdminNoteId: ID
|
|
43
|
+
) {
|
|
44
|
+
saveAdminNote(note: $note, datasetId: $datasetId, id: $saveAdminNoteId) {
|
|
45
|
+
id
|
|
46
|
+
note
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
`
|
|
50
|
+
|
|
51
|
+
export const DatasetEvents = ({ datasetId }) => {
|
|
52
|
+
const { data, loading, error, refetch } = useQuery(GET_DATASET_EVENTS, {
|
|
53
|
+
variables: { datasetId },
|
|
54
|
+
fetchPolicy: "network-only",
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
const [newEvent, setNewEvent] = useState({ note: "" })
|
|
58
|
+
const [showForm, setShowForm] = useState(false)
|
|
59
|
+
const [editingNoteId, setEditingNoteId] = useState(null)
|
|
60
|
+
const [updatedNote, setUpdatedNote] = useState("")
|
|
61
|
+
|
|
62
|
+
const [saveAdminNote] = useMutation(SAVE_ADMIN_NOTE_MUTATION, {
|
|
63
|
+
onCompleted: () => {
|
|
64
|
+
toast.success(<ToastContent title="Admin note added successfully" />)
|
|
65
|
+
setNewEvent({ note: "" })
|
|
66
|
+
setShowForm(false)
|
|
67
|
+
refetch()
|
|
68
|
+
},
|
|
69
|
+
onError: (error) => {
|
|
70
|
+
Sentry.captureException(error)
|
|
71
|
+
},
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
const [updateAdminNote] = useMutation(UPDATE_ADMIN_NOTE_MUTATION, {
|
|
75
|
+
onCompleted: () => {
|
|
76
|
+
toast.success(<ToastContent title="Admin note updated successfully" />)
|
|
77
|
+
setEditingNoteId(null)
|
|
78
|
+
setUpdatedNote("")
|
|
79
|
+
refetch()
|
|
80
|
+
},
|
|
81
|
+
onError: (error) => {
|
|
82
|
+
Sentry.captureException(error)
|
|
83
|
+
},
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
const handleAddEvent = () => {
|
|
87
|
+
if (newEvent.note) {
|
|
88
|
+
saveAdminNote({
|
|
89
|
+
variables: {
|
|
90
|
+
datasetId,
|
|
91
|
+
note: newEvent.note,
|
|
92
|
+
},
|
|
93
|
+
})
|
|
94
|
+
} else {
|
|
95
|
+
toast.error(
|
|
96
|
+
<ToastContent
|
|
97
|
+
title="Failed to add admin note"
|
|
98
|
+
body="Please fill in the note"
|
|
99
|
+
/>,
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const handleUpdateNote = () => {
|
|
105
|
+
if (updatedNote) {
|
|
106
|
+
updateAdminNote({
|
|
107
|
+
variables: {
|
|
108
|
+
datasetId,
|
|
109
|
+
note: updatedNote,
|
|
110
|
+
saveAdminNoteId: editingNoteId,
|
|
111
|
+
},
|
|
112
|
+
})
|
|
113
|
+
} else {
|
|
114
|
+
toast.error("Please fill in the updated note")
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const toggleForm = () => {
|
|
119
|
+
setShowForm((prevState) => !prevState)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const startEditingNote = (eventId, note) => {
|
|
123
|
+
setEditingNoteId(eventId)
|
|
124
|
+
setUpdatedNote(note)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (loading) return <p>Loading events...</p>
|
|
128
|
+
if (error) return <p>Error fetching events</p>
|
|
129
|
+
|
|
130
|
+
const events = data?.dataset?.events || []
|
|
131
|
+
|
|
132
|
+
return (
|
|
133
|
+
<div className={styles.datasetEvents}>
|
|
134
|
+
<div className={styles.datasetEventHeader}>
|
|
135
|
+
<h4>Dataset Events</h4>
|
|
136
|
+
<span
|
|
137
|
+
className={`${styles.addEventBtn} on-button on-button--small on-button--primary icon-text`}
|
|
138
|
+
onClick={toggleForm}
|
|
139
|
+
>
|
|
140
|
+
{showForm ? "Cancel" : "Add Admin Note"}
|
|
141
|
+
</span>
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
{/* Add new admin note form */}
|
|
145
|
+
{showForm && (
|
|
146
|
+
<div className={styles.addEventForm}>
|
|
147
|
+
<textarea
|
|
148
|
+
placeholder="Admin note"
|
|
149
|
+
value={newEvent.note}
|
|
150
|
+
onChange={(e) => setNewEvent({ note: e.target.value })}
|
|
151
|
+
/>
|
|
152
|
+
<button
|
|
153
|
+
className="on-button on-button--small on-button--primary"
|
|
154
|
+
onClick={handleAddEvent}
|
|
155
|
+
>
|
|
156
|
+
Save Admin Note
|
|
157
|
+
</button>
|
|
158
|
+
</div>
|
|
159
|
+
)}
|
|
160
|
+
|
|
161
|
+
{/* Event list */}
|
|
162
|
+
{events.length === 0 ? <p>No events found for this dataset.</p> : (
|
|
163
|
+
<>
|
|
164
|
+
<div className="grid faux-table-header">
|
|
165
|
+
<h4 className="col-lg col col-5">Note</h4>
|
|
166
|
+
<h4 className="col-lg col col-3">Date</h4>
|
|
167
|
+
<h4 className="col-lg col col-3">Author</h4>
|
|
168
|
+
<h4 className="col-lg col col-1">Action</h4>
|
|
169
|
+
</div>
|
|
170
|
+
<ul>
|
|
171
|
+
{events.map((event) => (
|
|
172
|
+
<DatasetEventItem
|
|
173
|
+
key={event.id}
|
|
174
|
+
event={event}
|
|
175
|
+
editingNoteId={editingNoteId}
|
|
176
|
+
updatedNote={updatedNote}
|
|
177
|
+
startEditingNote={startEditingNote}
|
|
178
|
+
handleUpdateNote={handleUpdateNote}
|
|
179
|
+
setUpdatedNote={setUpdatedNote}
|
|
180
|
+
/>
|
|
181
|
+
))}
|
|
182
|
+
</ul>
|
|
183
|
+
</>
|
|
184
|
+
)}
|
|
185
|
+
</div>
|
|
186
|
+
)
|
|
187
|
+
}
|
|
@@ -4,7 +4,7 @@ import SelectInput from "../fragments/select-input"
|
|
|
4
4
|
import { DOILink, DOIPattern } from "../fragments/doi-link"
|
|
5
5
|
import { gql, useApolloClient, useMutation, useQuery } from "@apollo/client"
|
|
6
6
|
import styled from "@emotion/styled"
|
|
7
|
-
import { Button } from "
|
|
7
|
+
import { Button } from "../../components/button/Button"
|
|
8
8
|
|
|
9
9
|
const getDatasetRelations = gql`
|
|
10
10
|
query getDatasetRelations($datasetId: ID!) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import type { FC } from "react"
|
|
3
3
|
import { gql, useMutation } from "@apollo/client"
|
|
4
|
-
import { WarnButton } from "
|
|
4
|
+
import { WarnButton } from "../../components/warn-button/WarnButton"
|
|
5
5
|
import { DATASET_REVIEWERS } from "../fragments/dataset-reviewers"
|
|
6
6
|
|
|
7
7
|
const DELETE_REVIEWER = gql`
|
|
@@ -4,7 +4,7 @@ import { gql } from "@apollo/client"
|
|
|
4
4
|
import { Mutation } from "@apollo/client/react/components"
|
|
5
5
|
import { DATASET_COMMENTS } from "../fragments/comments-fragments"
|
|
6
6
|
import { datasetCacheId } from "./cache-id.js"
|
|
7
|
-
import { Icon } from "
|
|
7
|
+
import { Icon } from "../../components/icon/Icon"
|
|
8
8
|
|
|
9
9
|
const deleteComment = gql`
|
|
10
10
|
mutation deleteComment($commentId: ID!, $deleteChildren: Boolean) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import PropTypes from "prop-types"
|
|
3
3
|
import { gql, useMutation } from "@apollo/client"
|
|
4
|
-
import { WarnButton } from "
|
|
4
|
+
import { WarnButton } from "../../components/warn-button/WarnButton"
|
|
5
5
|
|
|
6
6
|
const DELETE_FILE = gql`
|
|
7
7
|
mutation deleteFiles($datasetId: ID!, $files: [DeleteFile]) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import type { FC } from "react"
|
|
3
3
|
import { gql, useMutation } from "@apollo/client"
|
|
4
|
-
import { Button } from "
|
|
4
|
+
import { Button } from "../../components/button/Button"
|
|
5
5
|
import { useNavigate } from "react-router-dom"
|
|
6
6
|
|
|
7
7
|
export const DEPRECATE_VERSION = gql`
|
|
@@ -2,8 +2,8 @@ import React from "react"
|
|
|
2
2
|
import PropTypes from "prop-types"
|
|
3
3
|
import { gql } from "@apollo/client"
|
|
4
4
|
import { Mutation } from "@apollo/client/react/components"
|
|
5
|
-
import { WarnButton } from "
|
|
6
|
-
import { Tooltip } from "
|
|
5
|
+
import { WarnButton } from "../../components/warn-button/WarnButton"
|
|
6
|
+
import { Tooltip } from "../../components/tooltip/Tooltip"
|
|
7
7
|
|
|
8
8
|
const FLAG_ANNEX_OBJECT = gql`
|
|
9
9
|
mutation flagAnnexObject(
|
|
@@ -3,7 +3,7 @@ import type { FC } from "react"
|
|
|
3
3
|
import { gql } from "@apollo/client"
|
|
4
4
|
import { Mutation } from "@apollo/client/react/components"
|
|
5
5
|
import { datasetCacheId } from "../../datalad/mutations/cache-id.js"
|
|
6
|
-
import { CountToggle } from "
|
|
6
|
+
import { CountToggle } from "../../components/count-toggle/CountToggle"
|
|
7
7
|
import { UserModalOpenCtx } from "../../utils/user-login-modal-ctx"
|
|
8
8
|
|
|
9
9
|
const FOLLOW_DATASET = gql`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState } from "react"
|
|
2
2
|
import { gql, useApolloClient, useMutation } from "@apollo/client"
|
|
3
|
-
import { Button } from "
|
|
3
|
+
import { Button } from "../../components/button/Button"
|
|
4
4
|
import { createDataset } from "../../uploader/upload-mutation"
|
|
5
5
|
import styled from "@emotion/styled"
|
|
6
6
|
|
|
@@ -4,7 +4,7 @@ import { gql } from "@apollo/client"
|
|
|
4
4
|
import { Mutation } from "@apollo/client/react/components"
|
|
5
5
|
import { useNavigate } from "react-router-dom"
|
|
6
6
|
import { datasetCacheId } from "./cache-id.js"
|
|
7
|
-
import { Button } from "
|
|
7
|
+
import { Button } from "../../components/button/Button"
|
|
8
8
|
|
|
9
9
|
const PUBLISH_DATASET = gql`
|
|
10
10
|
mutation publishDataset($datasetId: ID!) {
|
|
@@ -2,8 +2,8 @@ import React from "react"
|
|
|
2
2
|
import PropTypes from "prop-types"
|
|
3
3
|
import { gql } from "@apollo/client"
|
|
4
4
|
import { Mutation } from "@apollo/client/react/components"
|
|
5
|
-
import { WarnButton } from "
|
|
6
|
-
import { Tooltip } from "
|
|
5
|
+
import { WarnButton } from "../../components/warn-button/WarnButton"
|
|
6
|
+
import { Tooltip } from "../../components/tooltip/Tooltip"
|
|
7
7
|
|
|
8
8
|
const REMOVE_ANNEX_OBJECT = gql`
|
|
9
9
|
mutation removeAnnexObject(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import type { FC } from "react"
|
|
3
3
|
import { gql, useMutation } from "@apollo/client"
|
|
4
|
-
import { WarnButton } from "
|
|
4
|
+
import { WarnButton } from "../../components/warn-button/WarnButton"
|
|
5
5
|
|
|
6
6
|
const REMOVE_PERMISSION = gql`
|
|
7
7
|
mutation removePermissions($datasetId: ID!, $userId: String!) {
|
|
@@ -2,8 +2,8 @@ import React from "react"
|
|
|
2
2
|
import PropTypes from "prop-types"
|
|
3
3
|
import { gql } from "@apollo/client"
|
|
4
4
|
import { Mutation } from "@apollo/client/react/components"
|
|
5
|
-
import { Button } from "
|
|
6
|
-
import { Tooltip } from "
|
|
5
|
+
import { Button } from "../../components/button/Button"
|
|
6
|
+
import { Tooltip } from "../../components/tooltip/Tooltip"
|
|
7
7
|
|
|
8
8
|
const REVALIDATE = gql`
|
|
9
9
|
mutation revalidate($datasetId: ID!, $ref: String!) {
|
|
@@ -3,7 +3,7 @@ import PropTypes from "prop-types"
|
|
|
3
3
|
import { gql, useMutation } from "@apollo/client"
|
|
4
4
|
import { useNavigate } from "react-router-dom"
|
|
5
5
|
import ErrorBoundary from "../../errors/errorBoundary.jsx"
|
|
6
|
-
import { Button } from "
|
|
6
|
+
import { Button } from "../../components/button/Button"
|
|
7
7
|
import { getDatasetPage, getDraftPage } from "../../queries/dataset"
|
|
8
8
|
|
|
9
9
|
const CREATE_SNAPSHOT = gql`
|
|
@@ -3,7 +3,7 @@ import type { FC } from "react"
|
|
|
3
3
|
import { gql } from "@apollo/client"
|
|
4
4
|
import { Mutation } from "@apollo/client/react/components"
|
|
5
5
|
import { datasetCacheId } from "../../datalad/mutations/cache-id.js"
|
|
6
|
-
import { CountToggle } from "
|
|
6
|
+
import { CountToggle } from "../../components/count-toggle/CountToggle"
|
|
7
7
|
import { UserModalOpenCtx } from "../../utils/user-login-modal-ctx"
|
|
8
8
|
|
|
9
9
|
const STAR_DATASET = gql`
|
|
@@ -4,7 +4,7 @@ import { gql } from "@apollo/client"
|
|
|
4
4
|
import { Mutation } from "@apollo/client/react/components"
|
|
5
5
|
import { DATASET_METADATA } from "../../datalad/dataset/dataset-query-fragments"
|
|
6
6
|
import { datasetCacheId } from "./cache-id.js"
|
|
7
|
-
import { Button } from "
|
|
7
|
+
import { Button } from "../../components/button/Button"
|
|
8
8
|
|
|
9
9
|
export const SUBMIT_METADATA = gql`
|
|
10
10
|
mutation addMetadata($datasetId: ID!, $metadata: MetadataInput!) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import type { FC } from "react"
|
|
3
3
|
import { gql, useMutation } from "@apollo/client"
|
|
4
|
-
import { Button } from "
|
|
5
|
-
import { Tooltip } from "
|
|
4
|
+
import { Button } from "../../components/button/Button"
|
|
5
|
+
import { Tooltip } from "../../components/tooltip/Tooltip"
|
|
6
6
|
|
|
7
7
|
const UNDO_DEPRECATE_VERSION = gql`
|
|
8
8
|
mutation undoDeprecateSnapshot($datasetId: ID!, $tag: String!) {
|
|
@@ -5,7 +5,7 @@ import type { ApolloError } from "@apollo/client"
|
|
|
5
5
|
import { toast } from "react-toastify"
|
|
6
6
|
import ToastContent from "../../common/partials/toast-content"
|
|
7
7
|
import { validate as isValidEmail } from "email-validator"
|
|
8
|
-
import { Button } from "
|
|
8
|
+
import { Button } from "../../components/button/Button"
|
|
9
9
|
|
|
10
10
|
import { isValidOrcid } from "../../utils/validationUtils"
|
|
11
11
|
|
|
@@ -5,6 +5,7 @@ import CacheClear from "../mutations/cache-clear.jsx"
|
|
|
5
5
|
import AdminExports from "../mutations/admin-exports"
|
|
6
6
|
import { DatasetPageBorder } from "./styles/dataset-page-border"
|
|
7
7
|
import { HeaderRow3, HeaderRow4 } from "./styles/header-row"
|
|
8
|
+
import { DatasetEvents } from "../mutations/dataset-events"
|
|
8
9
|
|
|
9
10
|
const AdminDataset = ({ dataset }) => (
|
|
10
11
|
<DatasetPageBorder className="datalad-dataset-form">
|
|
@@ -29,6 +30,9 @@ const AdminDataset = ({ dataset }) => (
|
|
|
29
30
|
<hr />
|
|
30
31
|
<HeaderRow4>Draft Head</HeaderRow4>
|
|
31
32
|
{dataset.draft.head}
|
|
33
|
+
<hr />
|
|
34
|
+
<DatasetEvents datasetId={dataset.id} />
|
|
35
|
+
<hr />
|
|
32
36
|
<DatasetHistory datasetId={dataset.id} />
|
|
33
37
|
</DatasetPageBorder>
|
|
34
38
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import { Markdown } from "../../utils/markdown"
|
|
3
|
-
import { ReadMore } from "
|
|
3
|
+
import { ReadMore } from "../../components/read-more/ReadMore"
|
|
4
4
|
import { MetaDataBlock } from "../components/MetaDataBlock"
|
|
5
5
|
import Files from "../files/files"
|
|
6
6
|
import Comments from "../comments/comments"
|
|
@@ -4,6 +4,8 @@ import DeleteDataset from "../mutations/delete.jsx"
|
|
|
4
4
|
import LoggedIn from "../../authentication/logged-in.jsx"
|
|
5
5
|
import { DatasetPageBorder } from "./styles/dataset-page-border"
|
|
6
6
|
import { HeaderRow3 } from "./styles/header-row"
|
|
7
|
+
import { useCookies } from "react-cookie"
|
|
8
|
+
import { getUnexpiredProfile } from "../../authentication/profile.js"
|
|
7
9
|
|
|
8
10
|
interface DeletePageAction {
|
|
9
11
|
datasetId: string
|
|
@@ -87,13 +89,15 @@ interface DeletePageProps {
|
|
|
87
89
|
const DeletePage = (
|
|
88
90
|
{ dataset, hasEdit }: DeletePageProps,
|
|
89
91
|
): React.ReactElement => {
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
+
const [cookies] = useCookies()
|
|
93
|
+
const profile = getUnexpiredProfile(cookies)
|
|
94
|
+
const canBeDeleted = profile?.admin ||
|
|
95
|
+
(dataset.snapshots.length === 0 && hasEdit)
|
|
92
96
|
return (
|
|
93
97
|
<DatasetPageBorder>
|
|
94
98
|
<HeaderRow3>Delete Dataset</HeaderRow3>
|
|
95
99
|
{canBeDeleted
|
|
96
|
-
? <DeletePageAction datasetId={
|
|
100
|
+
? <DeletePageAction datasetId={dataset.id} hasEdit={hasEdit} />
|
|
97
101
|
: <DeletePageMessage hasEdit={hasEdit} />}
|
|
98
102
|
</DatasetPageBorder>
|
|
99
103
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState } from "react"
|
|
2
2
|
import { DeprecateVersion } from "../mutations/deprecate-version"
|
|
3
|
-
import { Input } from "
|
|
3
|
+
import { Input } from "../../components/input/Input"
|
|
4
4
|
import LoggedIn from "../../authentication/logged-in.jsx"
|
|
5
5
|
import { DatasetPageBorder } from "./styles/dataset-page-border"
|
|
6
6
|
import { HeaderRow3 } from "./styles/header-row"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState } from "react"
|
|
2
2
|
import PropTypes from "prop-types"
|
|
3
|
-
import { Button } from "
|
|
3
|
+
import { Button } from "../../components/button/Button"
|
|
4
4
|
|
|
5
5
|
import { RemovePermissions } from "../mutations/remove-permissions"
|
|
6
6
|
import { UpdateDatasetPermissions } from "../mutations/update-permissions"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import { Markdown } from "../../utils/markdown"
|
|
3
|
-
import { ReadMore } from "
|
|
3
|
+
import { ReadMore } from "../../components/read-more/ReadMore"
|
|
4
4
|
import { MetaDataBlock } from "../components/MetaDataBlock"
|
|
5
5
|
import Files from "../files/files"
|
|
6
6
|
import Comments from "../comments/comments"
|
|
@@ -3,7 +3,7 @@ import semver from "semver"
|
|
|
3
3
|
import type { ReleaseType } from "semver"
|
|
4
4
|
import SnapshotDataset from "../mutations/snapshot"
|
|
5
5
|
import EditList from "../fragments/edit-list.jsx"
|
|
6
|
-
import { Button } from "
|
|
6
|
+
import { Button } from "../../components/button/Button"
|
|
7
7
|
import { DatasetPageBorder } from "./styles/dataset-page-border"
|
|
8
8
|
import { HeaderRow4 } from "./styles/header-row"
|
|
9
9
|
import FileView from "../files/file-view"
|