PM-1938 Migrate Accept Emergency Component (#9177)

* PM-1938 Migrate Accept Emergency Component

* PM-1938 Updated OSS routing module

* PM-1938 Updated anon layout path and removed width

* PM-1938 Addressed review comments

* PM-1938 - Move canActivate up a level.

* PM-1938 - Consolidate routing after merging in main.

---------

Co-authored-by: Jared Snider <116684653+JaredSnider-Bitwarden@users.noreply.github.com>
Co-authored-by: Jared Snider <jsnider@bitwarden.com>
This commit is contained in:
KiruthigaManivannan 2024-06-06 18:45:17 +05:30 committed by GitHub
parent d8a86cdb7e
commit f2bd16a0c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 52 additions and 44 deletions

View File

@ -1,45 +1,39 @@
<div class="mt-5 d-flex justify-content-center" *ngIf="loading"> <div class="tw-mt-5 tw-flex tw-justify-center" *ngIf="loading">
<div> <div>
<img class="mb-4 logo logo-themed" alt="Bitwarden" /> <p class="tw-text-center">
<p class="text-center">
<i <i
class="bwi bwi-spinner bwi-spin bwi-2x text-muted" class="bwi bwi-spinner bwi-spin bwi-2x tw-text-muted"
title="{{ 'loading' | i18n }}" title="{{ 'loading' | i18n }}"
aria-hidden="true" aria-hidden="true"
></i> ></i>
<span class="sr-only">{{ "loading" | i18n }}</span> <span class="tw-sr-only">{{ "loading" | i18n }}</span>
</p> </p>
</div> </div>
</div> </div>
<div class="container" *ngIf="!loading && !authed"> <div *ngIf="!loading && !authed">
<div class="row justify-content-md-center mt-5"> <p bitTypography="body1" class="tw-text-center">
<div class="col-5">
<p class="lead text-center mb-4">{{ "emergencyAccess" | i18n }}</p>
<div class="card d-block">
<div class="card-body">
<p class="text-center">
{{ name }} {{ name }}
</p> </p>
<p>{{ "acceptEmergencyAccess" | i18n }}</p> <p bitTypography="body1">{{ "acceptEmergencyAccess" | i18n }}</p>
<hr /> <hr />
<div class="d-flex"> <div class="tw-flex tw-gap-2">
<a <a
bitButton
buttonType="primary"
routerLink="/login" routerLink="/login"
[queryParams]="{ email: email }" [queryParams]="{ email: email }"
class="btn btn-primary btn-block" [block]="true"
> >
{{ "logIn" | i18n }} {{ "logIn" | i18n }}
</a> </a>
<a <a
bitButton
buttonType="primary"
routerLink="/register" routerLink="/register"
[queryParams]="{ email: email }" [queryParams]="{ email: email }"
class="btn btn-primary btn-block ml-2 mt-0" [block]="true"
> >
{{ "createAccount" | i18n }} {{ "createAccount" | i18n }}
</a> </a>
</div> </div>
</div> </div>
</div>
</div>
</div>
</div>

View File

@ -128,15 +128,6 @@ const routes: Routes = [
component: AcceptOrganizationComponent, component: AcceptOrganizationComponent,
data: { titleId: "joinOrganization", doNotSaveUrl: false } satisfies DataProperties, data: { titleId: "joinOrganization", doNotSaveUrl: false } satisfies DataProperties,
}, },
{
path: "accept-emergency",
canActivate: [deepLinkGuard()],
data: { titleId: "acceptEmergency", doNotSaveUrl: false } satisfies DataProperties,
loadComponent: () =>
import("./auth/emergency-access/accept/accept-emergency.component").then(
(mod) => mod.AcceptEmergencyComponent,
),
},
{ {
path: "accept-families-for-enterprise", path: "accept-families-for-enterprise",
component: AcceptFamilySponsorshipComponent, component: AcceptFamilySponsorshipComponent,
@ -223,6 +214,29 @@ const routes: Routes = [
titleId: "recoverAccountTwoStep", titleId: "recoverAccountTwoStep",
} satisfies DataProperties & AnonLayoutWrapperData, } satisfies DataProperties & AnonLayoutWrapperData,
}, },
{
path: "accept-emergency",
canActivate: [deepLinkGuard()],
children: [
{
path: "",
data: {
pageTitle: "emergencyAccess",
titleId: "acceptEmergency",
doNotSaveUrl: false,
} satisfies DataProperties & AnonLayoutWrapperData,
loadComponent: () =>
import("./auth/emergency-access/accept/accept-emergency.component").then(
(mod) => mod.AcceptEmergencyComponent,
),
},
{
path: "",
component: EnvironmentSelectorComponent,
outlet: "environment-selector",
},
],
},
], ],
}, },
{ {