[PM-4952] Migrate-remove-password-component (#9305)

* migrating remove-password component

* add loading state

---------

Co-authored-by: rr-bw <102181210+rr-bw@users.noreply.github.com>
This commit is contained in:
vinith-kovan 2024-06-10 19:42:10 +05:30 committed by GitHub
parent eef1e511b5
commit b49b6b370f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 58 additions and 77 deletions

View File

@ -1,55 +1,33 @@
<div class="mt-5 d-flex justify-content-center" *ngIf="loading"> <div *ngIf="loading" class="tw-text-center">
<div> <i
<img class="mb-4 logo logo-themed" alt="Bitwarden" /> class="bwi bwi-spinner bwi-spin bwi-2x tw-text-muted"
<p class="text-center"> title="{{ 'loading' | i18n }}"
<i aria-hidden="true"
class="bwi bwi-spinner bwi-spin bwi-2x text-muted" ></i>
title="{{ 'loading' | i18n }}" <span class="tw-sr-only">{{ "loading" | i18n }}</span>
aria-hidden="true"
></i>
<span class="sr-only">{{ "loading" | i18n }}</span>
</p>
</div>
</div> </div>
<div class="container" *ngIf="!loading">
<div class="row justify-content-md-center mt-5">
<div class="col-5">
<p class="lead text-center mb-4">{{ "removeMasterPassword" | i18n }}</p>
<hr />
<div class="card d-block">
<div class="card-body">
<p>{{ "convertOrganizationEncryptionDesc" | i18n: organization.name }}</p>
<button <div *ngIf="!loading">
type="button" <p>{{ "convertOrganizationEncryptionDesc" | i18n: organization.name }}</p>
class="btn btn-primary btn-block"
(click)="convert()" <button
[disabled]="actionPromise" bitButton
> type="button"
<i buttonType="primary"
class="bwi bwi-spinner bwi-spin" class="tw-w-full"
title="{{ 'loading' | i18n }}" [bitAction]="convert"
aria-hidden="true" [block]="true"
*ngIf="continuing" >
></i> {{ "removeMasterPassword" | i18n }}
{{ "removeMasterPassword" | i18n }} </button>
</button> <button
<button bitButton
type="button" type="button"
class="btn btn-outline-secondary btn-block" buttonType="secondary"
(click)="leave()" class="tw-w-full"
[disabled]="actionPromise" [bitAction]="leave"
> [block]="true"
<i >
class="bwi bwi-spinner bwi-spin" {{ "leaveOrganization" | i18n }}
title="{{ 'loading' | i18n }}" </button>
aria-hidden="true"
*ngIf="leaving"
></i>
{{ "leaveOrganization" | i18n }}
</button>
</div>
</div>
</div>
</div>
</div> </div>

View File

@ -176,12 +176,6 @@ const routes: Routes = [
canActivate: [AuthGuard], canActivate: [AuthGuard],
data: { titleId: "updatePassword" } satisfies DataProperties, data: { titleId: "updatePassword" } satisfies DataProperties,
}, },
{
path: "remove-password",
component: RemovePasswordComponent,
canActivate: [AuthGuard],
data: { titleId: "removeMasterPassword" } satisfies DataProperties,
},
{ {
path: "migrate-legacy-encryption", path: "migrate-legacy-encryption",
loadComponent: () => loadComponent: () =>
@ -195,25 +189,6 @@ const routes: Routes = [
path: "", path: "",
component: AnonLayoutWrapperComponent, component: AnonLayoutWrapperComponent,
children: [ children: [
{
path: "recover-2fa",
canActivate: [unauthGuardFn()],
children: [
{
path: "",
component: RecoverTwoFactorComponent,
},
{
path: "",
component: EnvironmentSelectorComponent,
outlet: "environment-selector",
},
],
data: {
pageTitle: "recoverAccountTwoStep",
titleId: "recoverAccountTwoStep",
} satisfies DataProperties & AnonLayoutWrapperData,
},
{ {
path: "accept-emergency", path: "accept-emergency",
canActivate: [deepLinkGuard()], canActivate: [deepLinkGuard()],
@ -237,6 +212,34 @@ const routes: Routes = [
}, },
], ],
}, },
{
path: "recover-2fa",
canActivate: [unauthGuardFn()],
children: [
{
path: "",
component: RecoverTwoFactorComponent,
},
{
path: "",
component: EnvironmentSelectorComponent,
outlet: "environment-selector",
},
],
data: {
pageTitle: "recoverAccountTwoStep",
titleId: "recoverAccountTwoStep",
} satisfies DataProperties & AnonLayoutWrapperData,
},
{
path: "remove-password",
component: RemovePasswordComponent,
canActivate: [AuthGuard],
data: {
pageTitle: "removeMasterPassword",
titleId: "removeMasterPassword",
} satisfies DataProperties & AnonLayoutWrapperData,
},
], ],
}, },
{ {