1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 00:33:44 +00:00

[PM-13776] Generator Icon Button labels (#11623)

* update aria labels for generate and copy buttons within the generator components

- Using the `appA11yTitle` across all icon buttons
- Updated all labels to be targeted towards the credential type rather than just "password"

* add copy/generate passphrase translations to desktop

* add fixme comments for translations

* remove reference to JIRA ticket
This commit is contained in:
Nick Krantz
2024-10-23 10:23:51 -05:00
committed by GitHub
parent dfa7509c8e
commit c4fcd53ad2
8 changed files with 117 additions and 18 deletions

View File

@@ -52,6 +52,36 @@ export class PasswordGeneratorComponent implements OnInit, OnDestroy {
/** tracks the currently selected credential type */
protected credentialType$ = new BehaviorSubject<PasswordAlgorithm>(null);
/**
* Emits the copy button aria-label respective of the selected credential
*
* FIXME: Move label and logic to `AlgorithmInfo` within the `CredentialGeneratorService`.
*/
protected credentialTypeCopyLabel$ = this.credentialType$.pipe(
map((cred) => {
if (cred === "password") {
return this.i18nService.t("copyPassword");
}
return this.i18nService.t("copyPassphrase");
}),
);
/**
* Emits the generate button aria-label respective of the selected credential
*
* FIXME: Move label and logic to `AlgorithmInfo` within the `CredentialGeneratorService`.
*/
protected credentialTypeGenerateLabel$ = this.credentialType$.pipe(
map((cred) => {
if (cred === "password") {
return this.i18nService.t("generatePassword");
}
return this.i18nService.t("generatePassphrase");
}),
);
/** Emits the last generated value. */
protected readonly value$ = new BehaviorSubject<string>("");