Skip to content

Commit e50ac3c

Browse files
committed
update the warning to naviagate to sign up page as well
1 parent e4e4476 commit e50ac3c

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

src/keycloak-theme/login/Template.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ import { ArrowUpRightSquareFill } from 'react-bootstrap-icons'
1111
import dataverse_logo from '@/assets/dataverse_brand_icon.svg'
1212
import styles from './template.module.scss'
1313

14+
const DATAVERSE_BASE_URL =
15+
import.meta.env.VITE_DATAVERSE_BASE_URL ?? 'https://dataverse.harvard.edu'
16+
const HARVARD_SIGN_UP_URL = `${DATAVERSE_BASE_URL}/dataverseuser.xhtml?editMode=CREATE&redirectPage=%2Fdataverse_homepage.xhtml`
17+
1418
/*
1519
* This is a Layout common to every keycloak page.
1620
* It was originally generated by running `npx keycloakify eject-page` and then selecting `Template.tsx` option.
@@ -67,7 +71,10 @@ export default function Template(props: TemplateProps<KcContext, I18n>) {
6771
{kcContext.pageId === 'login.ftl' && (
6872
<div className={styles['top-notice']}>
6973
<Alert variant="warning" customHeading={msgStr('signInNoticeTitle')} dismissible={false}>
70-
{msg('signInNoticeBody')}
74+
<>
75+
{msg('signInNoticeBodyPrefix')}
76+
<a href={HARVARD_SIGN_UP_URL}>{msg('signInNoticeSignUpLinkText')}</a>
77+
</>
7178
</Alert>
7279
</div>
7380
)}

src/keycloak-theme/login/i18n.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ const { useI18n, ofTypeI18n } = i18nBuilder
88
.withCustomTranslations({
99
en: {
1010
signInNoticeTitle: 'Note about ORCID, GitHub, and Google sign-in:',
11-
signInNoticeBody:
12-
'These options are available only to the existing accounts that previously authenticated with these methods. New sign-ups via ORCID, GitHub, or Google are not supported. Please use your Institutional Login or Username/Email to sign up. If you need help logging in, please contact support.'
11+
signInNoticeBodyPrefix:
12+
'These options are available only to the existing accounts that previously authenticated with these methods. New sign-ups via ORCID, GitHub, or Google are not supported. Please use your Harvard Login or Username/Email to ',
13+
signInNoticeSignUpLinkText: 'sign up in Harvard Dataverse'
1314
}
1415
})
1516
.build()

src/keycloak-theme/login/template.module.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
}
3030
}
3131

32+
.top-notice {
33+
margin: 0.5rem;
34+
border-radius: 8px;
35+
}
36+
3237
.login-card {
3338
width: 100%;
3439
height: 100%;

0 commit comments

Comments
 (0)