1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-23 21:31:29 +01:00

add dynamic anon-layout wrapper data

This commit is contained in:
rr-bw 2024-09-12 11:39:43 -07:00
parent 8696330245
commit 6ffaeae331
No known key found for this signature in database
GPG Key ID: 3FA13C3ADEE51D5D
4 changed files with 33 additions and 1 deletions

View File

@ -803,6 +803,9 @@
"useSingleSignOn": {
"message": "Use single sign-on"
},
"welcomeBack": {
"message": "Welcome back"
},
"invalidPasskeyPleaseTryAgain": {
"message": "Invalid Passkey. Please try again."
},

View File

@ -1,4 +1,7 @@
export * from "./bitwarden-logo.icon";
export * from "./bitwarden-shield.icon";
export * from "./lock.icon";
export * from "./registration-check-email.icon";
export * from "./registration-expired-link.icon";
export * from "./user-verification-biometrics-fingerprint.icon";
export * from "./wave.icon";

View File

@ -0,0 +1,11 @@
import { svgIcon } from "@bitwarden/components";
export const WaveIcon = svgIcon`
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="98" fill="none">
<path class="tw-stroke-text-headers" stroke-linejoin="round" stroke-width="2" d="M38.604 48.08c.187-.341.364-.688.565-1.022 4.409-7.312 8.826-14.62 13.228-21.936 2.132-3.54.317-7.806-3.688-8.72-2.335-.533-4.775.562-6.204 2.844-2.923 4.673-5.823 9.362-8.731 14.043-2.2 3.542-4.385 7.094-6.61 10.62-1.844 2.926-4.231 5.315-7.246 7.035-1.851 1.057-2.841.543-3.121-1.554-.549-4.105-1.185-8.194-2.446-12.155-1.625-5.1-6.98-7.558-11.908-5.469-1.135.482-1.362.949-1.092 2.137.703 3.086 1.53 6.152 2.061 9.27.789 4.638.402 9.275-.4 13.894a90.853 90.853 0 0 0-1.353 14.404c-.062 4.798 1.476 8.947 4.825 12.337 3.654 3.702 7.422 7.313 11.932 9.989 7.128 4.23 14.349 4.162 21.606.282 3.89-2.08 7.272-4.84 10.478-7.827 8.69-8.101 5.227-5.375 16.07-11.488 4.702-2.65 9.436-5.242 14.152-7.863 2.707-1.505 3.593-4.521 2.145-7.276-1.399-2.666-4.426-3.627-7.186-2.228-6.594 3.345-13.173 6.717-19.76 10.076-.325.165-.651.323-1.085.344.372-.304.734-.619 1.116-.91 7.578-5.801 15.158-11.601 22.737-17.401 1.86-1.425 2.714-3.3 2.344-5.624-.359-2.26-1.707-3.769-3.872-4.483-1.898-.626-3.629-.245-5.258.928-7.792 5.607-15.604 11.188-23.41 16.776-.274.196-.55.389-.974.452.234-.278.454-.572.705-.835 7.24-7.632 14.493-15.25 21.72-22.893 3.355-3.549 1.622-9.313-3.127-10.382-2.274-.512-4.275.06-5.935 1.796-7.056 7.373-14.134 14.721-21.197 22.087-.294.306-.51.686-.765 1.031-.105-.093-.212-.185-.316-.278Z"/>
<path class="tw-stroke-text-headers" stroke-linecap="round" stroke-width="2" d="M39.237 1.496c-13.4 0-24.262 10.863-24.262 24.262"/>
<path class="tw-stroke-info-600" stroke-linecap="round" d="M36.57 7.895c-8.393 0-15.196 6.804-15.196 15.197"/>
<path class="tw-stroke-text-headers" stroke-linecap="round" stroke-width="2" d="M74.49 92.027c13.4 0 24.262-10.863 24.262-24.262"/>
<path class="tw-stroke-info-600" stroke-linecap="round" d="M77.157 85.628c8.394 0 15.197-6.804 15.197-15.197" />
</svg>
`;

View File

@ -39,6 +39,9 @@ import {
ToastService,
} from "@bitwarden/components";
import { AnonLayoutWrapperDataService } from "../anon-layout/anon-layout-wrapper-data.service";
import { WaveIcon } from "../icons";
import { LoginService } from "./login.service";
const BroadcasterSubscriptionId = "LoginComponent";
@ -68,6 +71,7 @@ export class LoginComponentV2 implements OnInit, OnDestroy {
@Input() captchaSiteKey: string = null;
private destroy$ = new Subject<void>();
readonly Icons = { WaveIcon };
captcha: CaptchaIFrame;
captchaToken: string = null;
@ -79,7 +83,7 @@ export class LoginComponentV2 implements OnInit, OnDestroy {
validatedEmail = false;
formGroup = this.formBuilder.group({
email: ["", { validators: [Validators.required, Validators.email], updateOn: "submit" }],
email: ["", [Validators.required, Validators.email]],
masterPassword: [
"",
[Validators.required, Validators.minLength(Utils.originalMinimumPasswordLength)],
@ -111,6 +115,7 @@ export class LoginComponentV2 implements OnInit, OnDestroy {
constructor(
private activatedRoute: ActivatedRoute,
private anonLayoutWrapperDataService: AnonLayoutWrapperDataService,
private appIdService: AppIdService,
private broadcasterService: BroadcasterService,
private devicesApiService: DevicesApiServiceAbstraction,
@ -330,6 +335,16 @@ export class LoginComponentV2 implements OnInit, OnDestroy {
if (emailValid) {
this.toggleValidateEmail(true);
await this.getLoginWithDevice(this.loggedEmail);
this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({
pageTitle: "welcomeBack",
pageSubtitle: {
// TODO-rr-bw: add an icon that takes the user back
subtitle: `(todo: back btn) ${this.loggedEmail}`,
translate: false,
},
pageIcon: this.Icons.WaveIcon,
});
}
}