@openneuro/app 4.5.1 → 4.6.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 -4
- package/src/scripts/datalad/dataset/dataset-query-fragments.js +2 -0
- package/src/scripts/dataset/dataset-routes.jsx +2 -126
- package/src/scripts/dataset/draft-container.tsx +14 -52
- package/src/scripts/dataset/fragments/dataset-history.jsx +38 -42
- package/src/scripts/dataset/mutations/admin-exports.jsx +70 -0
- package/src/scripts/dataset/mutations/create-anonymous-reviewer.tsx +0 -3
- package/src/scripts/dataset/mutations/dataset-relations.tsx +4 -15
- package/src/scripts/dataset/mutations/metadata-form.jsx +1 -1
- package/src/scripts/dataset/mutations/remove-annex-object.jsx +0 -1
- package/src/scripts/dataset/mutations/snapshot.tsx +16 -2
- package/src/scripts/dataset/routes/add-metadata.jsx +20 -24
- package/src/scripts/dataset/routes/admin-datalad.jsx +26 -33
- package/src/scripts/dataset/routes/dataset-default.tsx +54 -0
- package/src/scripts/dataset/routes/delete-page.tsx +5 -9
- package/src/scripts/dataset/routes/deprecate-snapshot-page.tsx +6 -7
- package/src/scripts/dataset/routes/download-dataset.tsx +24 -47
- package/src/scripts/dataset/routes/manage-anonymous-reviewers.tsx +9 -3
- package/src/scripts/dataset/routes/manage-permissions.jsx +7 -10
- package/src/scripts/dataset/routes/publish.jsx +10 -12
- package/src/scripts/dataset/routes/snapshot-default.tsx +44 -0
- package/src/scripts/dataset/routes/snapshot.jsx +84 -75
- package/src/scripts/dataset/routes/styles/dataset-page-border.tsx +8 -0
- package/src/scripts/dataset/routes/styles/dataset-page-tab-container.tsx +8 -0
- package/src/scripts/dataset/routes/styles/draft-background.tsx +7 -0
- package/src/scripts/dataset/routes/styles/header-row.tsx +12 -0
- package/src/scripts/dataset/routes/tab-routes-draft.tsx +88 -0
- package/src/scripts/dataset/routes/tab-routes-snapshot.tsx +57 -0
- package/src/scripts/dataset/snapshot-container.tsx +6 -39
- package/src/scripts/search/use-search-results.tsx +1 -0
- package/src/scripts/dataset/routes/admin-exports.jsx +0 -130
|
@@ -1,43 +1,36 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import { Link } from 'react-router-dom'
|
|
4
3
|
import DatasetHistory from '../fragments/dataset-history.jsx'
|
|
5
4
|
import CacheClear from '../mutations/cache-clear.jsx'
|
|
5
|
+
import AdminExports from '../mutations/admin-exports'
|
|
6
|
+
import { DatasetPageBorder } from './styles/dataset-page-border'
|
|
7
|
+
import { HeaderRow3, HeaderRow4 } from './styles/header-row'
|
|
6
8
|
|
|
7
9
|
const AdminDataset = ({ dataset }) => (
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
cache is repopulated on the next API call.
|
|
18
|
-
</p>
|
|
19
|
-
<p>
|
|
20
|
-
Reset draft head will move the draft to a given commit and rerun
|
|
21
|
-
validation.
|
|
22
|
-
</p>
|
|
23
|
-
</div>
|
|
24
|
-
<div className="col col-12">
|
|
25
|
-
<h3>Draft Head</h3> {dataset.draft.head}
|
|
26
|
-
</div>
|
|
27
|
-
<DatasetHistory datasetId={dataset.id} />
|
|
28
|
-
<hr />
|
|
29
|
-
<div className="col col-12 dataset-form-controls">
|
|
30
|
-
<div className="grid">
|
|
31
|
-
<CacheClear datasetId={dataset.id} />
|
|
32
|
-
<Link
|
|
33
|
-
className="return-link col-middle"
|
|
34
|
-
to={`/datasets/${dataset.id}`}>
|
|
35
|
-
Return to Dataset
|
|
36
|
-
</Link>
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
10
|
+
<DatasetPageBorder className="datalad-dataset-form">
|
|
11
|
+
<HeaderRow3>Site Admin Tools</HeaderRow3>
|
|
12
|
+
<p>
|
|
13
|
+
Delete dataset cache drops this dataset's caches (snapshot index,
|
|
14
|
+
draft/snapshot file listings, current dataset description) and the cache
|
|
15
|
+
is repopulated on the next API call.
|
|
16
|
+
</p>
|
|
17
|
+
<div className="dataset-form-controls">
|
|
18
|
+
<CacheClear datasetId={dataset.id} />
|
|
39
19
|
</div>
|
|
40
|
-
|
|
20
|
+
<hr />
|
|
21
|
+
<HeaderRow4>Rerun Exports</HeaderRow4>
|
|
22
|
+
<p>
|
|
23
|
+
Correct most temporary issues with a dataset export by reattempting to
|
|
24
|
+
push to S3 and GitHub.
|
|
25
|
+
</p>
|
|
26
|
+
<div className="dataset-form-controls">
|
|
27
|
+
<AdminExports />
|
|
28
|
+
</div>
|
|
29
|
+
<hr />
|
|
30
|
+
<HeaderRow4>Draft Head</HeaderRow4>
|
|
31
|
+
{dataset.draft.head}
|
|
32
|
+
<DatasetHistory datasetId={dataset.id} />
|
|
33
|
+
</DatasetPageBorder>
|
|
41
34
|
)
|
|
42
35
|
|
|
43
36
|
AdminDataset.propTypes = {
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Markdown from 'markdown-to-jsx'
|
|
3
|
+
import { ReadMore } from '@openneuro/components/read-more'
|
|
4
|
+
import { MetaDataBlock } from '@openneuro/components/dataset'
|
|
5
|
+
import Files from '../files/files'
|
|
6
|
+
import Comments from '../comments/comments'
|
|
7
|
+
import EditDescriptionField from '../fragments/edit-description-field'
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Default tab for dataset draft pages
|
|
11
|
+
*/
|
|
12
|
+
export const DatasetDefault = ({ dataset, hasEdit }) => (
|
|
13
|
+
<>
|
|
14
|
+
<ReadMore
|
|
15
|
+
fileTree={true}
|
|
16
|
+
id="collapse-tree"
|
|
17
|
+
expandLabel="Expand File Tree"
|
|
18
|
+
collapseLabel="Collapse File Tree">
|
|
19
|
+
<Files
|
|
20
|
+
datasetId={dataset.id}
|
|
21
|
+
snapshotTag={null}
|
|
22
|
+
datasetName={dataset.draft.description.Name}
|
|
23
|
+
files={dataset.draft.files}
|
|
24
|
+
editMode={hasEdit}
|
|
25
|
+
datasetPermissions={dataset.permissions}
|
|
26
|
+
/>
|
|
27
|
+
</ReadMore>
|
|
28
|
+
<MetaDataBlock
|
|
29
|
+
heading="README"
|
|
30
|
+
className="dataset-readme markdown-body"
|
|
31
|
+
item={dataset.draft.readme}
|
|
32
|
+
renderEditor={() => (
|
|
33
|
+
<EditDescriptionField
|
|
34
|
+
datasetId={dataset.id}
|
|
35
|
+
field="readme"
|
|
36
|
+
rows={12}
|
|
37
|
+
description={dataset.draft.readme}
|
|
38
|
+
editMode={hasEdit}>
|
|
39
|
+
<ReadMore
|
|
40
|
+
id="readme"
|
|
41
|
+
expandLabel="Read More"
|
|
42
|
+
collapseLabel="Collapse">
|
|
43
|
+
<Markdown>{dataset.draft.readme || 'N/A'}</Markdown>
|
|
44
|
+
</ReadMore>
|
|
45
|
+
</EditDescriptionField>
|
|
46
|
+
)}
|
|
47
|
+
/>
|
|
48
|
+
<Comments
|
|
49
|
+
datasetId={dataset.id}
|
|
50
|
+
uploader={dataset.uploader}
|
|
51
|
+
comments={dataset.comments}
|
|
52
|
+
/>
|
|
53
|
+
</>
|
|
54
|
+
)
|
|
@@ -6,8 +6,8 @@ import DeleteDatasetForm from '../mutations/delete-dataset-form.jsx'
|
|
|
6
6
|
import DeleteDataset from '../mutations/delete.jsx'
|
|
7
7
|
import LoggedIn from '../../authentication/logged-in.jsx'
|
|
8
8
|
import { hasEditPermissions, getProfile } from '../../authentication/profile.js'
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
9
|
+
import { DatasetPageBorder } from './styles/dataset-page-border'
|
|
10
|
+
import { HeaderRow3 } from './styles/header-row'
|
|
11
11
|
|
|
12
12
|
interface DeletePageProps extends RouteComponentProps {
|
|
13
13
|
dataset: {
|
|
@@ -35,9 +35,8 @@ const DeletePage = ({ dataset }: DeletePageProps): React.ReactElement => {
|
|
|
35
35
|
hasEditPermissions(dataset.permissions, user && user.sub)
|
|
36
36
|
const datasetId = dataset.id
|
|
37
37
|
return (
|
|
38
|
-
<
|
|
39
|
-
<
|
|
40
|
-
<hr />
|
|
38
|
+
<DatasetPageBorder>
|
|
39
|
+
<HeaderRow3>Delete Dataset</HeaderRow3>
|
|
41
40
|
<DeleteDatasetForm
|
|
42
41
|
values={values}
|
|
43
42
|
onChange={handleInputChange}
|
|
@@ -54,11 +53,8 @@ const DeletePage = ({ dataset }: DeletePageProps): React.ReactElement => {
|
|
|
54
53
|
<LoggedIn>
|
|
55
54
|
<DeleteDataset datasetId={datasetId} metadata={values} />
|
|
56
55
|
</LoggedIn>
|
|
57
|
-
<Link className="return-link" to={`/datasets/${datasetId}`}>
|
|
58
|
-
Return to Dataset
|
|
59
|
-
</Link>
|
|
60
56
|
</div>
|
|
61
|
-
</
|
|
57
|
+
</DatasetPageBorder>
|
|
62
58
|
)
|
|
63
59
|
}
|
|
64
60
|
|
|
@@ -3,6 +3,8 @@ import { Link, useRouteMatch } from 'react-router-dom'
|
|
|
3
3
|
import { DeprecateVersion } from '../mutations/deprecate-version'
|
|
4
4
|
import { Input } from '@openneuro/components/input'
|
|
5
5
|
import LoggedIn from '../../authentication/logged-in.jsx'
|
|
6
|
+
import { DatasetPageBorder } from './styles/dataset-page-border'
|
|
7
|
+
import { HeaderRow3 } from './styles/header-row'
|
|
6
8
|
|
|
7
9
|
interface DeprecateSnapshotRouteParams {
|
|
8
10
|
datasetId: string
|
|
@@ -16,8 +18,8 @@ export const DeprecateSnapshotPage = (): React.ReactElement => {
|
|
|
16
18
|
const [reason, setReason] = useState('')
|
|
17
19
|
|
|
18
20
|
return (
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
+
<DatasetPageBorder>
|
|
22
|
+
<HeaderRow3>Deprecate Version</HeaderRow3>
|
|
21
23
|
<p>
|
|
22
24
|
{`Deprecate ${datasetId} version ${snapshotTag} to let other users know about an issue with this version. The reason provided will be displayed for users visiting the version.`}
|
|
23
25
|
</p>
|
|
@@ -28,7 +30,7 @@ export const DeprecateSnapshotPage = (): React.ReactElement => {
|
|
|
28
30
|
labelStyle="default"
|
|
29
31
|
setValue={setReason}
|
|
30
32
|
/>
|
|
31
|
-
<
|
|
33
|
+
<br />
|
|
32
34
|
<div className="dataset-form-controls">
|
|
33
35
|
<LoggedIn>
|
|
34
36
|
<DeprecateVersion
|
|
@@ -37,10 +39,7 @@ export const DeprecateSnapshotPage = (): React.ReactElement => {
|
|
|
37
39
|
reason={reason}
|
|
38
40
|
/>
|
|
39
41
|
</LoggedIn>
|
|
40
|
-
<Link className="return-link" to={`/datasets/${datasetId}`}>
|
|
41
|
-
Return to Dataset
|
|
42
|
-
</Link>
|
|
43
42
|
</div>
|
|
44
|
-
</
|
|
43
|
+
</DatasetPageBorder>
|
|
45
44
|
)
|
|
46
45
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/* global globalThis */
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import PropTypes from 'prop-types'
|
|
4
|
-
import {
|
|
4
|
+
import { useRouteMatch } from 'react-router-dom'
|
|
5
5
|
import DownloadLink from '../download/download-link.jsx'
|
|
6
6
|
import DownloadS3 from '../download/download-s3.jsx'
|
|
7
7
|
import DownloadCommandLine from '../download/download-command-line.jsx'
|
|
8
8
|
import DownloadDatalad from '../download/download-datalad.jsx'
|
|
9
|
+
import { DatasetPageBorder } from './styles/dataset-page-border'
|
|
10
|
+
import { HeaderRow3 } from './styles/header-row'
|
|
9
11
|
|
|
10
12
|
interface SnapshotRouteParams {
|
|
11
13
|
datasetId?: string
|
|
@@ -18,53 +20,28 @@ const DownloadDataset = ({ worker, datasetPermissions }) => {
|
|
|
18
20
|
} = useRouteMatch<SnapshotRouteParams>()
|
|
19
21
|
const workerId = worker?.split('-').pop()
|
|
20
22
|
return (
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<
|
|
28
|
-
{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
snapshotTag={snapshotTag}
|
|
34
|
-
/>
|
|
35
|
-
)}
|
|
36
|
-
</div>
|
|
37
|
-
<div className="col col-lg">
|
|
38
|
-
<DownloadS3 datasetId={datasetId} />
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
<hr />
|
|
42
|
-
<div className="grid grid-between">
|
|
43
|
-
{'showDirectoryPicker' in globalThis && (
|
|
44
|
-
<div className="col col-lg">
|
|
45
|
-
<DownloadCommandLine
|
|
46
|
-
datasetId={datasetId}
|
|
47
|
-
snapshotTag={snapshotTag}
|
|
48
|
-
/>
|
|
49
|
-
</div>
|
|
50
|
-
)}
|
|
51
|
-
<div className="col col-lg">
|
|
52
|
-
<DownloadDatalad
|
|
53
|
-
datasetId={datasetId}
|
|
54
|
-
workerId={workerId}
|
|
55
|
-
datasetPermissions={datasetPermissions}
|
|
56
|
-
/>
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
<div className="grid grid-between">
|
|
60
|
-
<div className="col">
|
|
61
|
-
<Link className="return-link m-l-0" to={`/datasets/${datasetId}`}>
|
|
62
|
-
Return to Dataset
|
|
63
|
-
</Link>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
23
|
+
<DatasetPageBorder>
|
|
24
|
+
<HeaderRow3>How to Download</HeaderRow3>
|
|
25
|
+
<div className="grid grid-between">
|
|
26
|
+
{'showDirectoryPicker' in globalThis ? (
|
|
27
|
+
<DownloadLink datasetId={datasetId} snapshotTag={snapshotTag} />
|
|
28
|
+
) : (
|
|
29
|
+
<DownloadCommandLine
|
|
30
|
+
datasetId={datasetId}
|
|
31
|
+
snapshotTag={snapshotTag}
|
|
32
|
+
/>
|
|
33
|
+
)}
|
|
34
|
+
<DownloadS3 datasetId={datasetId} />
|
|
66
35
|
</div>
|
|
67
|
-
|
|
36
|
+
{'showDirectoryPicker' in globalThis && (
|
|
37
|
+
<DownloadCommandLine datasetId={datasetId} snapshotTag={snapshotTag} />
|
|
38
|
+
)}
|
|
39
|
+
<DownloadDatalad
|
|
40
|
+
datasetId={datasetId}
|
|
41
|
+
workerId={workerId}
|
|
42
|
+
datasetPermissions={datasetPermissions}
|
|
43
|
+
/>
|
|
44
|
+
</DatasetPageBorder>
|
|
68
45
|
)
|
|
69
46
|
}
|
|
70
47
|
|
|
@@ -2,6 +2,8 @@ import React, { FC } from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { DeleteReviewerLink } from '../mutations/delete-anonymous-reviewer'
|
|
4
4
|
import { CreateReviewLink } from '../mutations/create-anonymous-reviewer'
|
|
5
|
+
import { HeaderRow4 } from './styles/header-row'
|
|
6
|
+
|
|
5
7
|
const formatDate = dateObject =>
|
|
6
8
|
new Date(dateObject).toISOString().split('T')[0]
|
|
7
9
|
|
|
@@ -18,12 +20,16 @@ export const AnonymousReviewer: FC<AnonymousReviewerProps> = ({
|
|
|
18
20
|
reviewers,
|
|
19
21
|
}) => {
|
|
20
22
|
return (
|
|
21
|
-
<div className="dataset-anonymous-form
|
|
23
|
+
<div className="dataset-anonymous-form">
|
|
22
24
|
<div className="dataset-form-header">
|
|
23
25
|
<div className="form-group">
|
|
24
|
-
<
|
|
26
|
+
<HeaderRow4>Create Anonymous Reviewer Link</HeaderRow4>
|
|
27
|
+
<p>
|
|
28
|
+
Create an anonymous review link to share this dataset for anonymous
|
|
29
|
+
access. A review user has read only access and tokens are valid for
|
|
30
|
+
one year or until they are removed.
|
|
31
|
+
</p>
|
|
25
32
|
</div>
|
|
26
|
-
<hr />
|
|
27
33
|
<CreateReviewLink datasetId={datasetId} />
|
|
28
34
|
{reviewers.length ? (
|
|
29
35
|
<div className="dataset-form-body">
|
|
@@ -6,6 +6,8 @@ import { Button } from '@openneuro/components/button'
|
|
|
6
6
|
import { RemovePermissions } from '../mutations/remove-permissions'
|
|
7
7
|
import { UpdateDatasetPermissions } from '../mutations/update-permissions'
|
|
8
8
|
import { AnonymousReviewer } from './manage-anonymous-reviewers'
|
|
9
|
+
import { DatasetPageBorder } from './styles/dataset-page-border'
|
|
10
|
+
import { HeaderRow3 } from './styles/header-row'
|
|
9
11
|
|
|
10
12
|
const description = {
|
|
11
13
|
admin: 'Edit dataset and edit permissions',
|
|
@@ -71,15 +73,13 @@ const Share = ({ datasetId, permissions, reviewers }) => {
|
|
|
71
73
|
const adminActive = access === 'admin' && 'active'
|
|
72
74
|
|
|
73
75
|
return (
|
|
74
|
-
|
|
75
|
-
<div className="dataset-share-form
|
|
76
|
+
<DatasetPageBorder>
|
|
77
|
+
<div className="dataset-share-form">
|
|
76
78
|
<div className="dataset-form-header">
|
|
77
79
|
<div className="form-group">
|
|
78
|
-
<
|
|
80
|
+
<HeaderRow3>Share Dataset</HeaderRow3>
|
|
79
81
|
</div>
|
|
80
|
-
<hr />
|
|
81
82
|
<div className="dataset-form-body">
|
|
82
|
-
<h3>Dataset shared with:</h3>
|
|
83
83
|
<ShareTable datasetId={datasetId} permissions={permissions} />
|
|
84
84
|
<p>
|
|
85
85
|
Enter a user's email address and select access level to share
|
|
@@ -123,15 +123,12 @@ const Share = ({ datasetId, permissions, reviewers }) => {
|
|
|
123
123
|
metadata={access}
|
|
124
124
|
done={() => setUserEmail('')}
|
|
125
125
|
/>
|
|
126
|
-
<Link className="return-link" to={`/datasets/${datasetId}`}>
|
|
127
|
-
Return to Dataset
|
|
128
|
-
</Link>
|
|
129
126
|
</div>
|
|
130
127
|
</div>
|
|
131
128
|
</div>
|
|
132
|
-
<
|
|
129
|
+
<hr />
|
|
133
130
|
<AnonymousReviewer datasetId={datasetId} reviewers={reviewers} />
|
|
134
|
-
|
|
131
|
+
</DatasetPageBorder>
|
|
135
132
|
)
|
|
136
133
|
}
|
|
137
134
|
|
|
@@ -1,32 +1,30 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import {
|
|
3
|
+
import { Redirect } from 'react-router-dom'
|
|
4
4
|
import PublishDataset from '../mutations/publish.jsx'
|
|
5
|
-
import {
|
|
5
|
+
import { DatasetPageBorder } from './styles/dataset-page-border'
|
|
6
|
+
import { HeaderRow3 } from './styles/header-row'
|
|
7
|
+
|
|
6
8
|
const hasExpectedMetadata = metadata =>
|
|
7
9
|
typeof metadata === 'object' && metadata !== null
|
|
8
10
|
|
|
9
11
|
const Publish = ({ datasetId, metadata }) =>
|
|
10
12
|
hasExpectedMetadata(metadata) ? (
|
|
11
|
-
<
|
|
12
|
-
<
|
|
13
|
-
<
|
|
14
|
-
<div className="col-xs-12 dataset-form-body">
|
|
13
|
+
<DatasetPageBorder className="dataset-form">
|
|
14
|
+
<HeaderRow3>Publish</HeaderRow3>
|
|
15
|
+
<div className="dataset-form-body">
|
|
15
16
|
<p className="text-danger">
|
|
16
17
|
All existing and future snapshots of this dataset will be released
|
|
17
18
|
publicly under a{' '}
|
|
18
19
|
<a href="https://wiki.creativecommons.org/wiki/CC0">CC0 license</a>.
|
|
19
20
|
</p>
|
|
20
21
|
</div>
|
|
21
|
-
<div className="
|
|
22
|
-
<div className="
|
|
22
|
+
<div className="dataset-form-controls">
|
|
23
|
+
<div className="modal-actions">
|
|
23
24
|
<PublishDataset datasetId={datasetId} />
|
|
24
|
-
<Link to={`/datasets/${datasetId}`}>
|
|
25
|
-
<Button nobg={true} label="Return to Dataset" />
|
|
26
|
-
</Link>
|
|
27
25
|
</div>
|
|
28
26
|
</div>
|
|
29
|
-
</
|
|
27
|
+
</DatasetPageBorder>
|
|
30
28
|
) : (
|
|
31
29
|
<Redirect
|
|
32
30
|
to={{
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import Markdown from 'markdown-to-jsx'
|
|
3
|
+
import { ReadMore } from '@openneuro/components/read-more'
|
|
4
|
+
import { MetaDataBlock } from '@openneuro/components/dataset'
|
|
5
|
+
import Files from '../files/files'
|
|
6
|
+
import Comments from '../comments/comments'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Default tab for snapshot pages
|
|
10
|
+
*/
|
|
11
|
+
export const SnapshotDefault = ({ dataset, snapshot }) => (
|
|
12
|
+
<>
|
|
13
|
+
<ReadMore
|
|
14
|
+
fileTree={true}
|
|
15
|
+
id="collapse-tree"
|
|
16
|
+
expandLabel="Read More"
|
|
17
|
+
collapseLabel="Collapse">
|
|
18
|
+
<Files
|
|
19
|
+
datasetId={dataset.id}
|
|
20
|
+
snapshotTag={snapshot.tag}
|
|
21
|
+
datasetName={snapshot.description.Name}
|
|
22
|
+
files={snapshot.files}
|
|
23
|
+
editMode={false}
|
|
24
|
+
datasetPermissions={dataset.permissions}
|
|
25
|
+
/>
|
|
26
|
+
</ReadMore>
|
|
27
|
+
<MetaDataBlock
|
|
28
|
+
heading="README"
|
|
29
|
+
item={
|
|
30
|
+
<ReadMore id="readme" expandLabel="Read More" collapseLabel="Collapse">
|
|
31
|
+
<Markdown>
|
|
32
|
+
{snapshot.readme == null ? 'N/A' : snapshot.readme}
|
|
33
|
+
</Markdown>
|
|
34
|
+
</ReadMore>
|
|
35
|
+
}
|
|
36
|
+
className="dataset-readme markdown-body"
|
|
37
|
+
/>
|
|
38
|
+
<Comments
|
|
39
|
+
datasetId={dataset.id}
|
|
40
|
+
uploader={dataset.uploader}
|
|
41
|
+
comments={dataset.comments}
|
|
42
|
+
/>
|
|
43
|
+
</>
|
|
44
|
+
)
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import semver from 'semver'
|
|
4
|
-
import { Link } from 'react-router-dom'
|
|
5
4
|
import SnapshotDataset from '../mutations/snapshot'
|
|
6
|
-
import ValidationStatus from '../../validation/validation-status'
|
|
7
5
|
import EditList from '../fragments/edit-list.jsx'
|
|
8
6
|
import { Button } from '@openneuro/components/button'
|
|
7
|
+
import { DatasetPageBorder } from './styles/dataset-page-border'
|
|
8
|
+
import { HeaderRow4 } from './styles/header-row'
|
|
9
|
+
import FileView from '../files/file-view'
|
|
10
|
+
import styled from '@emotion/styled'
|
|
11
|
+
|
|
12
|
+
const FormRow = styled.div`
|
|
13
|
+
margin-top: 0;
|
|
14
|
+
margin-bottom: 1.3em;
|
|
15
|
+
`
|
|
9
16
|
|
|
10
17
|
export const NoErrors = ({ issues, children }) => {
|
|
11
18
|
const noErrors =
|
|
@@ -49,83 +56,85 @@ const SnapshotRoute = ({ datasetId, snapshots, issues, description }) => {
|
|
|
49
56
|
const patchActive = semanticLevel === 'patch' && 'active'
|
|
50
57
|
|
|
51
58
|
return (
|
|
52
|
-
<
|
|
53
|
-
<div className="dataset-form
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
</
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
</div>
|
|
101
|
-
<NoErrors issues={issues}>
|
|
102
|
-
{changes.length ? null : (
|
|
103
|
-
<small className="text-danger">
|
|
104
|
-
You must add at least one change message to create a new version
|
|
105
|
-
</small>
|
|
106
|
-
)}
|
|
107
|
-
</NoErrors>
|
|
108
|
-
<div className="col-xs-12 dataset-form-controls">
|
|
109
|
-
<div className="col-xs-12 modal-actions">
|
|
110
|
-
<NoErrors issues={issues}>
|
|
111
|
-
{changes.length ? (
|
|
112
|
-
<SnapshotDataset
|
|
59
|
+
<DatasetPageBorder>
|
|
60
|
+
<div className="dataset-snapshot-form">
|
|
61
|
+
<div className="dataset-form-body">
|
|
62
|
+
<HeaderRow4>New Version</HeaderRow4>
|
|
63
|
+
{updateToCC0 && (
|
|
64
|
+
<p>
|
|
65
|
+
<strong>Notice:</strong> The current license{' '}
|
|
66
|
+
<i>"e;{draftLicense}"e;</i> will be updated to
|
|
67
|
+
"e;CC0"e; when the version is created. Please see FAQ item
|
|
68
|
+
"e;Are there any restrictions on the uploaded data?"e; for
|
|
69
|
+
details.
|
|
70
|
+
</p>
|
|
71
|
+
)}
|
|
72
|
+
<p>
|
|
73
|
+
Create a new version of this dataset for download and public access.
|
|
74
|
+
This will begin an export of this dataset to GitHub and S3 if it has
|
|
75
|
+
been made public.
|
|
76
|
+
</p>
|
|
77
|
+
<FormRow className="snapshot-input-group">
|
|
78
|
+
{newVersion}
|
|
79
|
+
<div className="input-group-btn">
|
|
80
|
+
<Button
|
|
81
|
+
secondary={true}
|
|
82
|
+
label="Major"
|
|
83
|
+
size="xsmall"
|
|
84
|
+
className={`btn btn-default ${majorActive}`}
|
|
85
|
+
onClick={() => setSemanticLevel('major')}
|
|
86
|
+
/>
|
|
87
|
+
<Button
|
|
88
|
+
secondary={true}
|
|
89
|
+
label="Minor"
|
|
90
|
+
size="xsmall"
|
|
91
|
+
className={`btn btn-default ${minorActive}`}
|
|
92
|
+
onClick={() => setSemanticLevel('minor')}
|
|
93
|
+
/>
|
|
94
|
+
<Button
|
|
95
|
+
secondary={true}
|
|
96
|
+
label="Patch"
|
|
97
|
+
size="xsmall"
|
|
98
|
+
className={`btn btn-default ${patchActive}`}
|
|
99
|
+
onClick={() => setSemanticLevel('patch')}
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
</FormRow>
|
|
103
|
+
{latestSnapshot ? (
|
|
104
|
+
<FormRow>
|
|
105
|
+
<HeaderRow4>Current Changelog</HeaderRow4>
|
|
106
|
+
<FileView
|
|
113
107
|
datasetId={datasetId}
|
|
114
|
-
|
|
115
|
-
|
|
108
|
+
snapshotTag={latestSnapshot.tag}
|
|
109
|
+
path="CHANGES"
|
|
116
110
|
/>
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
<
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
111
|
+
</FormRow>
|
|
112
|
+
) : null}
|
|
113
|
+
<HeaderRow4>New Changelog</HeaderRow4>
|
|
114
|
+
<p>Add CHANGES file lines describing the new version.</p>
|
|
115
|
+
<EditList
|
|
116
|
+
placeholder="Enter new changes here..."
|
|
117
|
+
elements={changes}
|
|
118
|
+
setElements={setChanges}
|
|
119
|
+
/>
|
|
120
|
+
</div>
|
|
121
|
+
<NoErrors issues={issues}>
|
|
122
|
+
{changes.length ? null : (
|
|
123
|
+
<small className="text-danger">
|
|
124
|
+
You must add at least one change message to create a new version
|
|
125
|
+
</small>
|
|
126
|
+
)}
|
|
127
|
+
</NoErrors>
|
|
128
|
+
<div className="dataset-form-controls">
|
|
129
|
+
<SnapshotDataset
|
|
130
|
+
datasetId={datasetId}
|
|
131
|
+
tag={newVersion}
|
|
132
|
+
changes={changes}
|
|
133
|
+
disabled={changes.length < 1}
|
|
134
|
+
/>
|
|
126
135
|
</div>
|
|
127
136
|
</div>
|
|
128
|
-
</
|
|
137
|
+
</DatasetPageBorder>
|
|
129
138
|
)
|
|
130
139
|
}
|
|
131
140
|
|