mirror of
https://github.com/bitwarden/browser
synced 2026-01-04 17:43:39 +00:00
[PM-21600] Migrate account and security to standalone (#14762)
Migrates account and security settings components to standalone and removing them from the `LooseComponentsModule`.
This commit is contained in:
@@ -8,16 +8,27 @@ import { getUserId } from "@bitwarden/common/auth/services/account.service";
|
||||
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
||||
import { DialogService } from "@bitwarden/components";
|
||||
|
||||
import { HeaderModule } from "../../../layouts/header/header.module";
|
||||
import { SharedModule } from "../../../shared";
|
||||
import { PurgeVaultComponent } from "../../../vault/settings/purge-vault.component";
|
||||
|
||||
import { ChangeEmailComponent } from "./change-email.component";
|
||||
import { DangerZoneComponent } from "./danger-zone.component";
|
||||
import { DeauthorizeSessionsComponent } from "./deauthorize-sessions.component";
|
||||
import { DeleteAccountDialogComponent } from "./delete-account-dialog.component";
|
||||
import { ProfileComponent } from "./profile.component";
|
||||
import { SetAccountVerifyDevicesDialogComponent } from "./set-account-verify-devices-dialog.component";
|
||||
|
||||
@Component({
|
||||
selector: "app-account",
|
||||
templateUrl: "account.component.html",
|
||||
standalone: false,
|
||||
standalone: true,
|
||||
imports: [
|
||||
SharedModule,
|
||||
HeaderModule,
|
||||
ProfileComponent,
|
||||
ChangeEmailComponent,
|
||||
DangerZoneComponent,
|
||||
],
|
||||
})
|
||||
export class AccountComponent implements OnInit, OnDestroy {
|
||||
private destroy$ = new Subject<void>();
|
||||
|
||||
@@ -24,6 +24,10 @@ import {
|
||||
ToastService,
|
||||
} from "@bitwarden/components";
|
||||
|
||||
import { SharedModule } from "../../../shared";
|
||||
|
||||
import { SelectableAvatarComponent } from "./selectable-avatar.component";
|
||||
|
||||
type ChangeAvatarDialogData = {
|
||||
profile: ProfileResponse;
|
||||
};
|
||||
@@ -31,7 +35,8 @@ type ChangeAvatarDialogData = {
|
||||
@Component({
|
||||
templateUrl: "change-avatar-dialog.component.html",
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
standalone: false,
|
||||
standalone: true,
|
||||
imports: [SharedModule, SelectableAvatarComponent],
|
||||
})
|
||||
export class ChangeAvatarDialogComponent implements OnInit, OnDestroy {
|
||||
profile: ProfileResponse;
|
||||
|
||||
@@ -33,8 +33,7 @@ describe("ChangeEmailComponent", () => {
|
||||
accountService = mockAccountServiceWith("UserId" as UserId);
|
||||
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ChangeEmailComponent],
|
||||
imports: [ReactiveFormsModule, SharedModule],
|
||||
imports: [ReactiveFormsModule, SharedModule, ChangeEmailComponent],
|
||||
providers: [
|
||||
{ provide: AccountService, useValue: accountService },
|
||||
{ provide: ApiService, useValue: apiService },
|
||||
|
||||
@@ -14,10 +14,13 @@ import { UserId } from "@bitwarden/common/types/guid";
|
||||
import { ToastService } from "@bitwarden/components";
|
||||
import { KdfConfigService, KeyService } from "@bitwarden/key-management";
|
||||
|
||||
import { SharedModule } from "../../../shared";
|
||||
|
||||
@Component({
|
||||
selector: "app-change-email",
|
||||
templateUrl: "change-email.component.html",
|
||||
standalone: false,
|
||||
standalone: true,
|
||||
imports: [SharedModule],
|
||||
})
|
||||
export class ChangeEmailComponent implements OnInit {
|
||||
tokenSent = false;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
import { CommonModule } from "@angular/common";
|
||||
import { Component } from "@angular/core";
|
||||
|
||||
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
||||
import { TypographyModule } from "@bitwarden/components";
|
||||
import { I18nPipe } from "@bitwarden/ui-common";
|
||||
|
||||
/**
|
||||
* Component for the Danger Zone section of the Account/Organization Settings page.
|
||||
@@ -13,6 +13,6 @@ import { TypographyModule } from "@bitwarden/components";
|
||||
selector: "app-danger-zone",
|
||||
templateUrl: "danger-zone.component.html",
|
||||
standalone: true,
|
||||
imports: [TypographyModule, JslibModule, CommonModule],
|
||||
imports: [CommonModule, TypographyModule, I18nPipe],
|
||||
})
|
||||
export class DangerZoneComponent {}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Component } from "@angular/core";
|
||||
import { FormBuilder } from "@angular/forms";
|
||||
|
||||
import { UserVerificationFormInputComponent } from "@bitwarden/auth/angular";
|
||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||
import { UserVerificationService } from "@bitwarden/common/auth/abstractions/user-verification/user-verification.service.abstraction";
|
||||
import { Verification } from "@bitwarden/common/auth/types/verification";
|
||||
@@ -9,10 +10,12 @@ import { LogService } from "@bitwarden/common/platform/abstractions/log.service"
|
||||
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
||||
import { DialogService, ToastService } from "@bitwarden/components";
|
||||
|
||||
import { SharedModule } from "../../../shared";
|
||||
|
||||
@Component({
|
||||
selector: "app-deauthorize-sessions",
|
||||
templateUrl: "deauthorize-sessions.component.html",
|
||||
standalone: false,
|
||||
standalone: true,
|
||||
imports: [SharedModule, UserVerificationFormInputComponent],
|
||||
})
|
||||
export class DeauthorizeSessionsComponent {
|
||||
deauthForm = this.formBuilder.group({
|
||||
|
||||
@@ -3,15 +3,19 @@
|
||||
import { Component } from "@angular/core";
|
||||
import { FormBuilder } from "@angular/forms";
|
||||
|
||||
import { UserVerificationFormInputComponent } from "@bitwarden/auth/angular";
|
||||
import { AccountApiService } from "@bitwarden/common/auth/abstractions/account-api.service";
|
||||
import { Verification } from "@bitwarden/common/auth/types/verification";
|
||||
import { ErrorResponse } from "@bitwarden/common/models/response/error.response";
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { DialogRef, DialogService, ToastService } from "@bitwarden/components";
|
||||
|
||||
import { SharedModule } from "../../../shared";
|
||||
|
||||
@Component({
|
||||
templateUrl: "delete-account-dialog.component.html",
|
||||
standalone: false,
|
||||
standalone: true,
|
||||
imports: [SharedModule, UserVerificationFormInputComponent],
|
||||
})
|
||||
export class DeleteAccountDialogComponent {
|
||||
deleteForm = this.formBuilder.group({
|
||||
|
||||
@@ -14,12 +14,17 @@ import { ProfileResponse } from "@bitwarden/common/models/response/profile.respo
|
||||
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||
import { DialogService, ToastService } from "@bitwarden/components";
|
||||
|
||||
import { DynamicAvatarComponent } from "../../../components/dynamic-avatar.component";
|
||||
import { SharedModule } from "../../../shared";
|
||||
import { AccountFingerprintComponent } from "../../../shared/components/account-fingerprint/account-fingerprint.component";
|
||||
|
||||
import { ChangeAvatarDialogComponent } from "./change-avatar-dialog.component";
|
||||
|
||||
@Component({
|
||||
selector: "app-profile",
|
||||
templateUrl: "profile.component.html",
|
||||
standalone: false,
|
||||
standalone: true,
|
||||
imports: [SharedModule, DynamicAvatarComponent, AccountFingerprintComponent],
|
||||
})
|
||||
export class ProfileComponent implements OnInit, OnDestroy {
|
||||
loading = true;
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
// FIXME: Update this file to be type safe and remove this and next line
|
||||
// @ts-strict-ignore
|
||||
import { NgClass } from "@angular/common";
|
||||
import { Component, EventEmitter, Input, Output } from "@angular/core";
|
||||
|
||||
import { AvatarModule } from "@bitwarden/components";
|
||||
|
||||
@Component({
|
||||
selector: "selectable-avatar",
|
||||
template: `<span
|
||||
@@ -24,7 +27,8 @@ import { Component, EventEmitter, Input, Output } from "@angular/core";
|
||||
>
|
||||
</bit-avatar>
|
||||
</span>`,
|
||||
standalone: false,
|
||||
standalone: true,
|
||||
imports: [NgClass, AvatarModule],
|
||||
})
|
||||
export class SelectableAvatarComponent {
|
||||
@Input() id: string;
|
||||
|
||||
@@ -3,12 +3,15 @@
|
||||
import { Component, Inject } from "@angular/core";
|
||||
import { FormBuilder, Validators } from "@angular/forms";
|
||||
|
||||
import { UserVerificationFormInputComponent } from "@bitwarden/auth/angular";
|
||||
import { UserVerificationService } from "@bitwarden/common/auth/abstractions/user-verification/user-verification.service.abstraction";
|
||||
import { SecretVerificationRequest } from "@bitwarden/common/auth/models/request/secret-verification.request";
|
||||
import { ApiKeyResponse } from "@bitwarden/common/auth/models/response/api-key.response";
|
||||
import { Verification } from "@bitwarden/common/auth/types/verification";
|
||||
import { DIALOG_DATA, DialogConfig, DialogService } from "@bitwarden/components";
|
||||
|
||||
import { SharedModule } from "../../../shared";
|
||||
|
||||
export type ApiKeyDialogData = {
|
||||
keyType: string;
|
||||
isRotation?: boolean;
|
||||
@@ -21,9 +24,9 @@ export type ApiKeyDialogData = {
|
||||
apiKeyDescription: string;
|
||||
};
|
||||
@Component({
|
||||
selector: "app-api-key",
|
||||
templateUrl: "api-key.component.html",
|
||||
standalone: false,
|
||||
standalone: true,
|
||||
imports: [SharedModule, UserVerificationFormInputComponent],
|
||||
})
|
||||
export class ApiKeyComponent {
|
||||
clientId: string;
|
||||
|
||||
@@ -8,12 +8,15 @@ import { AccountService } from "@bitwarden/common/auth/abstractions/account.serv
|
||||
import { UserVerificationService } from "@bitwarden/common/auth/abstractions/user-verification/user-verification.service.abstraction";
|
||||
import { DialogService } from "@bitwarden/components";
|
||||
|
||||
import { SharedModule } from "../../../shared";
|
||||
|
||||
import { ApiKeyComponent } from "./api-key.component";
|
||||
import { ChangeKdfModule } from "./change-kdf/change-kdf.module";
|
||||
|
||||
@Component({
|
||||
selector: "app-security-keys",
|
||||
templateUrl: "security-keys.component.html",
|
||||
standalone: false,
|
||||
standalone: true,
|
||||
imports: [SharedModule, ChangeKdfModule],
|
||||
})
|
||||
export class SecurityKeysComponent implements OnInit {
|
||||
showChangeKdf = true;
|
||||
|
||||
@@ -4,10 +4,13 @@ import { UserVerificationService } from "@bitwarden/common/auth/abstractions/use
|
||||
import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum";
|
||||
import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service";
|
||||
|
||||
import { HeaderModule } from "../../../layouts/header/header.module";
|
||||
import { SharedModule } from "../../../shared";
|
||||
|
||||
@Component({
|
||||
selector: "app-security",
|
||||
templateUrl: "security.component.html",
|
||||
standalone: false,
|
||||
standalone: true,
|
||||
imports: [SharedModule, HeaderModule],
|
||||
})
|
||||
export class SecurityComponent implements OnInit {
|
||||
showChangePassword = true;
|
||||
|
||||
Reference in New Issue
Block a user