Skip to content

Commit ddd0828

Browse files
committed
add page titles and message sentiments
1 parent 93e5867 commit ddd0828

51 files changed

Lines changed: 652 additions & 148 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

locales/de-DE.arb

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
"@personalInfoTitle": {
145145
"description": "Persönliche Angaben Abschnittsüberschrift"
146146
},
147-
"passwordSectionTitle": "Passwort",
147+
"passwordSectionTitle": "Passwort aktualisieren",
148148
"@passwordSectionTitle": {
149149
"description": "Passwort-Abschnittsüberschrift"
150150
},
@@ -371,5 +371,64 @@
371371
"successAccountUpdated": "Ihr Konto wurde aktualisiert",
372372
"@successAccountUpdated": {
373373
"description": "Konto-Aktualisierung Erfolgsmeldung"
374-
}
374+
},
375+
"errorAccountDisabled": "Konto ist deaktiviert. Wenden Sie sich an Ihren Administrator.",
376+
"errorUsernameExists": "Benutzername existiert bereits.",
377+
"errorEmailExists": "E-Mail existiert bereits.",
378+
"errorExpiredCode": "Anmeldung abgelaufen. Bitte melden Sie sich erneut an.",
379+
"errorExpiredAction": "Aktion abgelaufen. Bitte fahren Sie jetzt mit der Anmeldung fort.",
380+
"errorInvalidTotp": "Ungültiger Authentifikatorcode.",
381+
"errorMissingTotp": "Bitte geben Sie den Authentifikatorcode an.",
382+
"errorConfigureTotp": "Sie müssen den mobilen Authentifikator einrichten, um Ihr Konto zu aktivieren.",
383+
"errorEmailSendError": "E-Mail konnte nicht gesendet werden. Bitte versuchen Sie es später erneut.",
384+
"successPasswordUpdated": "Ihr Passwort wurde aktualisiert.",
385+
"successEmailSent": "Sie sollten in Kürze eine E-Mail mit weiteren Anweisungen erhalten.",
386+
"pageTitleLogin": "Anmelden",
387+
"pageTitleRegister": "Registrieren",
388+
"pageTitleForgotPassword": "Passwort vergessen",
389+
"pageTitleInfo": "Information",
390+
"pageTitleError": "Fehler",
391+
"pageTitleCode": "Bestätigungscode",
392+
"pageTitleLogoutConfirm": "Abmelden",
393+
"pageTitleTerms": "Allgemeine Geschäftsbedingungen",
394+
"pageTitleLoginOtp": "Bestätigungscode",
395+
"pageTitleUpdatePassword": "Passwort ändern",
396+
"pageTitleEmailVerification": "E-Mail-Verifizierung",
397+
"pageTitleDeleteAccountConfirm": "Konto löschen",
398+
"pageTitleDeleteCredential": "Anmeldedaten löschen",
399+
"pageTitleFrontchannelLogout": "Abmelden",
400+
"pageTitleIdpReviewProfile": "Kontoinformationen aktualisieren",
401+
"pageTitleLinkIdp": "Identitätsanbieter verknüpfen",
402+
"pageTitleConfigTotp": "Mobiler Authentifikator einrichten",
403+
"pageTitleIdpLinkConfirm": "Konto verknüpfen",
404+
"pageTitleIdpLinkConfirmOverride": "Verknüpfung überschreiben",
405+
"pageTitleIdpLinkEmail": "Konto verknüpfen",
406+
"pageTitleOauth2DeviceVerifyUserCode": "Geräte-Anmeldung",
407+
"pageTitleOauthGrant": "Zugriff gewähren",
408+
"pageTitlePageExpired": "Seite abgelaufen",
409+
"pageTitlePasskeysConditionalAuthenticate": "Passkey-Anmeldung",
410+
"pageTitleLoginPassword": "Anmelden",
411+
"pageTitleRecoveryCodeConfig": "Wiederherstellungscodes",
412+
"pageTitleRecoveryCodeInput": "Wiederherstellungscode",
413+
"pageTitleResetOtp": "Authentifikator zurücksetzen",
414+
"pageTitleUpdateProfile": "Kontoinformationen aktualisieren",
415+
"pageTitleLoginUsername": "Anmelden",
416+
"pageTitleX509Info": "X.509-Zertifikat",
417+
"pageTitleSamlPostForm": "Weiterleitung",
418+
"pageTitleSelectAuthenticator": "Authentifikator auswählen",
419+
"pageTitleSelectOrganization": "Organisation auswählen",
420+
"pageTitleUpdateEmail": "E-Mail aktualisieren",
421+
"pageTitleWebauthnAuthenticate": "Passkey-Anmeldung",
422+
"pageTitleWebauthnError": "Passkey-Fehler",
423+
"pageTitleWebauthnRegister": "Passkey-Registrierung",
424+
"pageTitleAccount": "Konto",
425+
"pageTitleAccountPassword": "Passwort",
426+
"messageHeaderEmailVerification": "E-Mail-Verifizierung",
427+
"messageHeaderForgotPassword": "Passwort vergessen?",
428+
"messageHeaderEmailUpdateConfirmation": "Bestätigungs-E-Mail gesendet",
429+
"messageHeaderEmailUpdated": "E-Mail aktualisiert",
430+
"messageHeaderUpdatePassword": "Passwort ändern",
431+
"messageHeaderSuccessCode": "Erfolgscode",
432+
"messageHeaderErrorCode": "Fehlercode",
433+
"messageHeaderExecuteActions": "Erforderliche Aktionen"
375434
}

locales/en-US.arb

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
"@personalInfoTitle": {
145145
"description": "Personal info section title"
146146
},
147-
"passwordSectionTitle": "Password",
147+
"passwordSectionTitle": "Update password",
148148
"@passwordSectionTitle": {
149149
"description": "Password section title"
150150
},
@@ -371,5 +371,64 @@
371371
"successAccountUpdated": "Your account has been updated",
372372
"@successAccountUpdated": {
373373
"description": "Account update success message"
374-
}
374+
},
375+
"errorAccountDisabled": "Account is disabled, contact your administrator.",
376+
"errorUsernameExists": "Username already exists.",
377+
"errorEmailExists": "Email already exists.",
378+
"errorExpiredCode": "Login timeout. Please sign in again.",
379+
"errorExpiredAction": "Action expired. Please continue with login now.",
380+
"errorInvalidTotp": "Invalid authenticator code.",
381+
"errorMissingTotp": "Please specify authenticator code.",
382+
"errorConfigureTotp": "You need to set up Mobile Authenticator to activate your account.",
383+
"errorEmailSendError": "Failed to send email, please try again later.",
384+
"successPasswordUpdated": "Your password has been updated.",
385+
"successEmailSent": "You should receive an email shortly with further instructions.",
386+
"pageTitleLogin": "Log In",
387+
"pageTitleRegister": "Register",
388+
"pageTitleForgotPassword": "Forgot Password",
389+
"pageTitleInfo": "Information",
390+
"pageTitleError": "Error",
391+
"pageTitleCode": "Verification Code",
392+
"pageTitleLogoutConfirm": "Log Out",
393+
"pageTitleTerms": "Terms and Conditions",
394+
"pageTitleLoginOtp": "Verification Code",
395+
"pageTitleUpdatePassword": "Update Password",
396+
"pageTitleEmailVerification": "Email Verification",
397+
"pageTitleDeleteAccountConfirm": "Delete Account",
398+
"pageTitleDeleteCredential": "Delete Credential",
399+
"pageTitleFrontchannelLogout": "Logging Out",
400+
"pageTitleIdpReviewProfile": "Update Account Information",
401+
"pageTitleLinkIdp": "Link Identity Provider",
402+
"pageTitleConfigTotp": "Mobile Authenticator Setup",
403+
"pageTitleIdpLinkConfirm": "Link Account",
404+
"pageTitleIdpLinkConfirmOverride": "Override Link",
405+
"pageTitleIdpLinkEmail": "Link Account",
406+
"pageTitleOauth2DeviceVerifyUserCode": "Device Login",
407+
"pageTitleOauthGrant": "Grant Access",
408+
"pageTitlePageExpired": "Page Expired",
409+
"pageTitlePasskeysConditionalAuthenticate": "Passkey Login",
410+
"pageTitleLoginPassword": "Log In",
411+
"pageTitleRecoveryCodeConfig": "Recovery Codes",
412+
"pageTitleRecoveryCodeInput": "Recovery Code",
413+
"pageTitleResetOtp": "Reset Authenticator",
414+
"pageTitleUpdateProfile": "Update Account Information",
415+
"pageTitleLoginUsername": "Log In",
416+
"pageTitleX509Info": "X.509 Certificate",
417+
"pageTitleSamlPostForm": "Redirecting",
418+
"pageTitleSelectAuthenticator": "Select Authenticator",
419+
"pageTitleSelectOrganization": "Select Organization",
420+
"pageTitleUpdateEmail": "Update Email",
421+
"pageTitleWebauthnAuthenticate": "Passkey Login",
422+
"pageTitleWebauthnError": "Passkey Error",
423+
"pageTitleWebauthnRegister": "Passkey Registration",
424+
"pageTitleAccount": "Account",
425+
"pageTitleAccountPassword": "Password",
426+
"messageHeaderEmailVerification": "Email verification",
427+
"messageHeaderForgotPassword": "Forgot Your Password?",
428+
"messageHeaderEmailUpdateConfirmation": "Confirmation email sent",
429+
"messageHeaderEmailUpdated": "Email updated",
430+
"messageHeaderUpdatePassword": "Update password",
431+
"messageHeaderSuccessCode": "Success code",
432+
"messageHeaderErrorCode": "Error code",
433+
"messageHeaderExecuteActions": "Required actions"
375434
}

src/account/KcPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default function KcPage(props: { kcContext: KcContext }) {
3333
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}>
3434
<a
3535
href={kcContext.url.accountUrl}
36-
className="text-[var(--hw-color-primary-600)] underline"
36+
className="text-[var(--color-primary-hover)] underline"
3737
>
3838
Back to Account
3939
</a>

src/account/components/AccountPageLayout.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { useEffect } from 'react'
12
import type { ReactNode } from 'react'
23
import type { KcContext } from '../KcContext'
34
import { Branding } from '../../login/components/Branding'
@@ -8,6 +9,7 @@ import { hideKeycloakStyles } from '../../login/utils/hideKeycloakStyles'
89
import { LogOut } from 'lucide-react'
910
import { Button } from '@helpwave/hightide'
1011
import { useTranslation } from '../../i18n/useTranslation'
12+
import { getDocumentTitle } from '../utils/pageTitles'
1113

1214
type AccountPageLayoutProps = {
1315
kcContext: KcContext,
@@ -17,6 +19,10 @@ type AccountPageLayoutProps = {
1719
export function AccountPageLayout({ kcContext, children }: AccountPageLayoutProps) {
1820
const t = useTranslation()
1921

22+
useEffect(() => {
23+
document.title = getDocumentTitle(kcContext.pageId, t)
24+
}, [kcContext.pageId, t])
25+
2026
return (
2127
<>
2228
<style>{hideKeycloakStyles}</style>
@@ -32,7 +38,7 @@ export function AccountPageLayout({ kcContext, children }: AccountPageLayoutProp
3238
window.location.href = kcContext.url.getLogoutUrl()
3339
}}
3440
>
35-
<LogOut className="w-4 h-4" style={{ color: 'var(--hw-color-negative-600)' }} />
41+
<LogOut className="w-4 h-4" style={{ color: 'var(--color-negative)' }} />
3642
{t('doLogout')}
3743
</Button>
3844
</div>

src/account/pages/AccountPassword.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ export default function AccountPassword({ kcContext }: AccountPasswordProps) {
3434
{message && <AlertBox message={message} className="mb-2" />}
3535

3636
<section className="flex flex-col gap-4">
37-
<h2 className="text-lg font-bold text-[var(--hw-color-neutral-700)]">
38-
{t('passwordSectionTitle')}
39-
</h2>
4037
<form
4138
action={url.passwordUrl}
4239
method="post"
@@ -64,7 +61,7 @@ export default function AccountPassword({ kcContext }: AccountPasswordProps) {
6461
type="password"
6562
value={currentPassword}
6663
onValueChange={(v) => setCurrentPassword(v)}
67-
onEditComplete={() => {}}
64+
onEditComplete={() => { }}
6865
autoComplete="current-password"
6966
{...ariaAttributes}
7067
/>
@@ -86,7 +83,7 @@ export default function AccountPassword({ kcContext }: AccountPasswordProps) {
8683
type="password"
8784
value={newPassword}
8885
onValueChange={(v) => setNewPassword(v)}
89-
onEditComplete={() => {}}
86+
onEditComplete={() => { }}
9087
autoComplete="new-password"
9188
required
9289
{...ariaAttributes}
@@ -108,7 +105,7 @@ export default function AccountPassword({ kcContext }: AccountPasswordProps) {
108105
type="password"
109106
value={newPasswordConfirm}
110107
onValueChange={(v) => setNewPasswordConfirm(v)}
111-
onEditComplete={() => {}}
108+
onEditComplete={() => { }}
112109
autoComplete="new-password"
113110
required
114111
{...ariaAttributes}

src/account/pages/AccountSettings.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default function AccountSettings({ kcContext }: AccountSettingsProps) {
3838
{message && <AlertBox message={message} className="mb-2" />}
3939

4040
<section className="flex flex-col gap-3">
41-
<h2 className="text-lg font-bold text-[var(--hw-color-neutral-700)]">
41+
<h2 className="text-lg font-bold text-[var(--color-label)]">
4242
{t('accountSectionProfile')}
4343
</h2>
4444
<div className="flex items-center gap-3 flex-wrap">
@@ -56,10 +56,10 @@ export default function AccountSettings({ kcContext }: AccountSettingsProps) {
5656
</div>
5757
</section>
5858

59-
<hr className="border-[var(--hw-color-neutral-200)]" />
59+
<hr className="border-[var(--color-border)]" />
6060

6161
<section className="flex flex-col gap-4">
62-
<h2 className="text-lg font-bold text-[var(--hw-color-neutral-700)]">
62+
<h2 className="text-lg font-bold text-[var(--color-label)]">
6363
{t('personalInfoTitle')}
6464
</h2>
6565
<form
@@ -165,10 +165,10 @@ export default function AccountSettings({ kcContext }: AccountSettingsProps) {
165165
</form>
166166
</section>
167167

168-
<hr className="border-[var(--hw-color-neutral-200)]" />
168+
<hr className="border-[var(--color-border)]" />
169169

170170
<section className="flex flex-col gap-3">
171-
<h2 className="text-lg font-bold text-[var(--hw-color-neutral-700)]">
171+
<h2 className="text-lg font-bold text-[var(--color-label)]">
172172
{t('passwordSectionTitle')}
173173
</h2>
174174
<Button
@@ -184,13 +184,13 @@ export default function AccountSettings({ kcContext }: AccountSettingsProps) {
184184
</Button>
185185
</section>
186186

187-
<hr className="border-[var(--hw-color-neutral-200)]" />
187+
<hr className="border-[var(--color-border)]" />
188188

189189
<section className="flex flex-col gap-2">
190-
<h2 className="text-lg font-bold text-[var(--hw-color-neutral-700)]">
190+
<h2 className="text-lg font-bold text-[var(--color-label)]">
191191
{t('profilePicture')}
192192
</h2>
193-
<p className="text-sm text-[var(--hw-color-neutral-600)]">
193+
<p className="text-sm text-[var(--color-text-secondary)]">
194194
{t('profilePictureComingSoon')}
195195
</p>
196196
</section>

src/account/utils/pageTitles.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import type { KcContext } from '../KcContext'
2+
import type { HelpwaveIdTranslationEntries } from '../../i18n/translations'
3+
4+
const PAGE_TITLE_BY_PAGE_ID: Partial<Record<KcContext['pageId'], keyof HelpwaveIdTranslationEntries>> = {
5+
'account.ftl': 'pageTitleAccount',
6+
'password.ftl': 'pageTitleAccountPassword'
7+
}
8+
9+
export function getPageTitleKey(pageId: KcContext['pageId']): keyof HelpwaveIdTranslationEntries {
10+
return PAGE_TITLE_BY_PAGE_ID[pageId] ?? 'pageTitleAccount'
11+
}
12+
13+
export function getDocumentTitle(
14+
pageId: KcContext['pageId'],
15+
t: (key: keyof HelpwaveIdTranslationEntries) => string
16+
): string {
17+
return `${t(getPageTitleKey(pageId))} | helpwave id`
18+
}

0 commit comments

Comments
 (0)