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"> {{ name }}
<p class="lead text-center mb-4">{{ "emergencyAccess" | i18n }}</p> </p>
<div class="card d-block"> <p bitTypography="body1">{{ "acceptEmergencyAccess" | i18n }}</p>
<div class="card-body"> <hr />
<p class="text-center"> <div class="tw-flex tw-gap-2">
{{ name }} <a
</p> bitButton
<p>{{ "acceptEmergencyAccess" | i18n }}</p> buttonType="primary"
<hr /> routerLink="/login"
<div class="d-flex"> [queryParams]="{ email: email }"
<a [block]="true"
routerLink="/login" >
[queryParams]="{ email: email }" {{ "logIn" | i18n }}
class="btn btn-primary btn-block" </a>
> <a
{{ "logIn" | i18n }} bitButton
</a> buttonType="primary"
<a routerLink="/register"
routerLink="/register" [queryParams]="{ email: email }"
[queryParams]="{ email: email }" [block]="true"
class="btn btn-primary btn-block ml-2 mt-0" >
> {{ "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",
},
],
},
], ],
}, },
{ {