From a07a7e98171385a3b8b9464fec6c3946ea443694 Mon Sep 17 00:00:00 2001 From: Daniel James Smith <2670567+djsmith85@users.noreply.github.com> Date: Mon, 30 Dec 2024 18:57:22 +0100 Subject: [PATCH] [PM-16094] Remove lowercasing of vault page headers titles (#12438) * Remove lowercasing of View page headers * Remove lowercasing of Add/edit page headers * Remove lowercasing of Web ViewAdd/edit page headers * Fix tests --------- Co-authored-by: Daniel James Smith --- .../vault-v2/add-edit/add-edit-v2.component.ts | 10 +++++----- .../vault-v2/view-v2/view-v2.component.spec.ts | 6 +++--- .../vault-v2/view-v2/view-v2.component.ts | 13 +++++-------- .../vault-item-dialog.component.ts | 10 +++++----- 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/apps/browser/src/vault/popup/components/vault-v2/add-edit/add-edit-v2.component.ts b/apps/browser/src/vault/popup/components/vault-v2/add-edit/add-edit-v2.component.ts index a2b2d1ce581..2d8c4857c1c 100644 --- a/apps/browser/src/vault/popup/components/vault-v2/add-edit/add-edit-v2.component.ts +++ b/apps/browser/src/vault/popup/components/vault-v2/add-edit/add-edit-v2.component.ts @@ -326,15 +326,15 @@ export class AddEditV2Component implements OnInit { switch (type) { case CipherType.Login: - return this.i18nService.t(partOne, this.i18nService.t("typeLogin").toLocaleLowerCase()); + return this.i18nService.t(partOne, this.i18nService.t("typeLogin")); case CipherType.Card: - return this.i18nService.t(partOne, this.i18nService.t("typeCard").toLocaleLowerCase()); + return this.i18nService.t(partOne, this.i18nService.t("typeCard")); case CipherType.Identity: - return this.i18nService.t(partOne, this.i18nService.t("typeIdentity").toLocaleLowerCase()); + return this.i18nService.t(partOne, this.i18nService.t("typeIdentity")); case CipherType.SecureNote: - return this.i18nService.t(partOne, this.i18nService.t("note").toLocaleLowerCase()); + return this.i18nService.t(partOne, this.i18nService.t("note")); case CipherType.SshKey: - return this.i18nService.t(partOne, this.i18nService.t("typeSshKey").toLocaleLowerCase()); + return this.i18nService.t(partOne, this.i18nService.t("typeSshKey")); } } } diff --git a/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.spec.ts b/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.spec.ts index bc84dd337cb..7ee15aa833b 100644 --- a/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.spec.ts +++ b/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.spec.ts @@ -137,21 +137,21 @@ describe("ViewV2Component", () => { params$.next({ cipherId: mockCipher.id }); flush(); // Resolve all promises - expect(component.headerText).toEqual("viewItemHeader typelogin"); + expect(component.headerText).toEqual("viewItemHeader typeLogin"); // Set header text for a card mockCipher.type = CipherType.Card; params$.next({ cipherId: mockCipher.id }); flush(); // Resolve all promises - expect(component.headerText).toEqual("viewItemHeader typecard"); + expect(component.headerText).toEqual("viewItemHeader typeCard"); // Set header text for an identity mockCipher.type = CipherType.Identity; params$.next({ cipherId: mockCipher.id }); flush(); // Resolve all promises - expect(component.headerText).toEqual("viewItemHeader typeidentity"); + expect(component.headerText).toEqual("viewItemHeader typeIdentity"); // Set header text for a secure note mockCipher.type = CipherType.SecureNote; diff --git a/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.ts b/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.ts index 5afbf8ba77d..55b59c087c5 100644 --- a/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.ts +++ b/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.ts @@ -146,18 +146,15 @@ export class ViewV2Component { setHeader(type: CipherType) { switch (type) { case CipherType.Login: - return this.i18nService.t("viewItemHeader", this.i18nService.t("typeLogin").toLowerCase()); + return this.i18nService.t("viewItemHeader", this.i18nService.t("typeLogin")); case CipherType.Card: - return this.i18nService.t("viewItemHeader", this.i18nService.t("typeCard").toLowerCase()); + return this.i18nService.t("viewItemHeader", this.i18nService.t("typeCard")); case CipherType.Identity: - return this.i18nService.t( - "viewItemHeader", - this.i18nService.t("typeIdentity").toLowerCase(), - ); + return this.i18nService.t("viewItemHeader", this.i18nService.t("typeIdentity")); case CipherType.SecureNote: - return this.i18nService.t("viewItemHeader", this.i18nService.t("note").toLowerCase()); + return this.i18nService.t("viewItemHeader", this.i18nService.t("note")); case CipherType.SshKey: - return this.i18nService.t("viewItemHeader", this.i18nService.t("typeSshkey").toLowerCase()); + return this.i18nService.t("viewItemHeader", this.i18nService.t("typeSshkey")); } } diff --git a/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts b/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts index 4c1b51a5482..02dc5ef48bb 100644 --- a/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts +++ b/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts @@ -419,19 +419,19 @@ export class VaultItemDialogComponent implements OnInit, OnDestroy { switch (type) { case CipherType.Login: - this.title = this.i18nService.t(partOne, this.i18nService.t("typeLogin").toLowerCase()); + this.title = this.i18nService.t(partOne, this.i18nService.t("typeLogin")); break; case CipherType.Card: - this.title = this.i18nService.t(partOne, this.i18nService.t("typeCard").toLowerCase()); + this.title = this.i18nService.t(partOne, this.i18nService.t("typeCard")); break; case CipherType.Identity: - this.title = this.i18nService.t(partOne, this.i18nService.t("typeIdentity").toLowerCase()); + this.title = this.i18nService.t(partOne, this.i18nService.t("typeIdentity")); break; case CipherType.SecureNote: - this.title = this.i18nService.t(partOne, this.i18nService.t("note").toLowerCase()); + this.title = this.i18nService.t(partOne, this.i18nService.t("note")); break; case CipherType.SshKey: - this.title = this.i18nService.t(partOne, this.i18nService.t("typeSshKey").toLowerCase()); + this.title = this.i18nService.t(partOne, this.i18nService.t("typeSshKey")); break; } }