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:
@@ -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>("");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user