@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.
Files changed (31) hide show
  1. package/package.json +4 -4
  2. package/src/scripts/datalad/dataset/dataset-query-fragments.js +2 -0
  3. package/src/scripts/dataset/dataset-routes.jsx +2 -126
  4. package/src/scripts/dataset/draft-container.tsx +14 -52
  5. package/src/scripts/dataset/fragments/dataset-history.jsx +38 -42
  6. package/src/scripts/dataset/mutations/admin-exports.jsx +70 -0
  7. package/src/scripts/dataset/mutations/create-anonymous-reviewer.tsx +0 -3
  8. package/src/scripts/dataset/mutations/dataset-relations.tsx +4 -15
  9. package/src/scripts/dataset/mutations/metadata-form.jsx +1 -1
  10. package/src/scripts/dataset/mutations/remove-annex-object.jsx +0 -1
  11. package/src/scripts/dataset/mutations/snapshot.tsx +16 -2
  12. package/src/scripts/dataset/routes/add-metadata.jsx +20 -24
  13. package/src/scripts/dataset/routes/admin-datalad.jsx +26 -33
  14. package/src/scripts/dataset/routes/dataset-default.tsx +54 -0
  15. package/src/scripts/dataset/routes/delete-page.tsx +5 -9
  16. package/src/scripts/dataset/routes/deprecate-snapshot-page.tsx +6 -7
  17. package/src/scripts/dataset/routes/download-dataset.tsx +24 -47
  18. package/src/scripts/dataset/routes/manage-anonymous-reviewers.tsx +9 -3
  19. package/src/scripts/dataset/routes/manage-permissions.jsx +7 -10
  20. package/src/scripts/dataset/routes/publish.jsx +10 -12
  21. package/src/scripts/dataset/routes/snapshot-default.tsx +44 -0
  22. package/src/scripts/dataset/routes/snapshot.jsx +84 -75
  23. package/src/scripts/dataset/routes/styles/dataset-page-border.tsx +8 -0
  24. package/src/scripts/dataset/routes/styles/dataset-page-tab-container.tsx +8 -0
  25. package/src/scripts/dataset/routes/styles/draft-background.tsx +7 -0
  26. package/src/scripts/dataset/routes/styles/header-row.tsx +12 -0
  27. package/src/scripts/dataset/routes/tab-routes-draft.tsx +88 -0
  28. package/src/scripts/dataset/routes/tab-routes-snapshot.tsx +57 -0
  29. package/src/scripts/dataset/snapshot-container.tsx +6 -39
  30. package/src/scripts/search/use-search-results.tsx +1 -0
  31. package/src/scripts/dataset/routes/admin-exports.jsx +0 -130
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openneuro/app",
3
- "version": "4.5.1",
3
+ "version": "4.6.0-alpha.0",
4
4
  "description": "React JS web frontend for the OpenNeuro platform.",
5
5
  "license": "MIT",
6
6
  "main": "public/client.js",
@@ -19,8 +19,8 @@
19
19
  "@elastic/apm-rum": "5.9.1",
20
20
  "@emotion/react": "11.6.0",
21
21
  "@emotion/styled": "11.6.0",
22
- "@openneuro/client": "^4.5.1",
23
- "@openneuro/components": "^4.5.1",
22
+ "@openneuro/client": "^4.6.0-alpha.0",
23
+ "@openneuro/components": "^4.6.0-alpha.0",
24
24
  "babel-runtime": "^6.26.0",
25
25
  "bids-validator": "1.9.3",
26
26
  "bytes": "^3.0.0",
@@ -116,5 +116,5 @@
116
116
  "publishConfig": {
117
117
  "access": "public"
118
118
  },
119
- "gitHead": "92a2879d0f00400c240bfe3319f26c38db8ef866"
119
+ "gitHead": "ce2db27f750c2614e9cf2f0461add04ca8c3cb48"
120
120
  }
@@ -8,6 +8,7 @@ export const DRAFT_FRAGMENT = gql`
8
8
  modified
9
9
  readme
10
10
  head
11
+ size
11
12
  description {
12
13
  Name
13
14
  Authors
@@ -136,6 +137,7 @@ export const SNAPSHOT_FIELDS = gql`
136
137
  tag
137
138
  created
138
139
  readme
140
+ size
139
141
  deprecated {
140
142
  id
141
143
  user
@@ -1,23 +1,8 @@
1
1
  import React, { useEffect } from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import { Route, Switch } from 'react-router-dom'
4
- import AdminDataset from './routes/admin-datalad.jsx'
5
- import AdminExports from './routes/admin-exports.jsx'
6
-
7
4
  import SnapshotContainer from './snapshot-container'
8
5
  import DraftContainer from './draft-container'
9
- import DownloadDataset from './routes/download-dataset'
10
- import Publish from './routes/publish.jsx'
11
- import Share from './routes/manage-permissions.jsx'
12
- import Snapshot from './routes/snapshot.jsx'
13
- import AddMetadata from './routes/add-metadata.jsx'
14
- import DeletePage from './routes/delete-page'
15
- import { DeprecateSnapshotPage } from './routes/deprecate-snapshot-page'
16
- import { FileDisplay } from './files'
17
-
18
- //TODO imports
19
-
20
- const stubComponent = () => null
21
6
 
22
7
  const DatasetRoutes = ({ dataset, error }) => {
23
8
  useEffect(() => {
@@ -29,78 +14,6 @@ const DatasetRoutes = ({ dataset, error }) => {
29
14
  return (
30
15
  <Switch>
31
16
  <Route
32
- exact
33
- path="/datasets/:datasetId"
34
- render={() => <DraftContainer dataset={dataset} />}
35
- />
36
- <Route
37
- exact
38
- path="/datasets/:datasetId/download"
39
- component={() => (
40
- <DownloadDataset
41
- worker={dataset.worker}
42
- datasetPermissions={dataset.permissions}
43
- />
44
- )}
45
- />
46
- <Route
47
- exact
48
- path="/datasets/:datasetId/admin-datalad"
49
- component={() => <AdminDataset dataset={dataset} />}
50
- />
51
- <Route
52
- exact
53
- path="/datasets/:datasetId/admin-exports"
54
- component={() => <AdminExports dataset={dataset} />}
55
- />
56
- <Route
57
- exact
58
- path="/datasets/:datasetId/publish"
59
- component={() => (
60
- <Publish datasetId={dataset.id} metadata={dataset.metadata} />
61
- )}
62
- />
63
- <Route
64
- exact
65
- path="/datasets/:datasetId/snapshot"
66
- component={() => (
67
- <Snapshot
68
- datasetId={dataset.id}
69
- snapshots={dataset.snapshots}
70
- issues={dataset.draft.issues}
71
- description={dataset.draft.description}
72
- />
73
- )}
74
- />
75
- <Route
76
- exact
77
- path="/datasets/:datasetId/share"
78
- component={() => (
79
- <Share
80
- datasetId={dataset.id}
81
- permissions={dataset.permissions}
82
- reviewers={dataset.reviewers}
83
- />
84
- )}
85
- />
86
- <Route
87
- exact
88
- path="/datasets/:datasetId/file-edit"
89
- component={stubComponent}
90
- />
91
- <Route
92
- path="/datasets/:datasetId/file-display/:filePath"
93
- render={({
94
- match: {
95
- params: { datasetId, filePath },
96
- },
97
- }) => {
98
- return <FileDisplay datasetId={datasetId} filePath={filePath} />
99
- }}
100
- />
101
- {/* Snapshot routes */}
102
- <Route
103
- exact
104
17
  path="/datasets/:datasetId/versions/:tag"
105
18
  render={({
106
19
  match: {
@@ -111,45 +24,8 @@ const DatasetRoutes = ({ dataset, error }) => {
111
24
  }}
112
25
  />
113
26
  <Route
114
- exact
115
- path="/datasets/:datasetId/versions/:snapshotId/download"
116
- component={() => (
117
- <DownloadDataset
118
- worker={dataset.worker}
119
- datasetPermissions={dataset.permissions}
120
- />
121
- )}
122
- />
123
- <Route
124
- exact
125
- path="/datasets/:datasetId/versions/:snapshotTag/deprecate"
126
- component={() => <DeprecateSnapshotPage />}
127
- />
128
- <Route
129
- path="/datasets/:datasetId/versions/:snapshotTag/file-display/:filePath"
130
- render={({
131
- match: {
132
- params: { datasetId, filePath, snapshotTag },
133
- },
134
- }) => {
135
- return (
136
- <FileDisplay
137
- datasetId={datasetId}
138
- snapshotTag={snapshotTag}
139
- filePath={filePath}
140
- />
141
- )
142
- }}
143
- />
144
- <Route
145
- exact
146
- path="/datasets/:datasetId/metadata"
147
- component={() => <AddMetadata dataset={dataset} />}
148
- />
149
- <Route
150
- exact
151
- path="/datasets/:datasetId/delete"
152
- component={() => <DeletePage dataset={dataset} />}
27
+ path="/datasets/:datasetId"
28
+ render={() => <DraftContainer dataset={dataset} />}
153
29
  />
154
30
  </Switch>
155
31
  )
@@ -5,8 +5,8 @@ import pluralize from 'pluralize'
5
5
  import formatDistanceToNow from 'date-fns/formatDistanceToNow'
6
6
  import parseISO from 'date-fns/parseISO'
7
7
 
8
+ import { DatasetPageTabContainer } from './routes/styles/dataset-page-tab-container'
8
9
  import Validation from '../validation/validation.jsx'
9
- import Files from './files'
10
10
  import { config } from '../config'
11
11
  import {
12
12
  getUnexpiredProfile,
@@ -14,7 +14,6 @@ import {
14
14
  hasDatasetAdminPermissions,
15
15
  } from '../authentication/profile'
16
16
  import { useCookies } from 'react-cookie'
17
- import Comments from './comments/comments.jsx'
18
17
  import { DatasetAlertDraft } from './fragments/dataset-alert-draft'
19
18
  import {
20
19
  MetaDataBlock,
@@ -28,7 +27,6 @@ import {
28
27
  VersionList,
29
28
  DatasetTools,
30
29
  } from '@openneuro/components/dataset'
31
- import { ReadMore } from '@openneuro/components/read-more'
32
30
 
33
31
  import { FollowDataset } from './mutations/follow'
34
32
  import { StarDataset } from './mutations/star'
@@ -37,6 +35,8 @@ import EditDescriptionField from './fragments/edit-description-field.jsx'
37
35
  import EditDescriptionList from './fragments/edit-description-list.jsx'
38
36
  import { DOILink } from './fragments/doi-link'
39
37
 
38
+ import { TabRoutesDraft } from './routes/tab-routes-draft'
39
+
40
40
  export interface DraftContainerProps {
41
41
  dataset
42
42
  tag?: string
@@ -120,7 +120,7 @@ const DraftContainer: React.FC<DraftContainerProps> = ({ dataset }) => {
120
120
  <div className="col col-8 col-lg">
121
121
  {summary && (
122
122
  <DatasetHeaderMeta
123
- size={summary.size}
123
+ size={dataset.draft.size}
124
124
  totalFiles={summary.totalFiles}
125
125
  datasetId={datasetId}
126
126
  />
@@ -169,55 +169,17 @@ const DraftContainer: React.FC<DraftContainerProps> = ({ dataset }) => {
169
169
  }
170
170
  />
171
171
  </div>
172
- <div className="dataset-tool-buttons">
173
- <DatasetTools
174
- hasEdit={hasEdit}
175
- isPublic={dataset.public}
176
- datasetId={datasetId}
177
- isAdmin={isAdmin}
178
- hasSnapshot={dataset.snapshots.length !== 0}
179
- isDatasetAdmin={isDatasetAdmin}
180
- />
181
- </div>
182
- <ReadMore
183
- fileTree={true}
184
- id="collapse-tree"
185
- expandLabel="Expand File Tree"
186
- collapseLabel="Collapse File Tree">
187
- <Files
188
- datasetId={datasetId}
189
- snapshotTag={null}
190
- datasetName={dataset.draft.description.Name}
191
- files={dataset.draft.files}
192
- editMode={hasEdit}
193
- datasetPermissions={dataset.permissions}
194
- />
195
- </ReadMore>
196
- <MetaDataBlock
197
- heading="README"
198
- className="dataset-readme markdown-body"
199
- item={dataset.draft.readme}
200
- renderEditor={() => (
201
- <EditDescriptionField
202
- datasetId={datasetId}
203
- field="readme"
204
- rows={12}
205
- description={dataset.draft.readme}
206
- editMode={hasEdit}>
207
- <ReadMore
208
- id="readme"
209
- expandLabel="Read More"
210
- collapseLabel="Collapse">
211
- <Markdown>{dataset.draft.readme || 'N/A'}</Markdown>
212
- </ReadMore>
213
- </EditDescriptionField>
214
- )}
215
- />
216
- <Comments
217
- datasetId={dataset.id}
218
- uploader={dataset.uploader}
219
- comments={dataset.comments}
172
+ <DatasetTools
173
+ hasEdit={hasEdit}
174
+ isPublic={dataset.public}
175
+ datasetId={datasetId}
176
+ isAdmin={isAdmin}
177
+ hasSnapshot={dataset.snapshots.length !== 0}
178
+ isDatasetAdmin={isDatasetAdmin}
220
179
  />
180
+ <DatasetPageTabContainer>
181
+ <TabRoutesDraft dataset={dataset} hasEdit={hasEdit} />
182
+ </DatasetPageTabContainer>
221
183
  </div>
222
184
  <div className="col sidebar">
223
185
  {' '}
@@ -48,49 +48,45 @@ const DatasetHistory = ({ datasetId }) => {
48
48
  return <div className="dataset-history">Loading...</div>
49
49
  } else {
50
50
  return (
51
- <div className="grid dataset-history">
52
- <div className="col col-12">
53
- <h3>Worker Assignment</h3> {data.dataset.worker}
54
- </div>
55
- <div className="col col-12">
56
- <h3>Git History</h3>
57
- <DatasetHistoryTable>
58
- <div className="grid faux-table-header">
59
- <h4 className="col-lg col col-4">Commit</h4>
60
- <h4 className="col-lg col col-2">Date</h4>
61
- <h4 className="col-lg col col-2">Author</h4>
62
- <h4 className="col-lg col col-2">References</h4>
63
- <h4 className="col-lg col col-2 text--right">Action</h4>
64
- </div>
65
- {data.dataset.history.map(commit => (
66
- <React.Fragment key={commit.id}>
67
- <div className="grid faux-table">
68
- <div className="commit col-lg col col-4">
69
- <label>Commit: </label>
70
- {commit.id}
71
- </div>
72
- <div className="col-lg col col-2">
73
- <label>Date: </label>
74
- {commit.date}
75
- </div>
76
- <div className="col-lg col col-2">
77
- <label>Author: </label>
78
- {commit.authorName} &lt;{commit.authorEmail}&gt;
79
- </div>
80
- <div className="col-lg col col-2">
81
- <label>References: </label>
82
- {commit.references}
83
- </div>
84
- <div className="col-lg col col-2 grid actions">
85
- <Revalidate datasetId={datasetId} revision={commit.id} />
86
- <UpdateRef datasetId={datasetId} revision={commit.id} />
87
- </div>
88
- <div className="col-lg col col-12">{commit.message}</div>
51
+ <div className="dataset-history">
52
+ <h4>Worker Assignment</h4> {data.dataset.worker}
53
+ <h4>Git History</h4>
54
+ <DatasetHistoryTable>
55
+ <div className="grid faux-table-header">
56
+ <h4 className="col-lg col col-2">Commit</h4>
57
+ <h4 className="col-lg col col-3">Date</h4>
58
+ <h4 className="col-lg col col-3">Author</h4>
59
+ <h4 className="col-lg col col-2">References</h4>
60
+ <h4 className="col-lg col col-2 text--right">Action</h4>
61
+ </div>
62
+ {data.dataset.history.map(commit => (
63
+ <React.Fragment key={commit.id}>
64
+ <div className="grid faux-table">
65
+ <div className="commit col-lg col col-2">
66
+ <label>Commit: </label>
67
+ {commit.id.slice(0, 8)}
89
68
  </div>
90
- </React.Fragment>
91
- ))}
92
- </DatasetHistoryTable>
93
- </div>
69
+ <div className="col-lg col col-3">
70
+ <label>Date: </label>
71
+ {commit.date}
72
+ </div>
73
+ <div className="col-lg col col-3">
74
+ <label>Author: </label>
75
+ {commit.authorName} &lt;{commit.authorEmail}&gt;
76
+ </div>
77
+ <div className="col-lg col col-2">
78
+ <label>References: </label>
79
+ {commit.references}
80
+ </div>
81
+ <div className="col-lg col col-2 grid actions">
82
+ <Revalidate datasetId={datasetId} revision={commit.id} />
83
+ <UpdateRef datasetId={datasetId} revision={commit.id} />
84
+ </div>
85
+ <div className="col-lg col col-12">{commit.message}</div>
86
+ </div>
87
+ </React.Fragment>
88
+ ))}
89
+ </DatasetHistoryTable>
94
90
  </div>
95
91
  )
96
92
  }
@@ -0,0 +1,70 @@
1
+ import React from 'react'
2
+ import { gql, useMutation } from '@apollo/client'
3
+ import PropTypes from 'prop-types'
4
+ import { reexporterLogsURL } from '../../resources/kibana'
5
+ import { Button } from '@openneuro/components/button'
6
+ import styled from '@emotion/styled'
7
+
8
+ const ButtonRow = styled.div`
9
+ display: grid;
10
+ grid-template-columns: auto minmax(0, 1fr);
11
+ grid-gap: 1.3em;
12
+ place-items: start;
13
+ `
14
+
15
+ const SuccessMessage = styled.p({
16
+ color: 'rgb(92, 184, 92)',
17
+ })
18
+ const InProgressMessage = styled.p({
19
+ color: 'orange',
20
+ })
21
+ const ErrorMessage = styled.p({
22
+ color: 'red',
23
+ })
24
+
25
+ const REEXPORT_REMOTES = gql`
26
+ mutation reexportRemotes($datasetId: ID!) {
27
+ reexportRemotes(datasetId: $datasetId)
28
+ }
29
+ `
30
+
31
+ const AdminExports = ({ dataset }) => {
32
+ const [reexportRemotes, { data, loading, error }] =
33
+ useMutation(REEXPORT_REMOTES)
34
+ const success = data && data.reexportRemotes
35
+ return (
36
+ <div className="dataset-form">
37
+ {loading && (
38
+ <InProgressMessage>Your export is starting.</InProgressMessage>
39
+ )}
40
+ {error && <ErrorMessage>An error has occurred.</ErrorMessage>}
41
+ {success && <SuccessMessage>Your export has begun.</SuccessMessage>}
42
+ <ButtonRow>
43
+ <Button
44
+ icon="fa fa-rocket"
45
+ label="Run Export"
46
+ primary={true}
47
+ size="small"
48
+ onClick={() => {
49
+ reexportRemotes({ variables: { datasetId: dataset.id } })
50
+ }}
51
+ />
52
+ <Button
53
+ icon="fa fa-file-text"
54
+ label="View Export Logs"
55
+ secondary={true}
56
+ size="small"
57
+ onClick={() => {
58
+ window.open(reexporterLogsURL, '_blank')
59
+ }}
60
+ />
61
+ </ButtonRow>
62
+ </div>
63
+ )
64
+ }
65
+
66
+ AdminExports.propTypes = {
67
+ dataset: PropTypes.object,
68
+ }
69
+
70
+ export default AdminExports
@@ -61,9 +61,6 @@ export const CreateReviewLink: FC<CreateReviewLinkProps> = ({ datasetId }) => {
61
61
  size="small"
62
62
  onClick={() => CreateReviewLink({ variables: { datasetId } })}
63
63
  />
64
- <Link className="return-link" to={`/datasets/${datasetId}`}>
65
- Return to Dataset
66
- </Link>
67
64
  </div>
68
65
  </>
69
66
  )
@@ -50,20 +50,9 @@ const deleteDatasetRelation = gql`
50
50
  }
51
51
  `
52
52
 
53
- const RightColumn = styled.div({
54
- maxWidth: '700px',
55
- float: 'right',
56
- })
57
-
58
- const InfoText = styled.p({
59
- fontWeight: 100,
60
- textAlign: 'right',
61
- })
62
-
63
53
  const TableContainer = styled.div({
64
54
  display: 'grid',
65
55
  gridTemplateColumns: '2fr 3fr 1fr',
66
- textAlign: 'right',
67
56
  })
68
57
 
69
58
  const GridItem = styled.div({
@@ -120,15 +109,15 @@ export const DatasetRelations = ({ datasetId, hasEdit }) => {
120
109
  loadedData = <p>No related DOIs have been added.</p>
121
110
  }
122
111
  return (
123
- <RightColumn>
124
- <InfoText>
112
+ <>
113
+ <p>
125
114
  Add a related DOI such as other repositories where this dataset can be
126
115
  found. DOI values should be formatted according to the{' '}
127
116
  <a href="https://bids-specification.readthedocs.io/en/stable/02-common-principles.html#uniform-resource-indicator">
128
117
  BIDS recommended URI format
129
118
  </a>
130
119
  .
131
- </InfoText>
120
+ </p>
132
121
  {loadedData}
133
122
  {hasEdit && (
134
123
  <div>
@@ -195,7 +184,7 @@ export const DatasetRelations = ({ datasetId, hasEdit }) => {
195
184
  />
196
185
  </div>
197
186
  )}
198
- </RightColumn>
187
+ </>
199
188
  )
200
189
  } else {
201
190
  return null
@@ -321,7 +321,7 @@ const MetadataForm = ({
321
321
  hasEdit,
322
322
  validationErrors = [],
323
323
  }) => (
324
- <Form id="metadata-form" className="col col-6">
324
+ <Form id="metadata-form">
325
325
  <InfoText>
326
326
  Incomplete fields in this form will make it more difficult for users to
327
327
  search for your dataset.
@@ -41,7 +41,6 @@ const RemoveAnnexObject = ({
41
41
  iconOnly={true}
42
42
  icon="fa-frown-o"
43
43
  className="edit-file"
44
- tooltip={'Delete ' + name}
45
44
  onConfirmedClick={() => {
46
45
  removeAnnexObject({
47
46
  variables: {
@@ -18,12 +18,14 @@ interface CreateSnapshotMutationProps {
18
18
  datasetId: string
19
19
  tag: string
20
20
  changes: Array<string>
21
+ disabled: boolean
21
22
  }
22
23
 
23
24
  const CreateSnapshotMutation = ({
24
25
  datasetId,
25
26
  tag,
26
27
  changes,
28
+ disabled,
27
29
  }: CreateSnapshotMutationProps) => {
28
30
  const history = useHistory()
29
31
  const [snapshotDataset, { loading, error }] = useMutation(CREATE_SNAPSHOT)
@@ -42,6 +44,7 @@ const CreateSnapshotMutation = ({
42
44
  variables: { datasetId, tag, changes },
43
45
  }).then(() => history.push(`/datasets/${datasetId}/versions/${tag}`))
44
46
  }}
47
+ disabled={disabled}
45
48
  label="Create Version"
46
49
  />
47
50
  )
@@ -52,11 +55,22 @@ interface SnapshotDatasetProps {
52
55
  datasetId: string
53
56
  tag: string
54
57
  changes: Array<string>
58
+ disabled: boolean
55
59
  }
56
60
 
57
- const SnapshotDataset = ({ datasetId, tag, changes }: SnapshotDatasetProps) => (
61
+ const SnapshotDataset = ({
62
+ datasetId,
63
+ tag,
64
+ changes,
65
+ disabled,
66
+ }: SnapshotDatasetProps) => (
58
67
  <ErrorBoundary subject="error creating version">
59
- <CreateSnapshotMutation datasetId={datasetId} tag={tag} changes={changes} />
68
+ <CreateSnapshotMutation
69
+ datasetId={datasetId}
70
+ tag={tag}
71
+ changes={changes}
72
+ disabled={disabled}
73
+ />
60
74
  </ErrorBoundary>
61
75
  )
62
76
 
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from 'react'
2
2
  import PropTypes from 'prop-types'
3
- import { Link, useHistory, useLocation } from 'react-router-dom'
3
+ import { useHistory, useLocation } from 'react-router-dom'
4
4
  import { useCookies } from 'react-cookie'
5
5
  import MetadataForm from '../mutations/metadata-form.jsx'
6
6
  import { DatasetRelations } from '../mutations/dataset-relations'
@@ -8,6 +8,8 @@ import SubmitMetadata from '../mutations/submit-metadata.jsx'
8
8
  import LoggedIn from '../../authentication/logged-in.jsx'
9
9
  import { hasEditPermissions, getProfile } from '../../authentication/profile.js'
10
10
  import { getDatasetUrl } from '../../utils/dataset-url'
11
+ import { DatasetPageBorder } from './styles/dataset-page-border'
12
+ import { HeaderRow3, HeaderRow4 } from './styles/header-row'
11
13
 
12
14
  export const compileMetadata = dataset => {
13
15
  const getFromMetadata = key => dataset.metadata && dataset.metadata[key]
@@ -119,25 +121,15 @@ const AddMetadata = ({ dataset }) => {
119
121
  hasEditPermissions(dataset.permissions, user && user.sub)
120
122
 
121
123
  return (
122
- <div className="container metadata-form">
123
- <header>
124
- <h1>{hasEdit && 'Add '}Metadata</h1>
125
- <hr />
126
- </header>
127
- <div className="grid m-b-20">
128
- <MetadataForm
129
- values={values}
130
- onChange={handleInputChange}
131
- hideDisabled={false}
132
- hasEdit={hasEdit}
133
- validationErrors={validationErrors}
134
- />
135
- {hasEdit && (
136
- <div className="col col-6">
137
- <DatasetRelations datasetId={dataset.id} hasEdit={hasEdit} />
138
- </div>
139
- )}
140
- </div>
124
+ <DatasetPageBorder className="metadata-form">
125
+ <HeaderRow3>{hasEdit && 'Add '}Metadata</HeaderRow3>
126
+ <MetadataForm
127
+ values={values}
128
+ onChange={handleInputChange}
129
+ hideDisabled={false}
130
+ hasEdit={hasEdit}
131
+ validationErrors={validationErrors}
132
+ />
141
133
  <div className="dataset-form-controls ">
142
134
  {hasEdit && (
143
135
  <LoggedIn>
@@ -149,11 +141,15 @@ const AddMetadata = ({ dataset }) => {
149
141
  />
150
142
  </LoggedIn>
151
143
  )}
152
- <Link className="return-link " to={`/datasets/${dataset.id}`}>
153
- Return to Dataset
154
- </Link>
155
144
  </div>
156
- </div>
145
+ <hr />
146
+ {hasEdit && (
147
+ <>
148
+ <HeaderRow4>Relations</HeaderRow4>
149
+ <DatasetRelations datasetId={dataset.id} hasEdit={hasEdit} />
150
+ </>
151
+ )}
152
+ </DatasetPageBorder>
157
153
  )
158
154
  }
159
155