@@ -178,7 +178,8 @@ export class TopBarComponent implements OnInit, OnDestroy {
178178 }
179179
180180 if ( event . actionId === 'connect' ) {
181- const target = raw . authorizationUrl ?. uri
181+ const integration = this . parseOrcidIntegrationIntro ( raw ?. notificationIntro )
182+ const target = integration ?. link || raw . authorizationUrl ?. uri
182183 this . _inbox
183184 . flagAsRead ( raw . putCode )
184185 . pipe ( first ( ) )
@@ -212,7 +213,12 @@ export class TopBarComponent implements OnInit, OnDestroy {
212213 . subscribe ( ( grouped ) => {
213214 this . permissionPanelRaw = grouped
214215 this . permissionPanelNotifications = grouped . map ( ( n ) => {
215- const orgName = n ?. sourceDescription || ''
216+ const integration = this . parseOrcidIntegrationIntro ( n ?. notificationIntro )
217+ const orgName =
218+ integration ?. memberName ||
219+ n ?. source ?. sourceName ?. content ||
220+ n ?. sourceDescription ||
221+ ''
216222 const escaped = orgName
217223 . replace ( / & / g, '&' )
218224 . replace ( / < / g, '<' )
@@ -242,6 +248,19 @@ export class TopBarComponent implements OnInit, OnDestroy {
242248 } )
243249 }
244250
251+ private parseOrcidIntegrationIntro (
252+ intro ?: string
253+ ) : { memberName : string ; link : string } | null {
254+ if ( ! intro || ! intro . includes ( '::' ) ) {
255+ return null
256+ }
257+ const [ memberName , link ] = intro . split ( '::' )
258+ if ( ! memberName || ! link ) {
259+ return null
260+ }
261+ return { memberName, link }
262+ }
263+
245264 resendVerificationEmailModal ( email : string ) {
246265 this . _verificationEmailModalService . openVerificationEmailModal ( email )
247266 }
0 commit comments