@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openneuro/app",
3
- "version": "4.25.0",
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.0",
24
- "@openneuro/components": "^4.25.0",
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": "294a30606b3851318666efca9f987ccf8af8c5e7"
77
+ "gitHead": "5e0c24435dce4a9d3add4b79558e420383c99125"
78
78
  }
@@ -17,6 +17,7 @@ export const config = {
17
17
  },
18
18
  orcid: {
19
19
  clientID: "orcid-client-id",
20
+ ORCID_API_ENDPOINT: "https://api.sandbox.orcid.org",
20
21
  },
21
22
  },
22
23
 
@@ -13,8 +13,7 @@ export interface OpenNeuroConfig {
13
13
  }
14
14
  orcid?: {
15
15
  clientID: string
16
- URI: string
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
- URI: globalThis.OpenNeuroConfig.ORCID_URI,
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 OrcidEmail from "./orcid/email.jsx"
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>
@@ -2,7 +2,7 @@ import React from "react"
2
2
 
3
3
  const OrcidError = () => (
4
4
  <div className="panel-heading">
5
- <h2>There was an issue authenticating with your ORCID account</h2>
5
+ <h2>There was an issue authenticating with your ORCID account.</h2>
6
6
  </div>
7
7
  )
8
8
 
@@ -273,7 +273,7 @@
273
273
  }
274
274
  }
275
275
  p {
276
- display: inline-block;
276
+ display: inline;
277
277
  }
278
278
  }
279
279
  }
@@ -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={`https://orcid.org/${user.orcid}`}>
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