1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-08 19:18:02 +01:00

[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 <djsmith85@users.noreply.github.com>
This commit is contained in:
Daniel James Smith 2024-12-30 18:57:22 +01:00 committed by GitHub
parent 02f1ec6519
commit a07a7e9817
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 18 additions and 21 deletions

View File

@ -326,15 +326,15 @@ export class AddEditV2Component implements OnInit {
switch (type) { switch (type) {
case CipherType.Login: 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: 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: 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: 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: case CipherType.SshKey:
return this.i18nService.t(partOne, this.i18nService.t("typeSshKey").toLocaleLowerCase()); return this.i18nService.t(partOne, this.i18nService.t("typeSshKey"));
} }
} }
} }

View File

@ -137,21 +137,21 @@ describe("ViewV2Component", () => {
params$.next({ cipherId: mockCipher.id }); params$.next({ cipherId: mockCipher.id });
flush(); // Resolve all promises flush(); // Resolve all promises
expect(component.headerText).toEqual("viewItemHeader typelogin"); expect(component.headerText).toEqual("viewItemHeader typeLogin");
// Set header text for a card // Set header text for a card
mockCipher.type = CipherType.Card; mockCipher.type = CipherType.Card;
params$.next({ cipherId: mockCipher.id }); params$.next({ cipherId: mockCipher.id });
flush(); // Resolve all promises flush(); // Resolve all promises
expect(component.headerText).toEqual("viewItemHeader typecard"); expect(component.headerText).toEqual("viewItemHeader typeCard");
// Set header text for an identity // Set header text for an identity
mockCipher.type = CipherType.Identity; mockCipher.type = CipherType.Identity;
params$.next({ cipherId: mockCipher.id }); params$.next({ cipherId: mockCipher.id });
flush(); // Resolve all promises flush(); // Resolve all promises
expect(component.headerText).toEqual("viewItemHeader typeidentity"); expect(component.headerText).toEqual("viewItemHeader typeIdentity");
// Set header text for a secure note // Set header text for a secure note
mockCipher.type = CipherType.SecureNote; mockCipher.type = CipherType.SecureNote;

View File

@ -146,18 +146,15 @@ export class ViewV2Component {
setHeader(type: CipherType) { setHeader(type: CipherType) {
switch (type) { switch (type) {
case CipherType.Login: 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: 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: case CipherType.Identity:
return this.i18nService.t( return this.i18nService.t("viewItemHeader", this.i18nService.t("typeIdentity"));
"viewItemHeader",
this.i18nService.t("typeIdentity").toLowerCase(),
);
case CipherType.SecureNote: 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: case CipherType.SshKey:
return this.i18nService.t("viewItemHeader", this.i18nService.t("typeSshkey").toLowerCase()); return this.i18nService.t("viewItemHeader", this.i18nService.t("typeSshkey"));
} }
} }

View File

@ -419,19 +419,19 @@ export class VaultItemDialogComponent implements OnInit, OnDestroy {
switch (type) { switch (type) {
case CipherType.Login: 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; break;
case CipherType.Card: 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; break;
case CipherType.Identity: 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; break;
case CipherType.SecureNote: 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; break;
case CipherType.SshKey: 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; break;
} }
} }