Skip to content

Commit

Permalink
[PM-16094] Remove lowercasing of vault page headers titles (#12438)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
djsmith85 and djsmith85 authored Dec 30, 2024
1 parent 02f1ec6 commit a07a7e9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit a07a7e9

Please sign in to comment.