@openneuro/app 4.47.3 → 4.47.5
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.5",
|
|
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": "aad83019a0fe480d21d5997a58c8c7fe6c39cfdb"
|
|
83
83
|
}
|
|
@@ -185,12 +185,13 @@ export const SnapshotContainer: React.FC<SnapshotContainerProps> = ({
|
|
|
185
185
|
heading="Authors"
|
|
186
186
|
item={
|
|
187
187
|
<>
|
|
188
|
-
{profile &&
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
188
|
+
{profile && !isAnonymousReviewer &&
|
|
189
|
+
(
|
|
190
|
+
<RequestContributorButton
|
|
191
|
+
dataset={dataset}
|
|
192
|
+
currentUserId={currentUserId}
|
|
193
|
+
/>
|
|
194
|
+
)}
|
|
194
195
|
<ContributorsListDisplay
|
|
195
196
|
datasetId={dataset.id}
|
|
196
197
|
contributors={snapshot.contributors}
|
|
@@ -5,6 +5,46 @@ import { useUser } from "../queries/user"
|
|
|
5
5
|
import { useNotifications } from "./notifications/user-notifications-context"
|
|
6
6
|
import "./scss/user-menu.scss"
|
|
7
7
|
|
|
8
|
+
interface UserMenuListProps {
|
|
9
|
+
user: NonNullable<ReturnType<typeof useUser>["user"]>
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function UserMenuList({ user }: UserMenuListProps) {
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
<li>
|
|
16
|
+
<Link
|
|
17
|
+
to={user.orcid ? `/user/${user.orcid}` : "/search?mydatasets"}
|
|
18
|
+
>
|
|
19
|
+
My Datasets
|
|
20
|
+
</Link>
|
|
21
|
+
</li>
|
|
22
|
+
|
|
23
|
+
{user.orcid && (
|
|
24
|
+
<li>
|
|
25
|
+
<Link to={`/user/${user.orcid}/account`}>Account Info</Link>
|
|
26
|
+
</li>
|
|
27
|
+
)}
|
|
28
|
+
|
|
29
|
+
<li className="user-menu-link">
|
|
30
|
+
<Link to="/keygen">Obtain an API Key</Link>
|
|
31
|
+
</li>
|
|
32
|
+
|
|
33
|
+
{user.provider !== "orcid" && (
|
|
34
|
+
<li className="user-menu-link">
|
|
35
|
+
<a href="/crn/auth/orcid?link=true">Link ORCID to my account</a>
|
|
36
|
+
</li>
|
|
37
|
+
)}
|
|
38
|
+
|
|
39
|
+
{user.admin && (
|
|
40
|
+
<li className="user-menu-link">
|
|
41
|
+
<Link to="/admin">Admin</Link>
|
|
42
|
+
</li>
|
|
43
|
+
)}
|
|
44
|
+
</>
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
|
|
8
48
|
export interface UserMenuProps {
|
|
9
49
|
signOutAndRedirect: () => void
|
|
10
50
|
}
|
|
@@ -15,6 +55,8 @@ export const UserMenu: React.FC<UserMenuProps> = ({ signOutAndRedirect }) => {
|
|
|
15
55
|
|
|
16
56
|
if (loading || !user) return null
|
|
17
57
|
|
|
58
|
+
const reviewer = user.id === "reviewer"
|
|
59
|
+
|
|
18
60
|
const inboxCount =
|
|
19
61
|
notifications?.filter((n) => n.status === "unread").length || 0
|
|
20
62
|
|
|
@@ -66,35 +108,7 @@ export const UserMenu: React.FC<UserMenuProps> = ({ signOutAndRedirect }) => {
|
|
|
66
108
|
</p>
|
|
67
109
|
</li>
|
|
68
110
|
|
|
69
|
-
<
|
|
70
|
-
<Link
|
|
71
|
-
to={user.orcid ? `/user/${user.orcid}` : "/search?mydatasets"}
|
|
72
|
-
>
|
|
73
|
-
My Datasets
|
|
74
|
-
</Link>
|
|
75
|
-
</li>
|
|
76
|
-
|
|
77
|
-
{user.orcid && (
|
|
78
|
-
<li>
|
|
79
|
-
<Link to={`/user/${user.orcid}/account`}>Account Info</Link>
|
|
80
|
-
</li>
|
|
81
|
-
)}
|
|
82
|
-
|
|
83
|
-
<li className="user-menu-link">
|
|
84
|
-
<Link to="/keygen">Obtain an API Key</Link>
|
|
85
|
-
</li>
|
|
86
|
-
|
|
87
|
-
{user.provider !== "orcid" && (
|
|
88
|
-
<li className="user-menu-link">
|
|
89
|
-
<a href="/crn/auth/orcid?link=true">Link ORCID to my account</a>
|
|
90
|
-
</li>
|
|
91
|
-
)}
|
|
92
|
-
|
|
93
|
-
{user.admin && (
|
|
94
|
-
<li className="user-menu-link">
|
|
95
|
-
<Link to="/admin">Admin</Link>
|
|
96
|
-
</li>
|
|
97
|
-
)}
|
|
111
|
+
{!reviewer && <UserMenuList user={user} />}
|
|
98
112
|
|
|
99
113
|
<li className="user-menu-link">
|
|
100
114
|
<a onClick={signOutAndRedirect} className="btn-submit-other">
|