1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 05:13:29 +00:00

[PM-15200] add "generated credential" screen reader notification (#12877)

replaces website$ dependency with `GenerateRequest`
This commit is contained in:
✨ Audrey ✨
2025-01-24 14:44:42 -05:00
committed by GitHub
parent 9a5ebf94a0
commit 1fc20b55f2
21 changed files with 310 additions and 295 deletions

View File

@@ -4,7 +4,7 @@ import { CommonModule } from "@angular/common";
import { Component, Input, OnInit } from "@angular/core";
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
import { FormBuilder, ReactiveFormsModule } from "@angular/forms";
import { firstValueFrom, map, switchMap } from "rxjs";
import { BehaviorSubject, firstValueFrom, map, switchMap } from "rxjs";
import { JslibModule } from "@bitwarden/angular/jslib.module";
import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction";
@@ -27,7 +27,7 @@ import {
ToastService,
TypographyModule,
} from "@bitwarden/components";
import { CredentialGeneratorService, Generators } from "@bitwarden/generator-core";
import { CredentialGeneratorService, GenerateRequest, Generators } from "@bitwarden/generator-core";
import { SendFormConfig } from "../../abstractions/send-form-config.service";
import { SendFormContainer } from "../../send-form-container";
@@ -121,8 +121,9 @@ export class SendOptionsComponent implements OnInit {
}
generatePassword = async () => {
const on$ = new BehaviorSubject<GenerateRequest>({ source: "send" });
const generatedCredential = await firstValueFrom(
this.generatorService.generate$(Generators.password),
this.generatorService.generate$(Generators.password, { on$ }),
);
this.sendOptionsForm.patchValue({