@openneuro/app 4.25.0 → 4.25.1-orcid-demo.1
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/__mocks__/config.ts +1 -0
- package/src/scripts/config.ts +2 -4
- package/src/scripts/dataset/comments/__tests__/__snapshots__/comment.spec.jsx.snap +2 -2
- package/src/scripts/dataset/comments/__tests__/comment.spec.jsx +1 -0
- package/src/scripts/errors/{errorRoute.jsx → errorRoute.tsx} +1 -7
- package/src/scripts/errors/orcid/general.jsx +1 -1
- package/src/scripts/scss/dataset/dataset-page.scss +1 -1
- package/src/scripts/users/username.tsx +6 -1
- package/src/scripts/errors/orcid/email.jsx +0 -11
- package/src/scripts/errors/orcid/family.jsx +0 -12
- package/src/scripts/errors/orcid/given.jsx +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openneuro/app",
|
|
3
|
-
"version": "4.25.
|
|
3
|
+
"version": "4.25.1-orcid-demo.1",
|
|
4
4
|
"description": "React JS web frontend for the OpenNeuro platform.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "public/client.js",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"@emotion/react": "11.11.1",
|
|
21
21
|
"@emotion/styled": "11.11.0",
|
|
22
22
|
"@niivue/niivue": "0.34.0",
|
|
23
|
-
"@openneuro/client": "^4.25.
|
|
24
|
-
"@openneuro/components": "^4.25.
|
|
23
|
+
"@openneuro/client": "^4.25.1-orcid-demo.1",
|
|
24
|
+
"@openneuro/components": "^4.25.1-orcid-demo.1",
|
|
25
25
|
"@tanstack/react-table": "^8.9.3",
|
|
26
26
|
"bids-validator": "1.14.6",
|
|
27
27
|
"bytes": "^3.0.0",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "5e0c24435dce4a9d3add4b79558e420383c99125"
|
|
78
78
|
}
|
package/src/scripts/config.ts
CHANGED
|
@@ -13,8 +13,7 @@ export interface OpenNeuroConfig {
|
|
|
13
13
|
}
|
|
14
14
|
orcid?: {
|
|
15
15
|
clientID: string
|
|
16
|
-
|
|
17
|
-
redirectURI: string
|
|
16
|
+
ORCID_API_ENDPOINT: string
|
|
18
17
|
}
|
|
19
18
|
globus?: {
|
|
20
19
|
clientID: string
|
|
@@ -45,8 +44,7 @@ export const config: OpenNeuroConfig = {
|
|
|
45
44
|
},
|
|
46
45
|
orcid: {
|
|
47
46
|
clientID: globalThis.OpenNeuroConfig.ORCID_CLIENT_ID,
|
|
48
|
-
|
|
49
|
-
redirectURI: globalThis.OpenNeuroConfig.ORCID_REDIRECT_URI,
|
|
47
|
+
ORCID_API_ENDPOINT: globalThis.OpenNeuroConfig.ORCID_API_ENDPOINT,
|
|
50
48
|
},
|
|
51
49
|
},
|
|
52
50
|
analytics: {
|
|
@@ -15,7 +15,7 @@ exports[`Comment component > renders an ORCID user comment 1`] = `
|
|
|
15
15
|
Example Exampler
|
|
16
16
|
|
|
17
17
|
<a
|
|
18
|
-
href="https://orcid.org/1234-5678-9101"
|
|
18
|
+
href="https://sandbox.orcid.org/1234-5678-9101"
|
|
19
19
|
>
|
|
20
20
|
<img
|
|
21
21
|
alt="ORCID logo"
|
|
@@ -89,7 +89,7 @@ exports[`Comment component > renders an ORCID user comment 1`] = `
|
|
|
89
89
|
Example Exampler
|
|
90
90
|
|
|
91
91
|
<a
|
|
92
|
-
href="https://orcid.org/1234-5678-9101"
|
|
92
|
+
href="https://sandbox.orcid.org/1234-5678-9101"
|
|
93
93
|
>
|
|
94
94
|
<img
|
|
95
95
|
alt="ORCID logo"
|
|
@@ -4,6 +4,7 @@ import Comment from "../comment.jsx"
|
|
|
4
4
|
import formatDistanceToNow from "date-fns/formatDistanceToNow"
|
|
5
5
|
|
|
6
6
|
vi.mock("date-fns/formatDistanceToNow")
|
|
7
|
+
vi.mock("../../../config.ts")
|
|
7
8
|
|
|
8
9
|
const emptyState =
|
|
9
10
|
'{"blocks":[{"key":"3sm42","text":"","type":"unstyled","depth":0,"inlineStyleRanges":[],"entityRanges":[],"data":{}}],"entityMap":{}}'
|
|
@@ -4,10 +4,7 @@
|
|
|
4
4
|
import React from "react"
|
|
5
5
|
import { Route, Routes } from "react-router-dom"
|
|
6
6
|
import OrcidGeneral from "./orcid/general.jsx"
|
|
7
|
-
import
|
|
8
|
-
import OrcidGiven from "./orcid/given.jsx"
|
|
9
|
-
import OrcidFamily from "./orcid/family.jsx"
|
|
10
|
-
import FourOFourPage from "./404page"
|
|
7
|
+
import FourOFourPage from "./404page.js"
|
|
11
8
|
|
|
12
9
|
function ErrorRoute() {
|
|
13
10
|
return (
|
|
@@ -15,9 +12,6 @@ function ErrorRoute() {
|
|
|
15
12
|
<div className="panel">
|
|
16
13
|
<Routes>
|
|
17
14
|
<Route path="orcid" element={<OrcidGeneral />} />
|
|
18
|
-
<Route path="orcid/email" element={<OrcidEmail />} />
|
|
19
|
-
<Route path="orcid/given" element={<OrcidGiven />} />
|
|
20
|
-
<Route path="orcid/family" element={<OrcidFamily />} />
|
|
21
15
|
<Route path="*" element={<FourOFourPage />} />
|
|
22
16
|
</Routes>
|
|
23
17
|
</div>
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import React from "react"
|
|
2
2
|
import ORCIDiDLogo from "../../assets/ORCIDiD_iconvector.svg"
|
|
3
|
+
import { config } from "../config"
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Display component for usernames showing ORCID linking if connected
|
|
6
7
|
*/
|
|
7
8
|
export const Username = ({ user }): JSX.Element => {
|
|
8
9
|
if (user.orcid) {
|
|
10
|
+
let orcidURL = "https://orcid.org/"
|
|
11
|
+
if (config.auth.orcid.ORCID_API_ENDPOINT.includes("sandbox")) {
|
|
12
|
+
orcidURL = "https://sandbox.orcid.org/"
|
|
13
|
+
}
|
|
9
14
|
return (
|
|
10
15
|
<>
|
|
11
16
|
{user.name}{" "}
|
|
12
|
-
<a href={
|
|
17
|
+
<a href={`${orcidURL}${user.orcid}`}>
|
|
13
18
|
<img src={ORCIDiDLogo} width="16" height="16" alt="ORCID logo" />
|
|
14
19
|
</a>
|
|
15
20
|
</>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
|
|
3
|
-
const EmailError = () => (
|
|
4
|
-
<div className="panel-body">
|
|
5
|
-
Your ORCID account does not have an e-mail, or your e-mail is not public.
|
|
6
|
-
Visit your <a href="https://orcid.org/my-orcid">ORCID profile</a>{" "}
|
|
7
|
-
and verify you have a public e-mail address and try again.
|
|
8
|
-
</div>
|
|
9
|
-
)
|
|
10
|
-
|
|
11
|
-
export default EmailError
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
|
|
3
|
-
const FamilyError = () => (
|
|
4
|
-
<div className="panel-body">
|
|
5
|
-
Your ORCID account does not have a credit name or family name, or your name
|
|
6
|
-
is not public. Visit your{" "}
|
|
7
|
-
<a href="https://orcid.org/my-orcid">ORCID profile</a>{" "}
|
|
8
|
-
and verify verify you have a publicly available name set.
|
|
9
|
-
</div>
|
|
10
|
-
)
|
|
11
|
-
|
|
12
|
-
export default FamilyError
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
|
|
3
|
-
const GivenError = () => (
|
|
4
|
-
<div className="panel-body">
|
|
5
|
-
Your ORCID account does not have a credit name or given name, or your name
|
|
6
|
-
is not public. Visit your{" "}
|
|
7
|
-
<a href="https://orcid.org/my-orcid">ORCID profile</a>{" "}
|
|
8
|
-
and verify you have a publicly available name set.
|
|
9
|
-
</div>
|
|
10
|
-
)
|
|
11
|
-
|
|
12
|
-
export default GivenError
|