From 7297d0fccd0eb18aed721227f4dc70c937fe0afa Mon Sep 17 00:00:00 2001 From: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com> Date: Fri, 11 Oct 2024 16:02:47 -0400 Subject: [PATCH] Auth/PM-13318 - AnonLayoutWrapperData Refactor to add full Translation support (#11513) * PM-13318 - AnonLayoutWrapperData refactor to support all possible string scenarios (untranslated string, translated string, and translated string with placeholders) * PM-13318 - Fix accidental check in * PM-13318 - Revert the correct change. * PM-13318 - Fix test failures --- ...extension-anon-layout-wrapper.component.ts | 28 ++++---- .../extension-anon-layout-wrapper.stories.ts | 16 +++-- apps/browser/src/popup/app-routing.module.ts | 24 +++++-- apps/desktop/src/app/app-routing.module.ts | 34 +++++++--- .../resolver/free-trial-text.resolver.spec.ts | 16 +++-- .../resolver/free-trial-text.resolver.ts | 17 +++-- apps/web/src/app/oss-routing.module.ts | 68 ++++++++++++++----- .../src/app/tools/send/access.component.ts | 4 +- .../anon-layout-wrapper.component.ts | 56 +++++++++------ .../anon-layout-wrapper.stories.ts | 15 ++-- libs/auth/src/angular/lock/lock.component.ts | 5 +- 11 files changed, 191 insertions(+), 92 deletions(-) diff --git a/apps/browser/src/auth/popup/extension-anon-layout-wrapper/extension-anon-layout-wrapper.component.ts b/apps/browser/src/auth/popup/extension-anon-layout-wrapper/extension-anon-layout-wrapper.component.ts index 350b4a8a84..9d7644878d 100644 --- a/apps/browser/src/auth/popup/extension-anon-layout-wrapper/extension-anon-layout-wrapper.component.ts +++ b/apps/browser/src/auth/popup/extension-anon-layout-wrapper/extension-anon-layout-wrapper.component.ts @@ -9,7 +9,7 @@ import { AnonLayoutWrapperDataService, } from "@bitwarden/auth/angular"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; -import { Icon, IconModule } from "@bitwarden/components"; +import { Icon, IconModule, Translation } from "@bitwarden/components"; import { PopOutComponent } from "../../../platform/popup/components/pop-out.component"; import { PopupHeaderComponent } from "../../../platform/popup/layout/popup-header.component"; @@ -90,11 +90,11 @@ export class ExtensionAnonLayoutWrapperComponent implements OnInit, OnDestroy { } if (firstChildRouteData["pageTitle"] !== undefined) { - this.pageTitle = this.i18nService.t(firstChildRouteData["pageTitle"]); + this.pageTitle = this.handleStringOrTranslation(firstChildRouteData["pageTitle"]); } if (firstChildRouteData["pageSubtitle"] !== undefined) { - this.pageSubtitle = this.i18nService.t(firstChildRouteData["pageSubtitle"]); + this.pageSubtitle = this.handleStringOrTranslation(firstChildRouteData["pageSubtitle"]); } if (firstChildRouteData["pageIcon"] !== undefined) { @@ -132,19 +132,11 @@ export class ExtensionAnonLayoutWrapperComponent implements OnInit, OnDestroy { } if (data.pageTitle) { - this.pageTitle = this.i18nService.t(data.pageTitle); + this.pageTitle = this.handleStringOrTranslation(data.pageTitle); } if (data.pageSubtitle) { - // If you pass just a string, we translate it by default - if (typeof data.pageSubtitle === "string") { - this.pageSubtitle = this.i18nService.t(data.pageSubtitle); - } else { - // if you pass an object, you can specify if you want to translate it or not - this.pageSubtitle = data.pageSubtitle.translate - ? this.i18nService.t(data.pageSubtitle.subtitle) - : data.pageSubtitle.subtitle; - } + this.pageSubtitle = this.handleStringOrTranslation(data.pageSubtitle); } if (data.pageIcon) { @@ -168,6 +160,16 @@ export class ExtensionAnonLayoutWrapperComponent implements OnInit, OnDestroy { } } + private handleStringOrTranslation(value: string | Translation): string { + if (typeof value === "string") { + // If it's a string, return it as is + return value; + } + + // If it's a Translation object, translate it + return this.i18nService.t(value.key, ...(value.placeholders ?? [])); + } + private resetPageData() { this.pageTitle = null; this.pageSubtitle = null; diff --git a/apps/browser/src/auth/popup/extension-anon-layout-wrapper/extension-anon-layout-wrapper.stories.ts b/apps/browser/src/auth/popup/extension-anon-layout-wrapper/extension-anon-layout-wrapper.stories.ts index beb07f3523..cc4aa2f731 100644 --- a/apps/browser/src/auth/popup/extension-anon-layout-wrapper/extension-anon-layout-wrapper.stories.ts +++ b/apps/browser/src/auth/popup/extension-anon-layout-wrapper/extension-anon-layout-wrapper.stories.ts @@ -221,8 +221,12 @@ export const DefaultContentExample: Story = { // Dynamic Content Example const initialData: ExtensionAnonLayoutWrapperData = { - pageTitle: "setAStrongPassword", - pageSubtitle: "finishCreatingYourAccountBySettingAPassword", + pageTitle: { + key: "setAStrongPassword", + }, + pageSubtitle: { + key: "finishCreatingYourAccountBySettingAPassword", + }, pageIcon: LockIcon, showAcctSwitcher: true, showBackButton: true, @@ -230,8 +234,12 @@ const initialData: ExtensionAnonLayoutWrapperData = { }; const changedData: ExtensionAnonLayoutWrapperData = { - pageTitle: "enterpriseSingleSignOn", - pageSubtitle: "checkYourEmail", + pageTitle: { + key: "enterpriseSingleSignOn", + }, + pageSubtitle: { + key: "checkYourEmail", + }, pageIcon: RegistrationCheckEmailIcon, showAcctSwitcher: false, showBackButton: false, diff --git a/apps/browser/src/popup/app-routing.module.ts b/apps/browser/src/popup/app-routing.module.ts index e07201c78d..1e4e28ea6d 100644 --- a/apps/browser/src/popup/app-routing.module.ts +++ b/apps/browser/src/popup/app-routing.module.ts @@ -449,7 +449,9 @@ const routes: Routes = [ canActivate: [canAccessFeature(FeatureFlag.ExtensionRefresh), lockGuard()], data: { pageIcon: LockIcon, - pageTitle: "yourVaultIsLockedV2", + pageTitle: { + key: "yourVaultIsLockedV2", + }, showReadonlyHostname: true, showAcctSwitcher: true, } satisfies ExtensionAnonLayoutWrapperData, @@ -471,7 +473,9 @@ const routes: Routes = [ canActivate: [canAccessFeature(FeatureFlag.EmailVerification), unauthGuardFn()], data: { state: "signup", - pageTitle: "createAccount", + pageTitle: { + key: "createAccount", + }, } satisfies RouteDataProperties & AnonLayoutWrapperData, children: [ { @@ -492,8 +496,12 @@ const routes: Routes = [ path: "finish-signup", canActivate: [canAccessFeature(FeatureFlag.EmailVerification), unauthGuardFn()], data: { - pageTitle: "setAStrongPassword", - pageSubtitle: "finishCreatingYourAccountBySettingAPassword", + pageTitle: { + key: "setAStrongPassword", + }, + pageSubtitle: { + key: "finishCreatingYourAccountBySettingAPassword", + }, state: "finish-signup", } satisfies RouteDataProperties & AnonLayoutWrapperData, children: [ @@ -508,8 +516,12 @@ const routes: Routes = [ canActivate: [canAccessFeature(FeatureFlag.EmailVerification)], component: SetPasswordJitComponent, data: { - pageTitle: "joinOrganization", - pageSubtitle: "finishJoiningThisOrganizationBySettingAMasterPassword", + pageTitle: { + key: "joinOrganization", + }, + pageSubtitle: { + key: "finishJoiningThisOrganizationBySettingAMasterPassword", + }, state: "set-password-jit", } satisfies RouteDataProperties & AnonLayoutWrapperData, }, diff --git a/apps/desktop/src/app/app-routing.module.ts b/apps/desktop/src/app/app-routing.module.ts index 86a39163f3..e8ae31e78a 100644 --- a/apps/desktop/src/app/app-routing.module.ts +++ b/apps/desktop/src/app/app-routing.module.ts @@ -141,8 +141,12 @@ const routes: Routes = [ path: "hint", canActivate: [unauthGuardFn()], data: { - pageTitle: "requestPasswordHint", - pageSubtitle: "enterYourAccountEmailAddressAndYourPasswordHintWillBeSentToYou", + pageTitle: { + key: "requestPasswordHint", + }, + pageSubtitle: { + key: "enterYourAccountEmailAddressAndYourPasswordHintWillBeSentToYou", + }, pageIcon: UserLockIcon, } satisfies AnonLayoutWrapperData, children: [ @@ -164,7 +168,11 @@ const routes: Routes = [ { path: "signup", canActivate: [canAccessFeature(FeatureFlag.EmailVerification), unauthGuardFn()], - data: { pageTitle: "createAccount" } satisfies AnonLayoutWrapperData, + data: { + pageTitle: { + key: "createAccount", + }, + } satisfies AnonLayoutWrapperData, children: [ { path: "", @@ -184,8 +192,12 @@ const routes: Routes = [ path: "finish-signup", canActivate: [canAccessFeature(FeatureFlag.EmailVerification), unauthGuardFn()], data: { - pageTitle: "setAStrongPassword", - pageSubtitle: "finishCreatingYourAccountBySettingAPassword", + pageTitle: { + key: "setAStrongPassword", + }, + pageSubtitle: { + key: "finishCreatingYourAccountBySettingAPassword", + }, } satisfies AnonLayoutWrapperData, children: [ { @@ -199,7 +211,9 @@ const routes: Routes = [ canActivate: [canAccessFeature(FeatureFlag.ExtensionRefresh), lockGuard()], data: { pageIcon: LockIcon, - pageTitle: "yourVaultIsLockedV2", + pageTitle: { + key: "yourVaultIsLockedV2", + }, showReadonlyHostname: true, } satisfies AnonLayoutWrapperData, children: [ @@ -214,8 +228,12 @@ const routes: Routes = [ canActivate: [canAccessFeature(FeatureFlag.EmailVerification)], component: SetPasswordJitComponent, data: { - pageTitle: "joinOrganization", - pageSubtitle: "finishJoiningThisOrganizationBySettingAMasterPassword", + pageTitle: { + key: "joinOrganization", + }, + pageSubtitle: { + key: "finishJoiningThisOrganizationBySettingAMasterPassword", + }, } satisfies AnonLayoutWrapperData, }, ], diff --git a/apps/web/src/app/auth/trial-initiation/complete-trial-initiation/resolver/free-trial-text.resolver.spec.ts b/apps/web/src/app/auth/trial-initiation/complete-trial-initiation/resolver/free-trial-text.resolver.spec.ts index 2c58d614c5..0b5c4f5e43 100644 --- a/apps/web/src/app/auth/trial-initiation/complete-trial-initiation/resolver/free-trial-text.resolver.spec.ts +++ b/apps/web/src/app/auth/trial-initiation/complete-trial-initiation/resolver/free-trial-text.resolver.spec.ts @@ -14,22 +14,24 @@ describe("freeTrialTextResolver", () => { it("shows password manager text", () => { route.queryParams.product = `${ProductType.PasswordManager}`; - expect(freeTrialTextResolver(route, routerStateSnapshot)).toBe( - "continueSettingUpFreeTrialPasswordManager", - ); + expect(freeTrialTextResolver(route, routerStateSnapshot)).toEqual({ + key: "continueSettingUpFreeTrialPasswordManager", + }); }); it("shows secret manager text", () => { route.queryParams.product = `${ProductType.SecretsManager}`; - expect(freeTrialTextResolver(route, routerStateSnapshot)).toBe( - "continueSettingUpFreeTrialSecretsManager", - ); + expect(freeTrialTextResolver(route, routerStateSnapshot)).toEqual({ + key: "continueSettingUpFreeTrialSecretsManager", + }); }); it("shows default text", () => { route.queryParams.product = `${ProductType.PasswordManager},${ProductType.SecretsManager}`; - expect(freeTrialTextResolver(route, routerStateSnapshot)).toBe("continueSettingUpFreeTrial"); + expect(freeTrialTextResolver(route, routerStateSnapshot)).toEqual({ + key: "continueSettingUpFreeTrial", + }); }); }); diff --git a/apps/web/src/app/auth/trial-initiation/complete-trial-initiation/resolver/free-trial-text.resolver.ts b/apps/web/src/app/auth/trial-initiation/complete-trial-initiation/resolver/free-trial-text.resolver.ts index cd23ef5ff7..28d61a6de1 100644 --- a/apps/web/src/app/auth/trial-initiation/complete-trial-initiation/resolver/free-trial-text.resolver.ts +++ b/apps/web/src/app/auth/trial-initiation/complete-trial-initiation/resolver/free-trial-text.resolver.ts @@ -1,10 +1,11 @@ import { ActivatedRouteSnapshot, ResolveFn } from "@angular/router"; import { ProductType } from "@bitwarden/common/billing/enums"; +import { Translation } from "@bitwarden/components"; -export const freeTrialTextResolver: ResolveFn = ( +export const freeTrialTextResolver: ResolveFn = ( route: ActivatedRouteSnapshot, -): string | null => { +): Translation | null => { const { product } = route.queryParams; const products: ProductType[] = (product ?? "").split(",").map((p: string) => parseInt(p)); @@ -13,10 +14,16 @@ export const freeTrialTextResolver: ResolveFn = ( switch (true) { case onlyPasswordManager: - return "continueSettingUpFreeTrialPasswordManager"; + return { + key: "continueSettingUpFreeTrialPasswordManager", + }; case onlySecretsManager: - return "continueSettingUpFreeTrialSecretsManager"; + return { + key: "continueSettingUpFreeTrialSecretsManager", + }; default: - return "continueSettingUpFreeTrial"; + return { + key: "continueSettingUpFreeTrial", + }; } }; diff --git a/apps/web/src/app/oss-routing.module.ts b/apps/web/src/app/oss-routing.module.ts index 18b9a30151..e7ae154ec4 100644 --- a/apps/web/src/app/oss-routing.module.ts +++ b/apps/web/src/app/oss-routing.module.ts @@ -228,7 +228,9 @@ const routes: Routes = [ path: "signup", canActivate: [canAccessFeature(FeatureFlag.EmailVerification), unauthGuardFn()], data: { - pageTitle: "createAccount", + pageTitle: { + key: "createAccount", + }, titleId: "createAccount", } satisfies RouteDataProperties & AnonLayoutWrapperData, children: [ @@ -250,8 +252,12 @@ const routes: Routes = [ path: "finish-signup", canActivate: [canAccessFeature(FeatureFlag.EmailVerification), unauthGuardFn()], data: { - pageTitle: "setAStrongPassword", - pageSubtitle: "finishCreatingYourAccountBySettingAPassword", + pageTitle: { + key: "setAStrongPassword", + }, + pageSubtitle: { + key: "finishCreatingYourAccountBySettingAPassword", + }, titleId: "setAStrongPassword", } satisfies RouteDataProperties & AnonLayoutWrapperData, children: [ @@ -264,7 +270,9 @@ const routes: Routes = [ { path: "send/:sendId/:key", data: { - pageTitle: "viewSend", + pageTitle: { + key: "viewSend", + }, showReadonlyHostname: true, } satisfies RouteDataProperties & AnonLayoutWrapperData, children: [ @@ -284,15 +292,21 @@ const routes: Routes = [ canActivate: [canAccessFeature(FeatureFlag.EmailVerification)], component: SetPasswordJitComponent, data: { - pageTitle: "joinOrganization", - pageSubtitle: "finishJoiningThisOrganizationBySettingAMasterPassword", + pageTitle: { + key: "joinOrganization", + }, + pageSubtitle: { + key: "finishJoiningThisOrganizationBySettingAMasterPassword", + }, } satisfies AnonLayoutWrapperData, }, { path: "signup-link-expired", canActivate: [canAccessFeature(FeatureFlag.EmailVerification), unauthGuardFn()], data: { - pageTitle: "expiredLink", + pageTitle: { + key: "expiredLink", + }, } satisfies AnonLayoutWrapperData, children: [ { @@ -308,7 +322,9 @@ const routes: Routes = [ path: "sso", canActivate: [unauthGuardFn()], data: { - pageTitle: "enterpriseSingleSignOn", + pageTitle: { + key: "enterpriseSingleSignOn", + }, titleId: "enterpriseSingleSignOn", } satisfies RouteDataProperties & AnonLayoutWrapperData, children: [ @@ -338,7 +354,9 @@ const routes: Routes = [ }, ], data: { - pageTitle: "logIn", + pageTitle: { + key: "logIn", + }, }, }, ...extensionRefreshSwap( @@ -354,7 +372,9 @@ const routes: Routes = [ }, ], data: { - pageTitle: "yourVaultIsLockedV2", + pageTitle: { + key: "yourVaultIsLockedV2", + }, pageIcon: LockIcon, showReadonlyHostname: true, } satisfies AnonLayoutWrapperData, @@ -369,7 +389,9 @@ const routes: Routes = [ }, ], data: { - pageTitle: "yourAccountIsLocked", + pageTitle: { + key: "yourAccountIsLocked", + }, pageIcon: LockIcon, showReadonlyHostname: true, } satisfies AnonLayoutWrapperData, @@ -390,7 +412,9 @@ const routes: Routes = [ }, ], data: { - pageTitle: "verifyIdentity", + pageTitle: { + key: "verifyIdentity", + }, } satisfies RouteDataProperties & AnonLayoutWrapperData, }, { @@ -408,7 +432,9 @@ const routes: Routes = [ }, ], data: { - pageTitle: "recoverAccountTwoStep", + pageTitle: { + key: "recoverAccountTwoStep", + }, titleId: "recoverAccountTwoStep", } satisfies RouteDataProperties & AnonLayoutWrapperData, }, @@ -416,7 +442,9 @@ const routes: Routes = [ path: "accept-emergency", canActivate: [deepLinkGuard()], data: { - pageTitle: "emergencyAccess", + pageTitle: { + key: "emergencyAccess", + }, titleId: "acceptEmergency", doNotSaveUrl: false, } satisfies RouteDataProperties & AnonLayoutWrapperData, @@ -434,7 +462,9 @@ const routes: Routes = [ path: "recover-delete", canActivate: [unauthGuardFn()], data: { - pageTitle: "deleteAccount", + pageTitle: { + key: "deleteAccount", + }, titleId: "deleteAccount", } satisfies RouteDataProperties & AnonLayoutWrapperData, children: [ @@ -453,7 +483,9 @@ const routes: Routes = [ path: "verify-recover-delete", canActivate: [unauthGuardFn()], data: { - pageTitle: "deleteAccount", + pageTitle: { + key: "deleteAccount", + }, titleId: "deleteAccount", } satisfies RouteDataProperties & AnonLayoutWrapperData, children: [ @@ -468,7 +500,9 @@ const routes: Routes = [ component: RemovePasswordComponent, canActivate: [authGuard], data: { - pageTitle: "removeMasterPassword", + pageTitle: { + key: "removeMasterPassword", + }, titleId: "removeMasterPassword", } satisfies RouteDataProperties & AnonLayoutWrapperData, }, diff --git a/apps/web/src/app/tools/send/access.component.ts b/apps/web/src/app/tools/send/access.component.ts index 07697ee8b3..32bd554baa 100644 --- a/apps/web/src/app/tools/send/access.component.ts +++ b/apps/web/src/app/tools/send/access.component.ts @@ -157,8 +157,8 @@ export class AccessComponent implements OnInit { if (this.creatorIdentifier != null) { this.layoutWrapperDataService.setAnonLayoutWrapperData({ pageSubtitle: { - subtitle: this.i18nService.t("sendAccessCreatorIdentifier", this.creatorIdentifier), - translate: false, + key: "sendAccessCreatorIdentifier", + placeholders: [this.creatorIdentifier], }, }); } diff --git a/libs/auth/src/angular/anon-layout/anon-layout-wrapper.component.ts b/libs/auth/src/angular/anon-layout/anon-layout-wrapper.component.ts index 5272342da1..2744633574 100644 --- a/libs/auth/src/angular/anon-layout/anon-layout-wrapper.component.ts +++ b/libs/auth/src/angular/anon-layout/anon-layout-wrapper.component.ts @@ -4,20 +4,34 @@ import { Subject, filter, switchMap, takeUntil, tap } from "rxjs"; import { AnonLayoutComponent } from "@bitwarden/auth/angular"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; -import { Icon } from "@bitwarden/components"; +import { Icon, Translation } from "@bitwarden/components"; import { AnonLayoutWrapperDataService } from "./anon-layout-wrapper-data.service"; export interface AnonLayoutWrapperData { - pageTitle?: string; - pageSubtitle?: - | string - | { - subtitle: string; - translate: boolean; - }; + /** + * The optional title of the page. + * If a string is provided, it will be presented as is (ex: Organization name) + * If a Translation object (supports placeholders) is provided, it will be translated + */ + pageTitle?: string | Translation; + /** + * The optional subtitle of the page. + * If a string is provided, it will be presented as is (ex: user's email) + * If a Translation object (supports placeholders) is provided, it will be translated + */ + pageSubtitle?: string | Translation; + /** + * The optional icon to display on the page. + */ pageIcon?: Icon; + /** + * Optional flag to either show the optional environment selector (false) or just a readonly hostname (true). + */ showReadonlyHostname?: boolean; + /** + * Optional flag to set the max-width of the page. Defaults to 'md' if not provided. + */ maxWidth?: "md" | "3xl"; } @@ -71,11 +85,11 @@ export class AnonLayoutWrapperComponent implements OnInit, OnDestroy { } if (firstChildRouteData["pageTitle"] !== undefined) { - this.pageTitle = this.i18nService.t(firstChildRouteData["pageTitle"]); + this.pageTitle = this.handleStringOrTranslation(firstChildRouteData["pageTitle"]); } if (firstChildRouteData["pageSubtitle"] !== undefined) { - this.pageSubtitle = this.i18nService.t(firstChildRouteData["pageSubtitle"]); + this.pageSubtitle = this.handleStringOrTranslation(firstChildRouteData["pageSubtitle"]); } if (firstChildRouteData["pageIcon"] !== undefined) { @@ -101,19 +115,11 @@ export class AnonLayoutWrapperComponent implements OnInit, OnDestroy { } if (data.pageTitle) { - this.pageTitle = this.i18nService.t(data.pageTitle); + this.pageTitle = this.handleStringOrTranslation(data.pageTitle); } if (data.pageSubtitle) { - // If you pass just a string, we translate it by default - if (typeof data.pageSubtitle === "string") { - this.pageSubtitle = this.i18nService.t(data.pageSubtitle); - } else { - // if you pass an object, you can specify if you want to translate it or not - this.pageSubtitle = data.pageSubtitle.translate - ? this.i18nService.t(data.pageSubtitle.subtitle) - : data.pageSubtitle.subtitle; - } + this.pageSubtitle = this.handleStringOrTranslation(data.pageSubtitle); } if (data.pageIcon) { @@ -129,6 +135,16 @@ export class AnonLayoutWrapperComponent implements OnInit, OnDestroy { this.changeDetectorRef.detectChanges(); } + private handleStringOrTranslation(value: string | Translation): string { + if (typeof value === "string") { + // If it's a string, return it as is + return value; + } + + // If it's a Translation object, translate it + return this.i18nService.t(value.key, ...(value.placeholders ?? [])); + } + private resetPageData() { this.pageTitle = null; this.pageSubtitle = null; diff --git a/libs/auth/src/angular/anon-layout/anon-layout-wrapper.stories.ts b/libs/auth/src/angular/anon-layout/anon-layout-wrapper.stories.ts index 87e26bd2df..b07504b7c8 100644 --- a/libs/auth/src/angular/anon-layout/anon-layout-wrapper.stories.ts +++ b/libs/auth/src/angular/anon-layout/anon-layout-wrapper.stories.ts @@ -163,17 +163,20 @@ export const DefaultContentExample: Story = { // Dynamic Content Example const initialData: AnonLayoutWrapperData = { - pageTitle: "setAStrongPassword", - pageSubtitle: "finishCreatingYourAccountBySettingAPassword", + pageTitle: { + key: "setAStrongPassword", + }, + pageSubtitle: { + key: "finishCreatingYourAccountBySettingAPassword", + }, pageIcon: LockIcon, }; const changedData: AnonLayoutWrapperData = { - pageTitle: "enterpriseSingleSignOn", - pageSubtitle: { - subtitle: "user@email.com (non-translated)", - translate: false, + pageTitle: { + key: "enterpriseSingleSignOn", }, + pageSubtitle: "user@email.com (non-translated)", pageIcon: RegistrationCheckEmailIcon, }; diff --git a/libs/auth/src/angular/lock/lock.component.ts b/libs/auth/src/angular/lock/lock.component.ts index 7bea14f221..33d318ac05 100644 --- a/libs/auth/src/angular/lock/lock.component.ts +++ b/libs/auth/src/angular/lock/lock.component.ts @@ -233,10 +233,7 @@ export class LockV2Component implements OnInit, OnDestroy { private setEmailAsPageSubtitle(email: string) { this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({ - pageSubtitle: { - subtitle: email, - translate: false, - }, + pageSubtitle: email, }); }