@openneuro/app 4.40.7 → 4.40.9

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.40.7",
3
+ "version": "4.40.9",
4
4
  "description": "React JS web frontend for the OpenNeuro platform.",
5
5
  "license": "MIT",
6
6
  "main": "public/client.js",
@@ -78,5 +78,5 @@
78
78
  "publishConfig": {
79
79
  "access": "public"
80
80
  },
81
- "gitHead": "0834d756dffce9e8a4de0a588ab71237d61cdd90"
81
+ "gitHead": "d79fc55e88352f0fc34d949cc71edbae0f5e996e"
82
82
  }
@@ -1,4 +1,5 @@
1
1
  import React, { useState } from "react"
2
+ import Helmet from "react-helmet"
2
3
  import * as Sentry from "@sentry/react"
3
4
  import { useMutation } from "@apollo/client"
4
5
  import { EditableContent } from "./components/editable-content"
@@ -8,6 +9,7 @@ import { GitHubAuthButton } from "./github-auth-button"
8
9
  import type { UserAccountViewProps } from "../types/user-types"
9
10
  import { OrcidConsentForm } from "./components/orcid-consent-form"
10
11
  import { validateHttpHttpsUrl } from "../utils/validationUtils"
12
+ import { pageTitle } from "../resources/strings.js"
11
13
 
12
14
  export const UserAccountView: React.FC<UserAccountViewProps> = ({
13
15
  orcidUser,
@@ -84,66 +86,73 @@ export const UserAccountView: React.FC<UserAccountViewProps> = ({
84
86
  }
85
87
 
86
88
  return (
87
- <div data-testid="user-account-view" className={styles.useraccountview}>
88
- <h3>Account</h3>
89
- <ul className={styles.accountDetail}>
90
- <li>
91
- <span>Name:</span>
92
- {orcidUser.name}
93
- </li>
94
- <li>
95
- <span>Email:</span>
96
- {orcidUser.email}
97
- </li>
98
- <li>
99
- <span>ORCID:</span>
100
- {orcidUser.orcid}
101
- </li>
102
- {orcidUser?.github &&
103
- (
104
- <li>
105
- <span>GitHub:</span>
106
- {orcidUser.github}
107
- </li>
108
- )}
109
- <li>
110
- <GitHubAuthButton sync={orcidUser.githubSynced} />
111
- </li>
112
- </ul>
89
+ <>
90
+ <Helmet>
91
+ <title>
92
+ {orcidUser.name || "User"} profile - {pageTitle}
93
+ </title>
94
+ </Helmet>
95
+ <div data-testid="user-account-view" className={styles.useraccountview}>
96
+ <h3>Account</h3>
97
+ <ul className={styles.accountDetail}>
98
+ <li>
99
+ <span>Name:</span>
100
+ {orcidUser.name}
101
+ </li>
102
+ <li>
103
+ <span>Email:</span>
104
+ {orcidUser.email}
105
+ </li>
106
+ <li>
107
+ <span>ORCID:</span>
108
+ {orcidUser.orcid}
109
+ </li>
110
+ {orcidUser?.github &&
111
+ (
112
+ <li>
113
+ <span>GitHub:</span>
114
+ {orcidUser.github}
115
+ </li>
116
+ )}
117
+ <li>
118
+ <GitHubAuthButton sync={orcidUser.githubSynced} />
119
+ </li>
120
+ </ul>
113
121
 
114
- <EditableContent
115
- editableContent={userLinks}
116
- setRows={handleLinksChange}
117
- heading="Links"
118
- validation={validateHttpHttpsUrl}
119
- validationMessage="Invalid URL format. Please start with http:// or https://"
120
- data-testid="links-section"
121
- />
122
+ <EditableContent
123
+ editableContent={userLinks}
124
+ setRows={handleLinksChange}
125
+ heading="Links"
126
+ validation={validateHttpHttpsUrl}
127
+ validationMessage="Invalid URL format. Please start with http:// or https://"
128
+ data-testid="links-section"
129
+ />
122
130
 
123
- {orcidUser?.id && orcidUser?.orcid !== undefined && (
124
- <div className={styles.umbOrcidConsent}>
125
- <div className={styles.umbOrcidHeading}>
126
- <h4>ORCID Integration</h4>
131
+ {orcidUser?.id && orcidUser?.orcid !== undefined && (
132
+ <div className={styles.umbOrcidConsent}>
133
+ <div className={styles.umbOrcidHeading}>
134
+ <h4>ORCID Integration</h4>
135
+ </div>
136
+ <OrcidConsentForm
137
+ userId={orcidUser.id}
138
+ initialOrcidConsent={orcidUser.orcidConsent}
139
+ />
127
140
  </div>
128
- <OrcidConsentForm
129
- userId={orcidUser.id}
130
- initialOrcidConsent={orcidUser.orcidConsent}
131
- />
132
- </div>
133
- )}
141
+ )}
134
142
 
135
- <EditableContent
136
- editableContent={userLocation}
137
- setRows={handleLocationChange}
138
- heading="Location"
139
- data-testid="location-section"
140
- />
141
- <EditableContent
142
- editableContent={userInstitution}
143
- setRows={handleInstitutionChange}
144
- heading="Institution"
145
- data-testid="institution-section"
146
- />
147
- </div>
143
+ <EditableContent
144
+ editableContent={userLocation}
145
+ setRows={handleLocationChange}
146
+ heading="Location"
147
+ data-testid="location-section"
148
+ />
149
+ <EditableContent
150
+ editableContent={userInstitution}
151
+ setRows={handleInstitutionChange}
152
+ heading="Institution"
153
+ data-testid="institution-section"
154
+ />
155
+ </div>
156
+ </>
148
157
  )
149
158
  }