From 107ea04c81d44234f6276fb4aedf9339243db5b9 Mon Sep 17 00:00:00 2001 From: "bw-ghapp[bot]" <178206702+bw-ghapp[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 15:27:54 +0100 Subject: [PATCH 01/10] Autosync the updated translations (#12386) Co-authored-by: bitwarden-devops-bot <106330231+bitwarden-devops-bot@users.noreply.github.com> --- apps/browser/src/_locales/az/messages.json | 2 +- apps/browser/src/_locales/bg/messages.json | 6 +++--- apps/browser/src/_locales/cs/messages.json | 2 +- apps/browser/src/_locales/da/messages.json | 2 +- apps/browser/src/_locales/de/messages.json | 6 +++--- apps/browser/src/_locales/pt_PT/messages.json | 2 +- apps/browser/src/_locales/ru/messages.json | 2 +- apps/browser/src/_locales/sk/messages.json | 2 +- apps/browser/src/_locales/uk/messages.json | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/browser/src/_locales/az/messages.json b/apps/browser/src/_locales/az/messages.json index a1783a91ef8..3e8c523a96e 100644 --- a/apps/browser/src/_locales/az/messages.json +++ b/apps/browser/src/_locales/az/messages.json @@ -3174,7 +3174,7 @@ "message": "Bütün giriş seçimlərinə bax" }, "viewAllLoginOptionsV1": { - "message": "View all log in options" + "message": "Bütün giriş seçimlərinə bax" }, "notificationSentDevice": { "message": "Cihazınıza bir bildiriş göndərildi." diff --git a/apps/browser/src/_locales/bg/messages.json b/apps/browser/src/_locales/bg/messages.json index b76b72001fe..50278649461 100644 --- a/apps/browser/src/_locales/bg/messages.json +++ b/apps/browser/src/_locales/bg/messages.json @@ -3174,7 +3174,7 @@ "message": "Вижте всички възможности за вписване" }, "viewAllLoginOptionsV1": { - "message": "View all log in options" + "message": "Вижте всички възможности за вписване" }, "notificationSentDevice": { "message": "Към устройството Ви е изпратено известие." @@ -4890,10 +4890,10 @@ "message": "Генерирана парола" }, "compactMode": { - "message": "Compact mode" + "message": "Компактен режим" }, "beta": { - "message": "Beta" + "message": "Бета" }, "extensionWidth": { "message": "Ширина на разширението" diff --git a/apps/browser/src/_locales/cs/messages.json b/apps/browser/src/_locales/cs/messages.json index f6ad593bd53..650f089db49 100644 --- a/apps/browser/src/_locales/cs/messages.json +++ b/apps/browser/src/_locales/cs/messages.json @@ -3174,7 +3174,7 @@ "message": "Zobrazit všechny volby přihlášení" }, "viewAllLoginOptionsV1": { - "message": "View all log in options" + "message": "Zobrazit všechny volby přihlášení" }, "notificationSentDevice": { "message": "Na Vaše zařízení bylo odesláno oznámení." diff --git a/apps/browser/src/_locales/da/messages.json b/apps/browser/src/_locales/da/messages.json index 5407b8298a0..fbd023600e9 100644 --- a/apps/browser/src/_locales/da/messages.json +++ b/apps/browser/src/_locales/da/messages.json @@ -3174,7 +3174,7 @@ "message": "Vis alle indlogningsmuligheder" }, "viewAllLoginOptionsV1": { - "message": "View all log in options" + "message": "Vis alle indlogningsmuligheder" }, "notificationSentDevice": { "message": "En notifikation er sendt til din enhed." diff --git a/apps/browser/src/_locales/de/messages.json b/apps/browser/src/_locales/de/messages.json index e1873f0c3d8..16781db580f 100644 --- a/apps/browser/src/_locales/de/messages.json +++ b/apps/browser/src/_locales/de/messages.json @@ -1320,10 +1320,10 @@ "message": "Gib den 6-stelligen Verifizierungscode aus deiner Authenticator App ein." }, "authenticationTimeout": { - "message": "Authentication timeout" + "message": "Authentifizierungs-Timeout" }, "authenticationSessionTimedOut": { - "message": "The authentication session timed out. Please restart the login process." + "message": "Die Authentifizierungssitzung ist abgelaufen. Bitte starte den Anmeldeprozess neu." }, "enterVerificationCodeEmail": { "message": "Gib den 6-stelligen Bestätigungscode ein, der an $EMAIL$ gesendet wurde.", @@ -3174,7 +3174,7 @@ "message": "Alle Anmeldeoptionen anzeigen" }, "viewAllLoginOptionsV1": { - "message": "View all log in options" + "message": "Alle Anmeldeoptionen anzeigen" }, "notificationSentDevice": { "message": "Eine Benachrichtigung wurde an dein Gerät gesendet." diff --git a/apps/browser/src/_locales/pt_PT/messages.json b/apps/browser/src/_locales/pt_PT/messages.json index 6c85d72e6bf..df157d9eef2 100644 --- a/apps/browser/src/_locales/pt_PT/messages.json +++ b/apps/browser/src/_locales/pt_PT/messages.json @@ -3174,7 +3174,7 @@ "message": "Ver todas as opções de início de sessão" }, "viewAllLoginOptionsV1": { - "message": "View all log in options" + "message": "Ver todas as opções de início de sessão" }, "notificationSentDevice": { "message": "Foi enviada uma notificação para o seu dispositivo." diff --git a/apps/browser/src/_locales/ru/messages.json b/apps/browser/src/_locales/ru/messages.json index 526d77e009d..5421fbb90f0 100644 --- a/apps/browser/src/_locales/ru/messages.json +++ b/apps/browser/src/_locales/ru/messages.json @@ -3174,7 +3174,7 @@ "message": "Посмотреть все варианты авторизации" }, "viewAllLoginOptionsV1": { - "message": "View all log in options" + "message": "Посмотреть все варианты авторизации" }, "notificationSentDevice": { "message": "На ваше устройство отправлено уведомление." diff --git a/apps/browser/src/_locales/sk/messages.json b/apps/browser/src/_locales/sk/messages.json index d1374c51cfe..ae30b2ad8ba 100644 --- a/apps/browser/src/_locales/sk/messages.json +++ b/apps/browser/src/_locales/sk/messages.json @@ -3174,7 +3174,7 @@ "message": "Zobraziť všetky možnosti prihlásenia" }, "viewAllLoginOptionsV1": { - "message": "View all log in options" + "message": "Zobraziť všetky možnosti prihlásenia" }, "notificationSentDevice": { "message": "Do vášho zariadenia bolo odoslané upozornenie." diff --git a/apps/browser/src/_locales/uk/messages.json b/apps/browser/src/_locales/uk/messages.json index d9a1c11bed5..f759c5a5ce4 100644 --- a/apps/browser/src/_locales/uk/messages.json +++ b/apps/browser/src/_locales/uk/messages.json @@ -3174,7 +3174,7 @@ "message": "Переглянути всі варіанти входу" }, "viewAllLoginOptionsV1": { - "message": "View all log in options" + "message": "Переглянути всі варіанти входу" }, "notificationSentDevice": { "message": "Сповіщення було надіслано на ваш пристрій." From 67e385820654558c8ae4c86520952ec7495fdfb7 Mon Sep 17 00:00:00 2001 From: Brandon Treston Date: Fri, 13 Dec 2024 09:43:43 -0500 Subject: [PATCH 02/10] fix width for organizationName column (#12385) --- .../providers/clients/vnext-clients.component.html | 4 ++-- .../providers/clients/vnext-manage-clients.component.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bitwarden_license/bit-web/src/app/admin-console/providers/clients/vnext-clients.component.html b/bitwarden_license/bit-web/src/app/admin-console/providers/clients/vnext-clients.component.html index 2ace948e9d9..9a8bc68bd26 100644 --- a/bitwarden_license/bit-web/src/app/admin-console/providers/clients/vnext-clients.component.html +++ b/bitwarden_license/bit-web/src/app/admin-console/providers/clients/vnext-clients.component.html @@ -43,10 +43,10 @@ - + - + {{ row.organizationName }} diff --git a/bitwarden_license/bit-web/src/app/billing/providers/clients/vnext-manage-clients.component.html b/bitwarden_license/bit-web/src/app/billing/providers/clients/vnext-manage-clients.component.html index c54965bbdb6..99de9352f62 100644 --- a/bitwarden_license/bit-web/src/app/billing/providers/clients/vnext-manage-clients.component.html +++ b/bitwarden_license/bit-web/src/app/billing/providers/clients/vnext-manage-clients.component.html @@ -29,7 +29,7 @@ - +
{{ row.organizationName From 614a4b75cd32b0674e73f9858e7d70efab63dd01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rui=20Tom=C3=A9?= <108268980+r-tome@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:44:41 +0000 Subject: [PATCH 03/10] =?UTF-8?q?[PM-15154]=C2=A0Add=20missing=20message?= =?UTF-8?q?=20for=20claimed=20domain=20(#12353)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/src/locales/en/messages.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/web/src/locales/en/messages.json b/apps/web/src/locales/en/messages.json index 77b8bddd9ee..5e86e13f6ce 100644 --- a/apps/web/src/locales/en/messages.json +++ b/apps/web/src/locales/en/messages.json @@ -9984,5 +9984,8 @@ "example": "12/10/2024" } } + }, + "domainClaimed": { + "message": "Domain claimed" } } From 649590ad629a4081aca6f7c21bb9dc6395b13a8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9C=A8=20Audrey=20=E2=9C=A8?= Date: Fri, 13 Dec 2024 11:32:51 -0500 Subject: [PATCH 04/10] Revert "Autosync the updated translations (#12386)" (#12393) This reverts commit 107ea04c81d44234f6276fb4aedf9339243db5b9. --- apps/browser/src/_locales/az/messages.json | 2 +- apps/browser/src/_locales/bg/messages.json | 6 +++--- apps/browser/src/_locales/cs/messages.json | 2 +- apps/browser/src/_locales/da/messages.json | 2 +- apps/browser/src/_locales/de/messages.json | 6 +++--- apps/browser/src/_locales/pt_PT/messages.json | 2 +- apps/browser/src/_locales/ru/messages.json | 2 +- apps/browser/src/_locales/sk/messages.json | 2 +- apps/browser/src/_locales/uk/messages.json | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/browser/src/_locales/az/messages.json b/apps/browser/src/_locales/az/messages.json index 3e8c523a96e..a1783a91ef8 100644 --- a/apps/browser/src/_locales/az/messages.json +++ b/apps/browser/src/_locales/az/messages.json @@ -3174,7 +3174,7 @@ "message": "Bütün giriş seçimlərinə bax" }, "viewAllLoginOptionsV1": { - "message": "Bütün giriş seçimlərinə bax" + "message": "View all log in options" }, "notificationSentDevice": { "message": "Cihazınıza bir bildiriş göndərildi." diff --git a/apps/browser/src/_locales/bg/messages.json b/apps/browser/src/_locales/bg/messages.json index 50278649461..b76b72001fe 100644 --- a/apps/browser/src/_locales/bg/messages.json +++ b/apps/browser/src/_locales/bg/messages.json @@ -3174,7 +3174,7 @@ "message": "Вижте всички възможности за вписване" }, "viewAllLoginOptionsV1": { - "message": "Вижте всички възможности за вписване" + "message": "View all log in options" }, "notificationSentDevice": { "message": "Към устройството Ви е изпратено известие." @@ -4890,10 +4890,10 @@ "message": "Генерирана парола" }, "compactMode": { - "message": "Компактен режим" + "message": "Compact mode" }, "beta": { - "message": "Бета" + "message": "Beta" }, "extensionWidth": { "message": "Ширина на разширението" diff --git a/apps/browser/src/_locales/cs/messages.json b/apps/browser/src/_locales/cs/messages.json index 650f089db49..f6ad593bd53 100644 --- a/apps/browser/src/_locales/cs/messages.json +++ b/apps/browser/src/_locales/cs/messages.json @@ -3174,7 +3174,7 @@ "message": "Zobrazit všechny volby přihlášení" }, "viewAllLoginOptionsV1": { - "message": "Zobrazit všechny volby přihlášení" + "message": "View all log in options" }, "notificationSentDevice": { "message": "Na Vaše zařízení bylo odesláno oznámení." diff --git a/apps/browser/src/_locales/da/messages.json b/apps/browser/src/_locales/da/messages.json index fbd023600e9..5407b8298a0 100644 --- a/apps/browser/src/_locales/da/messages.json +++ b/apps/browser/src/_locales/da/messages.json @@ -3174,7 +3174,7 @@ "message": "Vis alle indlogningsmuligheder" }, "viewAllLoginOptionsV1": { - "message": "Vis alle indlogningsmuligheder" + "message": "View all log in options" }, "notificationSentDevice": { "message": "En notifikation er sendt til din enhed." diff --git a/apps/browser/src/_locales/de/messages.json b/apps/browser/src/_locales/de/messages.json index 16781db580f..e1873f0c3d8 100644 --- a/apps/browser/src/_locales/de/messages.json +++ b/apps/browser/src/_locales/de/messages.json @@ -1320,10 +1320,10 @@ "message": "Gib den 6-stelligen Verifizierungscode aus deiner Authenticator App ein." }, "authenticationTimeout": { - "message": "Authentifizierungs-Timeout" + "message": "Authentication timeout" }, "authenticationSessionTimedOut": { - "message": "Die Authentifizierungssitzung ist abgelaufen. Bitte starte den Anmeldeprozess neu." + "message": "The authentication session timed out. Please restart the login process." }, "enterVerificationCodeEmail": { "message": "Gib den 6-stelligen Bestätigungscode ein, der an $EMAIL$ gesendet wurde.", @@ -3174,7 +3174,7 @@ "message": "Alle Anmeldeoptionen anzeigen" }, "viewAllLoginOptionsV1": { - "message": "Alle Anmeldeoptionen anzeigen" + "message": "View all log in options" }, "notificationSentDevice": { "message": "Eine Benachrichtigung wurde an dein Gerät gesendet." diff --git a/apps/browser/src/_locales/pt_PT/messages.json b/apps/browser/src/_locales/pt_PT/messages.json index df157d9eef2..6c85d72e6bf 100644 --- a/apps/browser/src/_locales/pt_PT/messages.json +++ b/apps/browser/src/_locales/pt_PT/messages.json @@ -3174,7 +3174,7 @@ "message": "Ver todas as opções de início de sessão" }, "viewAllLoginOptionsV1": { - "message": "Ver todas as opções de início de sessão" + "message": "View all log in options" }, "notificationSentDevice": { "message": "Foi enviada uma notificação para o seu dispositivo." diff --git a/apps/browser/src/_locales/ru/messages.json b/apps/browser/src/_locales/ru/messages.json index 5421fbb90f0..526d77e009d 100644 --- a/apps/browser/src/_locales/ru/messages.json +++ b/apps/browser/src/_locales/ru/messages.json @@ -3174,7 +3174,7 @@ "message": "Посмотреть все варианты авторизации" }, "viewAllLoginOptionsV1": { - "message": "Посмотреть все варианты авторизации" + "message": "View all log in options" }, "notificationSentDevice": { "message": "На ваше устройство отправлено уведомление." diff --git a/apps/browser/src/_locales/sk/messages.json b/apps/browser/src/_locales/sk/messages.json index ae30b2ad8ba..d1374c51cfe 100644 --- a/apps/browser/src/_locales/sk/messages.json +++ b/apps/browser/src/_locales/sk/messages.json @@ -3174,7 +3174,7 @@ "message": "Zobraziť všetky možnosti prihlásenia" }, "viewAllLoginOptionsV1": { - "message": "Zobraziť všetky možnosti prihlásenia" + "message": "View all log in options" }, "notificationSentDevice": { "message": "Do vášho zariadenia bolo odoslané upozornenie." diff --git a/apps/browser/src/_locales/uk/messages.json b/apps/browser/src/_locales/uk/messages.json index f759c5a5ce4..d9a1c11bed5 100644 --- a/apps/browser/src/_locales/uk/messages.json +++ b/apps/browser/src/_locales/uk/messages.json @@ -3174,7 +3174,7 @@ "message": "Переглянути всі варіанти входу" }, "viewAllLoginOptionsV1": { - "message": "Переглянути всі варіанти входу" + "message": "View all log in options" }, "notificationSentDevice": { "message": "Сповіщення було надіслано на ваш пристрій." From 638304819727109aa743eae14f635b4a1c596c7a Mon Sep 17 00:00:00 2001 From: Daniel Riera Date: Fri, 13 Dec 2024 12:37:16 -0500 Subject: [PATCH 05/10] PM-5550 Implement on-page autofil for single line TOTP (#12058) * PM-5550 initial commit -Initial render -Edit tests -Clean up styling -New method to validate totpfields * add refresh overlay * localize and clean up * - Clean up code - Remove unnecessary data from buildtotpelement - Add feature flag - Add aria labels to buildtotpelement - Add tests and update relevant snapshots * Add and translate aria labels * add aria labels * implement feature flag * address totp tests * clean up totpfield function * fix styling and tests, update snapshots * Update apps/browser/src/_locales/en/messages.json Formatting suggestion Co-authored-by: Jonathan Prusik * Update apps/browser/src/_locales/en/messages.json Formatting suggestion Co-authored-by: Jonathan Prusik * remove group tag * update snapshots * adress feedback --------- Co-authored-by: Jonathan Prusik --- apps/browser/src/_locales/en/messages.json | 15 + .../abstractions/overlay.background.ts | 4 + .../background/overlay.background.spec.ts | 11 + .../autofill/background/overlay.background.ts | 91 ++- .../autofill-inline-menu-list.spec.ts.snap | 649 +++++++++++++++++- .../list/autofill-inline-menu-list.spec.ts | 25 + .../pages/list/autofill-inline-menu-list.ts | 93 +++ .../overlay/inline-menu/pages/list/list.scss | 26 + ...nline-menu-field-qualifications.service.ts | 1 + ...e-menu-field-qualification.service.spec.ts | 18 +- ...inline-menu-field-qualification.service.ts | 25 +- .../src/autofill/shared/styles/variables.scss | 84 ++- .../src/autofill/spec/autofill-mocks.ts | 2 +- .../src/background/runtime.background.ts | 4 + libs/common/src/enums/feature-flag.enum.ts | 2 + 15 files changed, 944 insertions(+), 106 deletions(-) diff --git a/apps/browser/src/_locales/en/messages.json b/apps/browser/src/_locales/en/messages.json index 04858eecced..f4a498f3e05 100644 --- a/apps/browser/src/_locales/en/messages.json +++ b/apps/browser/src/_locales/en/messages.json @@ -192,6 +192,13 @@ "autoFillIdentity": { "message": "Autofill identity" }, + "fillVerificationCode": { + "message": "Fill verification code" + }, + "fillVerificationCodeAria": { + "message": "Fill Verification Code", + "description": "Aria label for the heading displayed the inline menu for totp code autofill" + }, "generatePasswordCopied": { "message": "Generate password (copied)" }, @@ -3580,6 +3587,14 @@ "message": "Unlock your account, opens in a new window", "description": "Screen reader text (aria-label) for unlock account button in overlay" }, + "totpCodeAria": { + "message": "Time-based One-Time Password Verification Code", + "description": "Aria label for the totp code displayed in the inline menu for autofill" + }, + "totpSecondsSpanAria": { + "message": "Time remaining before current TOTP expires", + "description": "Aria label for the totp seconds displayed in the inline menu for autofill" + }, "fillCredentialsFor": { "message": "Fill credentials for", "description": "Screen reader text for when overlay item is in focused" diff --git a/apps/browser/src/autofill/background/abstractions/overlay.background.ts b/apps/browser/src/autofill/background/abstractions/overlay.background.ts index a0cdfb3cebf..03284f3fd89 100644 --- a/apps/browser/src/autofill/background/abstractions/overlay.background.ts +++ b/apps/browser/src/autofill/background/abstractions/overlay.background.ts @@ -160,6 +160,9 @@ export type InlineMenuCipherData = { icon: WebsiteIconData; accountCreationFieldType?: string; login?: { + totp?: string; + totpField?: boolean; + totpCodeTimeInterval?: number; username: string; passkey: { rpName: string; @@ -262,6 +265,7 @@ export type InlineMenuListPortMessageHandlers = { updateAutofillInlineMenuListHeight: ({ message, port }: PortOnMessageHandlerParams) => void; refreshGeneratedPassword: () => Promise; fillGeneratedPassword: ({ port }: PortConnectionParam) => Promise; + refreshOverlayCiphers: () => Promise; }; export interface OverlayBackground { diff --git a/apps/browser/src/autofill/background/overlay.background.spec.ts b/apps/browser/src/autofill/background/overlay.background.spec.ts index 6ec3c0a9b5a..e7b72b72c9b 100644 --- a/apps/browser/src/autofill/background/overlay.background.spec.ts +++ b/apps/browser/src/autofill/background/overlay.background.spec.ts @@ -928,6 +928,7 @@ describe("OverlayBackground", () => { login: { username: "username-1", passkey: null, + totpField: false, }, name: "name-1", reprompt: loginCipher1.reprompt, @@ -1065,6 +1066,7 @@ describe("OverlayBackground", () => { login: { username: loginCipher1.login.username, passkey: null, + totpField: false, }, name: loginCipher1.name, reprompt: loginCipher1.reprompt, @@ -1189,6 +1191,7 @@ describe("OverlayBackground", () => { rpName: passkeyCipher.login.fido2Credentials[0].rpName, userName: passkeyCipher.login.fido2Credentials[0].userName, }, + totpField: false, }, }, { @@ -1207,6 +1210,7 @@ describe("OverlayBackground", () => { login: { username: passkeyCipher.login.username, passkey: null, + totpField: false, }, }, { @@ -1225,6 +1229,7 @@ describe("OverlayBackground", () => { login: { username: loginCipher1.login.username, passkey: null, + totpField: false, }, }, ], @@ -1272,6 +1277,7 @@ describe("OverlayBackground", () => { login: { username: passkeyCipher.login.username, passkey: null, + totpField: false, }, }, { @@ -1290,6 +1296,7 @@ describe("OverlayBackground", () => { login: { username: loginCipher1.login.username, passkey: null, + totpField: false, }, }, ], @@ -1337,6 +1344,7 @@ describe("OverlayBackground", () => { login: { username: passkeyCipher.login.username, passkey: null, + totpField: false, }, }, { @@ -1355,6 +1363,7 @@ describe("OverlayBackground", () => { login: { username: loginCipher1.login.username, passkey: null, + totpField: false, }, }, ], @@ -1400,6 +1409,7 @@ describe("OverlayBackground", () => { login: { username: loginCipher1.login.username, passkey: null, + totpField: false, }, }, { @@ -1418,6 +1428,7 @@ describe("OverlayBackground", () => { login: { username: loginCipher2.login.username, passkey: null, + totpField: false, }, }, ], diff --git a/apps/browser/src/autofill/background/overlay.background.ts b/apps/browser/src/autofill/background/overlay.background.ts index aaeeea857b3..fd16bfcf16a 100644 --- a/apps/browser/src/autofill/background/overlay.background.ts +++ b/apps/browser/src/autofill/background/overlay.background.ts @@ -204,6 +204,7 @@ export class OverlayBackground implements OverlayBackgroundInterface { updateAutofillInlineMenuListHeight: ({ message }) => this.updateInlineMenuListHeight(message), refreshGeneratedPassword: () => this.updateGeneratedPassword(true), fillGeneratedPassword: ({ port }) => this.fillGeneratedPassword(port), + refreshOverlayCiphers: () => this.updateOverlayCiphers(false), }; constructor( @@ -464,7 +465,7 @@ export class OverlayBackground implements OverlayBackgroundInterface { this.showPasskeysLabelsWithinInlineMenu = false; if (this.shouldShowInlineMenuAccountCreation()) { - inlineMenuCipherData = this.buildInlineMenuAccountCreationCiphers( + inlineMenuCipherData = await this.buildInlineMenuAccountCreationCiphers( inlineMenuCiphersArray, true, ); @@ -485,7 +486,7 @@ export class OverlayBackground implements OverlayBackgroundInterface { * @param inlineMenuCiphersArray - Array of inline menu ciphers * @param showFavicons - Identifies whether favicons should be shown */ - private buildInlineMenuAccountCreationCiphers( + private async buildInlineMenuAccountCreationCiphers( inlineMenuCiphersArray: [string, CipherView][], showFavicons: boolean, ) { @@ -497,7 +498,7 @@ export class OverlayBackground implements OverlayBackgroundInterface { if (cipher.type === CipherType.Login) { accountCreationLoginCiphers.push( - this.buildCipherData({ + await this.buildCipherData({ inlineMenuCipherId, cipher, showFavicons, @@ -517,7 +518,7 @@ export class OverlayBackground implements OverlayBackgroundInterface { } inlineMenuCipherData.push( - this.buildCipherData({ + await this.buildCipherData({ inlineMenuCipherId, cipher, showFavicons, @@ -561,13 +562,13 @@ export class OverlayBackground implements OverlayBackgroundInterface { if (!passkeysEnabled || !(await this.showCipherAsPasskey(cipher, domainExclusionsSet))) { inlineMenuCipherData.push( - this.buildCipherData({ inlineMenuCipherId, cipher, showFavicons }), + await this.buildCipherData({ inlineMenuCipherId, cipher, showFavicons }), ); continue; } passkeyCipherData.push( - this.buildCipherData({ + await this.buildCipherData({ inlineMenuCipherId, cipher, showFavicons, @@ -577,7 +578,7 @@ export class OverlayBackground implements OverlayBackgroundInterface { if (cipher.login?.password && cipher.login.username) { inlineMenuCipherData.push( - this.buildCipherData({ inlineMenuCipherId, cipher, showFavicons }), + await this.buildCipherData({ inlineMenuCipherId, cipher, showFavicons }), ); } } @@ -620,6 +621,23 @@ export class OverlayBackground implements OverlayBackgroundInterface { return this.inlineMenuFido2Credentials.has(credentialId); } + private isTotpFieldForCurrentField(): boolean { + if (!this.focusedFieldData) { + return false; + } + const { tabId, frameId } = this.focusedFieldData; + const pageDetailsMap = this.pageDetailsForTab[tabId]; + if (!pageDetailsMap || !pageDetailsMap.has(frameId)) { + return false; + } + const pageDetail = pageDetailsMap.get(frameId); + return ( + pageDetail?.details?.fields?.every((field) => + this.inlineMenuFieldQualificationService.isTotpField(field), + ) || false + ); + } + /** * Builds the cipher data for the inline menu list. * @@ -630,14 +648,14 @@ export class OverlayBackground implements OverlayBackgroundInterface { * @param hasPasskey - Identifies whether the cipher has a FIDO2 credential * @param identityData - Pre-created identity data */ - private buildCipherData({ + private async buildCipherData({ inlineMenuCipherId, cipher, showFavicons, showInlineMenuAccountCreation, hasPasskey, identityData, - }: BuildCipherDataParams): InlineMenuCipherData { + }: BuildCipherDataParams): Promise { const inlineMenuData: InlineMenuCipherData = { id: inlineMenuCipherId, name: cipher.name, @@ -649,8 +667,13 @@ export class OverlayBackground implements OverlayBackgroundInterface { }; if (cipher.type === CipherType.Login) { + const totpCode = await this.totpService.getCode(cipher.login?.totp); + const totpCodeTimeInterval = this.totpService.getTimeInterval(cipher.login?.totp); inlineMenuData.login = { username: cipher.login.username, + totp: totpCode, + totpField: this.isTotpFieldForCurrentField(), + totpCodeTimeInterval: totpCodeTimeInterval, passkey: hasPasskey ? { rpName: cipher.login.fido2Credentials[0].rpName, @@ -1980,35 +2003,39 @@ export class OverlayBackground implements OverlayBackgroundInterface { private getInlineMenuTranslations() { if (!this.inlineMenuPageTranslations) { const translationKeys = [ + "addNewCardItemAria", + "addNewIdentityItemAria", + "addNewLoginItemAria", + "addNewVaultItem", + "authenticating", + "cardNumberEndsWith", + "fillCredentialsFor", + "fillGeneratedPassword", + "fillVerificationCode", + "fillVerificationCodeAria", + "generatedPassword", + "lowercaseAriaLabel", + "logInWithPasskeyAriaLabel", + "newCard", + "newIdentity", + "newItem", + "newLogin", + "noItemsToShow", "opensInANewWindow", + "passkeys", + "passwordRegenerated", + "passwords", + "regeneratePassword", + "saveLoginToBitwarden", "toggleBitwardenVaultOverlay", - "unlockYourAccountToViewAutofillSuggestions", + "totpCodeAria", + "totpSecondsSpanAria", "unlockAccount", "unlockAccountAria", - "fillCredentialsFor", + "unlockYourAccountToViewAutofillSuggestions", + "uppercaseAriaLabel", "username", "view", - "noItemsToShow", - "newItem", - "addNewVaultItem", - "newLogin", - "addNewLoginItemAria", - "newCard", - "addNewCardItemAria", - "newIdentity", - "addNewIdentityItemAria", - "cardNumberEndsWith", - "passkeys", - "passwords", - "logInWithPasskeyAriaLabel", - "authenticating", - "fillGeneratedPassword", - "regeneratePassword", - "passwordRegenerated", - "saveLoginToBitwarden", - "lowercaseAriaLabel", - "uppercaseAriaLabel", - "generatedPassword", ...Object.values(specialCharacterToKeyMap), ]; this.inlineMenuPageTranslations = translationKeys.reduce( diff --git a/apps/browser/src/autofill/overlay/inline-menu/pages/list/__snapshots__/autofill-inline-menu-list.spec.ts.snap b/apps/browser/src/autofill/overlay/inline-menu/pages/list/__snapshots__/autofill-inline-menu-list.spec.ts.snap index d920820b0e0..785cadb5510 100644 --- a/apps/browser/src/autofill/overlay/inline-menu/pages/list/__snapshots__/autofill-inline-menu-list.spec.ts.snap +++ b/apps/browser/src/autofill/overlay/inline-menu/pages/list/__snapshots__/autofill-inline-menu-list.spec.ts.snap @@ -681,10 +681,121 @@ exports[`AutofillInlineMenuList initAutofillInlineMenuList the list of ciphers f class="cipher-container" > + +
+ +
  • +
    + + +
    +
  • + + +`; + +exports[`AutofillInlineMenuList initAutofillInlineMenuList the list of ciphers for an authenticated user creates the view for a totp field 1`] = ` +
    +
      +
    • +
      + + +
      +
    • +
    • +
      + + +
      +
    • +
    • +
      + + +
      +
    • +
    • +
      + + +
      +
    • +
    • +
      +