1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 07:13:32 +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

@@ -63,6 +63,44 @@ export class CredentialGeneratorComponent implements OnInit, OnDestroy {
nav: null,
});
/**
* Emits the copy button aria-label respective of the selected credential type
*
* FIXME: Move label and logic to `AlgorithmInfo` within the `CredentialGeneratorService`.
*/
protected credentialTypeCopyLabel$ = this.root$.pipe(
map(({ nav }) => {
if (nav === "password") {
return this.i18nService.t("copyPassword");
}
if (nav === "passphrase") {
return this.i18nService.t("copyPassphrase");
}
return this.i18nService.t("copyUsername");
}),
);
/**
* Emits the generate button aria-label respective of the selected credential type
*
* FIXME: Move label and logic to `AlgorithmInfo` within the `CredentialGeneratorService`.
*/
protected credentialTypeGenerateLabel$ = this.root$.pipe(
map(({ nav }) => {
if (nav === "password") {
return this.i18nService.t("generatePassword");
}
if (nav === "passphrase") {
return this.i18nService.t("generatePassphrase");
}
return this.i18nService.t("generateUsername");
}),
);
protected onRootChanged(nav: RootNavValue) {
// prevent subscription cycle
if (this.root$.value.nav !== nav) {