1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 02:33:46 +00:00

[PM-7900] Login Credentials and Autofill Browser V2 View sections (#10417)

* Added sections for Login Credentials and Autofill Options.
This commit is contained in:
Jason Ng
2024-08-08 13:52:45 -04:00
committed by GitHub
parent ad3c680f2c
commit bca619d0a4
11 changed files with 289 additions and 6 deletions

View File

@@ -0,0 +1,30 @@
<bit-section>
<bit-section-header>
<h2 bitTypography="h6">{{ "autofillOptions" | i18n }}</h2>
</bit-section-header>
<bit-card>
<ng-container *ngFor="let login of loginUris; let last = last">
<bit-form-field [disableMargin]="last" data-testid="autofill-view-list">
<bit-label>
{{ "website" | i18n }}
</bit-label>
<input readonly bitInput type="text" [value]="login.launchUri" aria-readonly="true" />
<button
bitIconButton="bwi-external-link"
bitSuffix
type="button"
(click)="openWebsite(login.launchUri)"
></button>
<button
bitIconButton="bwi-clone"
bitSuffix
type="button"
[appCopyClick]="login.launchUri"
[valueLabel]="'website' | i18n"
showToast
[appA11yTitle]="'copyValue' | i18n"
></button>
</bit-form-field>
</ng-container>
</bit-card>
</bit-section>

View File

@@ -0,0 +1,40 @@
import { CommonModule } from "@angular/common";
import { Component, Input } from "@angular/core";
import { JslibModule } from "@bitwarden/angular/jslib.module";
import { LoginUriView } from "@bitwarden/common/vault/models/view/login-uri.view";
import {
CardComponent,
FormFieldModule,
SectionComponent,
SectionHeaderComponent,
TypographyModule,
IconButtonModule,
} from "@bitwarden/components";
import { TotpCaptureService } from "../../cipher-form";
@Component({
selector: "app-autofill-options-view",
templateUrl: "autofill-options-view.component.html",
standalone: true,
imports: [
CommonModule,
JslibModule,
CardComponent,
SectionComponent,
SectionHeaderComponent,
TypographyModule,
FormFieldModule,
IconButtonModule,
],
})
export class AutofillOptionsViewComponent {
@Input() loginUris: LoginUriView[];
constructor(private totpCaptureService: TotpCaptureService) {}
async openWebsite(selectedUri: string) {
await this.totpCaptureService.openAutofillNewTab(selectedUri);
}
}