1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-02-18 01:41:27 +01:00

[PM-3560] Adding the password complexity component to the password protected va… (#6936)

* Adding the password complexity component to the password protected valut export

* Removing the zxcvbn import as the component handles the strength check
This commit is contained in:
ttalty 2023-11-28 14:44:06 -05:00 committed by GitHub
parent a342ce5d9a
commit ed865a6747
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 19 deletions

View File

@ -86,24 +86,29 @@
<br /> <br />
<ng-container *ngIf="fileEncryptionType == encryptedExportType.FileEncrypted"> <ng-container *ngIf="fileEncryptionType == encryptedExportType.FileEncrypted">
<bit-form-field> <div class="tw-mb-3">
<bit-label>{{ "filePassword" | i18n }}</bit-label> <bit-form-field>
<input <bit-label>{{ "filePassword" | i18n }}</bit-label>
bitInput <input
type="password" bitInput
id="filePassword" type="password"
formControlName="filePassword" id="filePassword"
name="password" formControlName="filePassword"
/> name="password"
<button />
type="button" <button
bitSuffix type="button"
bitIconButton bitSuffix
bitPasswordInputToggle bitIconButton
[(toggled)]="showFilePassword" bitPasswordInputToggle
></button> [(toggled)]="showFilePassword"
<bit-hint>{{ "exportPasswordDescription" | i18n }}</bit-hint> ></button>
</bit-form-field> <bit-hint>{{ "exportPasswordDescription" | i18n }}</bit-hint>
</bit-form-field>
<app-password-strength [password]="filePassword" [showText]="true">
</app-password-strength>
</div>
<bit-form-field> <bit-form-field>
<bit-label>{{ "confirmFilePassword" | i18n }}</bit-label> <bit-label>{{ "confirmFilePassword" | i18n }}</bit-label>
<input <input

View File

@ -1,4 +1,4 @@
import { Directive, EventEmitter, OnDestroy, OnInit, Output } from "@angular/core"; import { Directive, EventEmitter, OnDestroy, OnInit, Output, ViewChild } from "@angular/core";
import { UntypedFormBuilder, Validators } from "@angular/forms"; import { UntypedFormBuilder, Validators } from "@angular/forms";
import { merge, startWith, Subject, takeUntil } from "rxjs"; import { merge, startWith, Subject, takeUntil } from "rxjs";
@ -16,10 +16,14 @@ import { EncryptedExportType } from "@bitwarden/common/tools/enums/encrypted-exp
import { DialogService } from "@bitwarden/components"; import { DialogService } from "@bitwarden/components";
import { VaultExportServiceAbstraction } from "@bitwarden/exporter/vault-export"; import { VaultExportServiceAbstraction } from "@bitwarden/exporter/vault-export";
import { PasswordStrengthComponent } from "../../../shared/components/password-strength/password-strength.component";
@Directive() @Directive()
export class ExportComponent implements OnInit, OnDestroy { export class ExportComponent implements OnInit, OnDestroy {
@Output() onSaved = new EventEmitter(); @Output() onSaved = new EventEmitter();
@ViewChild(PasswordStrengthComponent) passwordStrengthComponent: PasswordStrengthComponent;
filePasswordValue: string = null;
formPromise: Promise<string>; formPromise: Promise<string>;
private _disabledByPolicy = false; private _disabledByPolicy = false;