mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-28 17:27:50 +01:00
PM-10982 add passkey field in login view. add testid for qa (#10634)
This commit is contained in:
parent
404d514e53
commit
887d1924a3
@ -8,12 +8,20 @@
|
|||||||
<bit-label>
|
<bit-label>
|
||||||
{{ "website" | i18n }}
|
{{ "website" | i18n }}
|
||||||
</bit-label>
|
</bit-label>
|
||||||
<input readonly bitInput type="text" [value]="login.hostOrUri" aria-readonly="true" />
|
<input
|
||||||
|
readonly
|
||||||
|
bitInput
|
||||||
|
type="text"
|
||||||
|
[value]="login.hostOrUri"
|
||||||
|
aria-readonly="true"
|
||||||
|
data-testid="login-website"
|
||||||
|
/>
|
||||||
<button
|
<button
|
||||||
bitIconButton="bwi-external-link"
|
bitIconButton="bwi-external-link"
|
||||||
bitSuffix
|
bitSuffix
|
||||||
type="button"
|
type="button"
|
||||||
(click)="openWebsite(login.launchUri)"
|
(click)="openWebsite(login.launchUri)"
|
||||||
|
data-testid="launch-website"
|
||||||
></button>
|
></button>
|
||||||
<button
|
<button
|
||||||
bitIconButton="bwi-clone"
|
bitIconButton="bwi-clone"
|
||||||
@ -23,6 +31,7 @@
|
|||||||
[valueLabel]="'website' | i18n"
|
[valueLabel]="'website' | i18n"
|
||||||
showToast
|
showToast
|
||||||
[appA11yTitle]="'copyValue' | i18n"
|
[appA11yTitle]="'copyValue' | i18n"
|
||||||
|
data-testid="copy-website"
|
||||||
></button>
|
></button>
|
||||||
</bit-form-field>
|
</bit-form-field>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
[valueLabel]="'username' | i18n"
|
[valueLabel]="'username' | i18n"
|
||||||
showToast
|
showToast
|
||||||
[appA11yTitle]="'copyValue' | i18n"
|
[appA11yTitle]="'copyValue' | i18n"
|
||||||
data-testid="toggle-username"
|
data-testid="copy-username"
|
||||||
></button>
|
></button>
|
||||||
</bit-form-field>
|
</bit-form-field>
|
||||||
<bit-form-field *ngIf="cipher.login.password">
|
<bit-form-field *ngIf="cipher.login.password">
|
||||||
@ -74,6 +74,17 @@
|
|||||||
[showCount]="true"
|
[showCount]="true"
|
||||||
></bit-color-password>
|
></bit-color-password>
|
||||||
</div>
|
</div>
|
||||||
|
<bit-form-field *ngIf="cipher.login?.fido2Credentials?.length > 0">
|
||||||
|
<bit-label>{{ "typePasskey" | i18n }} </bit-label>
|
||||||
|
<input
|
||||||
|
readonly
|
||||||
|
bitInput
|
||||||
|
type="text"
|
||||||
|
[value]="fido2CredentialCreationDateValue"
|
||||||
|
aria-readonly="true"
|
||||||
|
data-testid="login-passkey"
|
||||||
|
/>
|
||||||
|
</bit-form-field>
|
||||||
<bit-form-field *ngIf="cipher.login.totp">
|
<bit-form-field *ngIf="cipher.login.totp">
|
||||||
<bit-label
|
<bit-label
|
||||||
>{{ "verificationCodeTotp" | i18n }}
|
>{{ "verificationCodeTotp" | i18n }}
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import { CommonModule } from "@angular/common";
|
import { CommonModule, DatePipe } from "@angular/common";
|
||||||
import { Component, Input } from "@angular/core";
|
import { Component, inject, Input } from "@angular/core";
|
||||||
import { Router } from "@angular/router";
|
import { Router } from "@angular/router";
|
||||||
import { Observable, shareReplay } from "rxjs";
|
import { Observable, shareReplay } from "rxjs";
|
||||||
|
|
||||||
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
import { JslibModule } from "@bitwarden/angular/jslib.module";
|
||||||
import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions";
|
import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions";
|
||||||
|
import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service";
|
||||||
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view";
|
||||||
import {
|
import {
|
||||||
CardComponent,
|
CardComponent,
|
||||||
@ -47,12 +48,23 @@ export class LoginCredentialsViewComponent {
|
|||||||
showPasswordCount: boolean = false;
|
showPasswordCount: boolean = false;
|
||||||
passwordRevealed: boolean = false;
|
passwordRevealed: boolean = false;
|
||||||
totpCopyCode: string;
|
totpCopyCode: string;
|
||||||
|
private datePipe = inject(DatePipe);
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private billingAccountProfileStateService: BillingAccountProfileStateService,
|
private billingAccountProfileStateService: BillingAccountProfileStateService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
|
private i18nService: I18nService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
|
get fido2CredentialCreationDateValue(): string {
|
||||||
|
const dateCreated = this.i18nService.t("dateCreated");
|
||||||
|
const creationDate = this.datePipe.transform(
|
||||||
|
this.cipher.login.fido2Credentials[0]?.creationDate,
|
||||||
|
"short",
|
||||||
|
);
|
||||||
|
return `${dateCreated} ${creationDate}`;
|
||||||
|
}
|
||||||
|
|
||||||
async getPremium() {
|
async getPremium() {
|
||||||
await this.router.navigate(["/premium"]);
|
await this.router.navigate(["/premium"]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user