@openneuro/app 4.47.5 → 4.47.6
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openneuro/app",
|
|
3
|
-
"version": "4.47.
|
|
3
|
+
"version": "4.47.6",
|
|
4
4
|
"description": "React JS web frontend for the OpenNeuro platform.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "public/client.js",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"publishConfig": {
|
|
80
80
|
"access": "public"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "e00e369a538900524544a396e7fd60e5e41d715e"
|
|
83
83
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react"
|
|
2
|
-
import { render } from "@testing-library/react"
|
|
2
|
+
import { render, screen } from "@testing-library/react"
|
|
3
3
|
import Helmet from "react-helmet"
|
|
4
4
|
import { SnapshotContainer } from "../snapshot-container"
|
|
5
5
|
import { MockAppWrapper } from "../../fixtures/mock-app-wrapper"
|
|
@@ -35,4 +35,13 @@ describe("SnapshotContainer component", () => {
|
|
|
35
35
|
const header = Helmet.peek()
|
|
36
36
|
expect(header).toMatchSnapshot()
|
|
37
37
|
})
|
|
38
|
+
it("renders the dataset header when summary is null", () => {
|
|
39
|
+
const snapshotWithoutSummary = { ...snapshot, summary: null }
|
|
40
|
+
render(
|
|
41
|
+
<SnapshotContainer dataset={dataset} snapshot={snapshotWithoutSummary} />,
|
|
42
|
+
{ wrapper: MockAppWrapper },
|
|
43
|
+
)
|
|
44
|
+
const heading = screen.getByRole("heading", { level: 1 })
|
|
45
|
+
expect(heading).toHaveTextContent(snapshot.description.Name)
|
|
46
|
+
})
|
|
38
47
|
})
|
|
@@ -95,41 +95,39 @@ export const SnapshotContainer: React.FC<SnapshotContainerProps> = ({
|
|
|
95
95
|
<div
|
|
96
96
|
className={`dataset dataset-draft dataset-page dataset-page-${modality?.toLowerCase()}`}
|
|
97
97
|
>
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
<
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
<
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
/>
|
|
132
|
-
)}
|
|
98
|
+
<DatasetHeader
|
|
99
|
+
pageHeading={description.Name}
|
|
100
|
+
modality={summary?.modalities[0]}
|
|
101
|
+
datasetHeaderTools={
|
|
102
|
+
<div className="dataset-tool-buttons">
|
|
103
|
+
<DatasetTools
|
|
104
|
+
hasEdit={hasEdit}
|
|
105
|
+
isPublic={dataset.public}
|
|
106
|
+
datasetId={datasetId}
|
|
107
|
+
snapshotId={snapshot.tag}
|
|
108
|
+
isAdmin={isAdmin}
|
|
109
|
+
isDatasetAdmin={isDatasetAdmin}
|
|
110
|
+
hasDerivatives={hasDerivatives}
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
}
|
|
114
|
+
datasetUserActions={
|
|
115
|
+
<FollowToggles>
|
|
116
|
+
<FollowDataset
|
|
117
|
+
profile={profile !== null}
|
|
118
|
+
datasetId={dataset.id}
|
|
119
|
+
following={dataset.following}
|
|
120
|
+
followers={dataset.followers.length}
|
|
121
|
+
/>
|
|
122
|
+
<StarDataset
|
|
123
|
+
profile={profile !== null}
|
|
124
|
+
datasetId={dataset.id}
|
|
125
|
+
starred={dataset.starred}
|
|
126
|
+
stars={dataset.stars.length}
|
|
127
|
+
/>
|
|
128
|
+
</FollowToggles>
|
|
129
|
+
}
|
|
130
|
+
/>
|
|
133
131
|
{!dataset.public && isDatasetAdmin && (
|
|
134
132
|
<DatasetAlertPrivate
|
|
135
133
|
datasetId={dataset.id}
|