1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

[PM-5165][PM-8645] Migrate password strength component (#9912)

* Create standalone password-strength-v2 component

* Add deprecation notice to old component

* PM-8645: Use new password-strength component on export

* Remove unneccessary variable

* Remove setPasswordScoreText method

* Rename passwordStrengthResult to passwordStrengthScore and assign proper type

* Add missing types

* Document component Inputs/Outputs

* Add unit tests

---------

Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
This commit is contained in:
Daniel James Smith
2024-07-10 16:59:17 +02:00
committed by GitHub
parent f446c3b454
commit 33de685b40
6 changed files with 214 additions and 3 deletions

View File

@@ -76,7 +76,8 @@
></button>
<bit-hint>{{ "exportPasswordDescription" | i18n }}</bit-hint>
</bit-form-field>
<app-password-strength [password]="filePassword" [showText]="true"> </app-password-strength>
<tools-password-strength [password]="filePassword" [showText]="true">
</tools-password-strength>
</div>
<bit-form-field>
<bit-label>{{ "confirmFilePassword" | i18n }}</bit-label>

View File

@@ -12,7 +12,7 @@ import { ReactiveFormsModule, UntypedFormBuilder, Validators } from "@angular/fo
import { map, merge, Observable, startWith, Subject, takeUntil } from "rxjs";
import { JslibModule } from "@bitwarden/angular/jslib.module";
import { PasswordStrengthComponent } from "@bitwarden/angular/tools/password-strength/password-strength.component";
import { PasswordStrengthV2Component } from "@bitwarden/angular/tools/password-strength/password-strength-v2.component";
import { UserVerificationDialogComponent } from "@bitwarden/auth/angular";
import { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.service";
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
@@ -58,6 +58,7 @@ import { ExportScopeCalloutComponent } from "./export-scope-callout.component";
RadioButtonModule,
ExportScopeCalloutComponent,
UserVerificationDialogComponent,
PasswordStrengthV2Component,
],
})
export class ExportComponent implements OnInit, OnDestroy {
@@ -110,7 +111,7 @@ export class ExportComponent implements OnInit, OnDestroy {
@Output()
onSuccessfulExport = new EventEmitter<string>();
@ViewChild(PasswordStrengthComponent) passwordStrengthComponent: PasswordStrengthComponent;
@ViewChild(PasswordStrengthV2Component) passwordStrengthComponent: PasswordStrengthV2Component;
encryptedExportType = EncryptedExportType;
protected showFilePassword: boolean;