From d68853a4a2eb12c5829636da2f9b202a1cd0e637 Mon Sep 17 00:00:00 2001 From: Nick Krantz <125900171+nick-livefront@users.noreply.github.com> Date: Tue, 17 Sep 2024 13:23:15 -0500 Subject: [PATCH] [PM-11131] Screen Reader Announcements for Copy (#11091) * add copy specific aria-labels for login ciphers * add copy specific aria-labels for card ciphers * add copy translations for identity to web translations --- apps/browser/src/_locales/en/messages.json | 15 +++++++ apps/web/src/locales/en/messages.json | 39 +++++++++++++++++++ .../additional-options.component.html | 2 +- .../autofill-options-view.component.html | 2 +- .../card-details-view.component.html | 4 +- .../custom-fields-v2.component.html | 4 +- .../login-credentials-view.component.html | 6 +-- 7 files changed, 63 insertions(+), 9 deletions(-) diff --git a/apps/browser/src/_locales/en/messages.json b/apps/browser/src/_locales/en/messages.json index 764b8b5611..2a7f17e55e 100644 --- a/apps/browser/src/_locales/en/messages.json +++ b/apps/browser/src/_locales/en/messages.json @@ -128,6 +128,21 @@ "copyLicenseNumber": { "message": "Copy license number" }, + "copyCustomField": { + "message": "Copy $FIELD$", + "placeholders": { + "field": { + "content": "$1", + "example": "Custom field label" + } + } + }, + "copyWebsite": { + "message": "Copy website" + }, + "copyNotes": { + "message": "Copy notes" + }, "autoFill": { "message": "Autofill" }, diff --git a/apps/web/src/locales/en/messages.json b/apps/web/src/locales/en/messages.json index 9b7d44150e..cdfae90423 100644 --- a/apps/web/src/locales/en/messages.json +++ b/apps/web/src/locales/en/messages.json @@ -592,6 +592,45 @@ "message": "Copy URI", "description": "Copy URI to clipboard" }, + "copyCustomField": { + "message": "Copy $FIELD$", + "placeholders": { + "field": { + "content": "$1", + "example": "Custom field label" + } + } + }, + "copyWebsite": { + "message": "Copy website" + }, + "copyNotes": { + "message": "Copy notes" + }, + "copyAddress": { + "message": "Copy address" + }, + "copyPhone": { + "message": "Copy phone" + }, + "copyEmail": { + "message": "Copy email" + }, + "copyCompany": { + "message": "Copy company" + }, + "copySSN": { + "message": "Copy Social Security number" + }, + "copyPassportNumber": { + "message": "Copy passport number" + }, + "copyLicenseNumber": { + "message": "Copy license number" + }, + "copyName": { + "message": "Copy name" + }, "me": { "message": "Me" }, diff --git a/libs/vault/src/cipher-view/additional-options/additional-options.component.html b/libs/vault/src/cipher-view/additional-options/additional-options.component.html index 0913629ad9..dc78582776 100644 --- a/libs/vault/src/cipher-view/additional-options/additional-options.component.html +++ b/libs/vault/src/cipher-view/additional-options/additional-options.component.html @@ -14,7 +14,7 @@ [appCopyClick]="notes" showToast [valueLabel]="'note' | i18n" - [appA11yTitle]="'copyValue' | i18n" + [appA11yTitle]="'copyNotes' | i18n" > diff --git a/libs/vault/src/cipher-view/autofill-options/autofill-options-view.component.html b/libs/vault/src/cipher-view/autofill-options/autofill-options-view.component.html index 6d4669dd43..aa3e05b9aa 100644 --- a/libs/vault/src/cipher-view/autofill-options/autofill-options-view.component.html +++ b/libs/vault/src/cipher-view/autofill-options/autofill-options-view.component.html @@ -35,7 +35,7 @@ [appCopyClick]="login.launchUri" [valueLabel]="'website' | i18n" showToast - [appA11yTitle]="'copyValue' | i18n" + [appA11yTitle]="'copyWebsite' | i18n" data-testid="copy-website" > diff --git a/libs/vault/src/cipher-view/card-details/card-details-view.component.html b/libs/vault/src/cipher-view/card-details/card-details-view.component.html index 62da2355ed..051a812888 100644 --- a/libs/vault/src/cipher-view/card-details/card-details-view.component.html +++ b/libs/vault/src/cipher-view/card-details/card-details-view.component.html @@ -39,7 +39,7 @@ [appCopyClick]="card.number" showToast [valueLabel]="'number' | i18n" - [appA11yTitle]="'copyValue' | i18n" + [appA11yTitle]="'copyNumber' | i18n" data-testid="copy-number" > @@ -79,7 +79,7 @@ [appCopyClick]="card.code" showToast [valueLabel]="'securityCode' | i18n" - [appA11yTitle]="'copyValue' | i18n" + [appA11yTitle]="'copySecurityCode' | i18n" data-testid="copy-code" (click)="logCardEvent(true, EventType.Cipher_ClientCopiedCardCode)" > diff --git a/libs/vault/src/cipher-view/custom-fields/custom-fields-v2.component.html b/libs/vault/src/cipher-view/custom-fields/custom-fields-v2.component.html index 8c6d9f9617..bd2c6e7223 100644 --- a/libs/vault/src/cipher-view/custom-fields/custom-fields-v2.component.html +++ b/libs/vault/src/cipher-view/custom-fields/custom-fields-v2.component.html @@ -19,7 +19,7 @@ [appCopyClick]="field.value" showToast [valueLabel]="field.name" - [appA11yTitle]="'copyValue' | i18n" + [appA11yTitle]="'copyCustomField' | i18n: field.name" data-testid="copy-custom-field" > @@ -40,7 +40,7 @@ [appCopyClick]="field.value" showToast [valueLabel]="field.name" - [appA11yTitle]="'copyValue' | i18n" + [appA11yTitle]="'copyCustomField' | i18n: field.name" (click)="logCopyEvent()" > diff --git a/libs/vault/src/cipher-view/login-credentials/login-credentials-view.component.html b/libs/vault/src/cipher-view/login-credentials/login-credentials-view.component.html index 1d6c81c659..88a59d9cc4 100644 --- a/libs/vault/src/cipher-view/login-credentials/login-credentials-view.component.html +++ b/libs/vault/src/cipher-view/login-credentials/login-credentials-view.component.html @@ -22,7 +22,7 @@ [appCopyClick]="cipher.login.username" [valueLabel]="'username' | i18n" showToast - [appA11yTitle]="'copyValue' | i18n" + [appA11yTitle]="'copyUsername' | i18n" data-testid="copy-username" > @@ -64,7 +64,7 @@ [appCopyClick]="cipher.login.password" [valueLabel]="'password' | i18n" showToast - [appA11yTitle]="'copyValue' | i18n" + [appA11yTitle]="'copyPassword' | i18n" data-testid="copy-password" (click)="logCopyEvent()" > @@ -127,7 +127,7 @@ [appCopyClick]="totpCodeCopyObj?.totpCode" [valueLabel]="'verificationCodeTotp' | i18n" showToast - [appA11yTitle]="'copyValue' | i18n" + [appA11yTitle]="'copyVerificationCode' | i18n" data-testid="copy-totp" [disabled]="!(isPremium$ | async)" class="disabled:tw-cursor-default"