@openneuro/app 4.47.4 → 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.4",
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": "fee430e60d713799a1c304676d0eaa758fa578ff"
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
- {summary && (
99
- <DatasetHeader
100
- pageHeading={description.Name}
101
- modality={summary?.modalities[0]}
102
- datasetHeaderTools={
103
- <div className="dataset-tool-buttons">
104
- <DatasetTools
105
- hasEdit={hasEdit}
106
- isPublic={dataset.public}
107
- datasetId={datasetId}
108
- snapshotId={snapshot.tag}
109
- isAdmin={isAdmin}
110
- isDatasetAdmin={isDatasetAdmin}
111
- hasDerivatives={hasDerivatives}
112
- />
113
- </div>
114
- }
115
- datasetUserActions={
116
- <FollowToggles>
117
- <FollowDataset
118
- profile={profile !== null}
119
- datasetId={dataset.id}
120
- following={dataset.following}
121
- followers={dataset.followers.length}
122
- />
123
- <StarDataset
124
- profile={profile !== null}
125
- datasetId={dataset.id}
126
- starred={dataset.starred}
127
- stars={dataset.stars.length}
128
- />
129
- </FollowToggles>
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}
@@ -185,7 +183,7 @@ export const SnapshotContainer: React.FC<SnapshotContainerProps> = ({
185
183
  heading="Authors"
186
184
  item={
187
185
  <>
188
- {profile && !profile.scopes.includes("dataset:reviewer") &&
186
+ {profile && !isAnonymousReviewer &&
189
187
  (
190
188
  <RequestContributorButton
191
189
  dataset={dataset}