Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions apps/browser/src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1976,12 +1976,48 @@
"brand": {
"message": "Brand"
},
"birthDay": {
"message": "Birth day"
},
"birthMonth": {
"message": "Birth month"
},
"birthYear": {
"message": "Birth year"
},
"expirationDay": {
"message": "Expiration day"
},
"expirationMonth": {
"message": "Expiration month"
},
"expirationYear": {
"message": "Expiration year"
},
"issueDay": {
"message": "Issue day"
},
"issueMonth": {
"message": "Issue month"
},
"issueYear": {
"message": "Issue year"
},
"enterMonth": {
"message": "Enter month."
},
"enterDay": {
"message": "Enter day."
},
"enterYear": {
"message": "Enter year."
},
"invalidDay": {
"message": "Enter a valid day."
},
"invalidYear": {
"message": "Enter a valid year."
},
"monthly": {
"message": "month"
},
Expand Down Expand Up @@ -2075,6 +2111,51 @@
"passportNumber": {
"message": "Passport number"
},
"dateOfBirth": {
"message": "Date of birth"
},
"sex": {
"message": "Sex"
},
"copySex": {
"message": "Copy sex"
},
"birthPlace": {
"message": "Birth place"
},
"copyBirthPlace": {
"message": "Copy birth place"
},
"nationality": {
"message": "Nationality"
},
"copyNationality": {
"message": "Copy nationality"
},
"issuingCountry": {
"message": "Issuing country"
},
"copyIssuingCountry": {
"message": "Copy issuing country"
},
"passportType": {
"message": "Passport type"
},
"copyPassportType": {
"message": "Copy passport type"
},
"nationalIdentificationNumber": {
"message": "National Identification number"
},
"issuingAuthority": {
"message": "Issuing authority / office"
},
"copyIssuingAuthority": {
"message": "Copy issuing authority / office"
},
"issueDate": {
"message": "Issue date"
},
"licenseNumber": {
"message": "License number"
},
Expand Down Expand Up @@ -2165,6 +2246,12 @@
"typeBankAccountSubtitle": {
"message": "Banking details"
},
"typePassport": {
"message": "Passport"
},
"typePassportSubtitle": {
"message": "Travel document"
},
"newItemHeaderLogin": {
"message": "New Login",
"description": "Header for new login item type"
Expand Down Expand Up @@ -5003,6 +5090,12 @@
"copyAddress": {
"message": "Copy address"
},
"copyFirstName": {
"message": "Copy first name"
},
"copyLastName": {
"message": "Copy last name"
},
"myItems": {
"message": "My Items"
},
Expand Down Expand Up @@ -6387,6 +6480,9 @@
"searchBankAccount": {
"message": "Search bank account"
},
"searchPassport": {
"message": "Search passports"
},
"copyAccountNumber": {
"message": "Copy account number"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ describe("ViewComponent", () => {
permissions: {},
card: {},
bankAccount: {},
passport: {},
} as unknown as CipherView;

const mockPasswordRepromptService = {
Expand Down Expand Up @@ -307,6 +308,13 @@ describe("ViewComponent", () => {
flush(); // Resolve all promises

expect(component.headerText).toEqual("viewItemHeaderNote");

// Set header text for a passport
mockCipher.type = CipherType.Passport;
params$.next({ cipherId: mockCipher.id });
flush(); // Resolve all promises

expect(component.headerText).toEqual("viewItemHeaderPassport");
}));

it("sends viewed event", fakeAsync(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ describe("VaultPopupListFiltersService", () => {
CipherType.Login,
CipherType.Card,
CipherType.BankAccount,
CipherType.Passport,
CipherType.Identity,
CipherType.SecureNote,
CipherType.SshKey,
Expand Down
96 changes: 96 additions & 0 deletions apps/desktop/src/locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
"typeBankAccountSubtitle": {
"message": "Banking details"
},
"typePassport": {
"message": "Passport"
},
"typePassportSubtitle": {
"message": "Travel document"
},
"folderSubtitle": {
"message": "Organize your items"
},
Expand Down Expand Up @@ -373,6 +379,51 @@
"passportNumber": {
"message": "Passport number"
},
"dateOfBirth": {
"message": "Date of birth"
},
"sex": {
"message": "Sex"
},
"copySex": {
"message": "Copy sex"
},
"birthPlace": {
"message": "Birth place"
},
"copyBirthPlace": {
"message": "Copy birth place"
},
"nationality": {
"message": "Nationality"
},
"copyNationality": {
"message": "Copy nationality"
},
"issuingCountry": {
"message": "Issuing country"
},
"copyIssuingCountry": {
"message": "Copy issuing country"
},
"passportType": {
"message": "Passport type"
},
"copyPassportType": {
"message": "Copy passport type"
},
"nationalIdentificationNumber": {
"message": "National Identification number"
},
"issuingAuthority": {
"message": "Issuing authority / office"
},
"copyIssuingAuthority": {
"message": "Copy issuing authority / office"
},
"issueDate": {
"message": "Issue date"
},
"licenseNumber": {
"message": "License number"
},
Expand Down Expand Up @@ -560,12 +611,48 @@
"dr": {
"message": "Dr"
},
"birthDay": {
"message": "Birth day"
},
"birthMonth": {
"message": "Birth month"
},
"birthYear": {
"message": "Birth year"
},
"expirationDay": {
"message": "Expiration day"
},
"expirationMonth": {
"message": "Expiration month"
},
"expirationYear": {
"message": "Expiration year"
},
"issueDay": {
"message": "Issue day"
},
"issueMonth": {
"message": "Issue month"
},
"issueYear": {
"message": "Issue year"
},
"enterMonth": {
"message": "Enter month."
},
"enterDay": {
"message": "Enter day."
},
"enterYear": {
"message": "Enter year."
},
"invalidDay": {
"message": "Enter a valid day."
},
"invalidYear": {
"message": "Enter a valid year."
},
"select": {
"message": "Select"
},
Expand Down Expand Up @@ -1739,6 +1826,12 @@
"copyAddress": {
"message": "Copy address"
},
"copyFirstName": {
"message": "Copy first name"
},
"copyLastName": {
"message": "Copy last name"
},
"copyPhone": {
"message": "Copy phone"
},
Expand Down Expand Up @@ -5025,6 +5118,9 @@
"searchBankAccount": {
"message": "Search bank account"
},
"searchPassport": {
"message": "Search passports"
},
"copyAccountNumber": {
"message": "Copy account number"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ export class VaultFilterComponent {
type: CipherType.Card,
icon: "bwi-credit-card",
},
{
id: "passport",
name: this.i18nService.t("typePassport"),
type: CipherType.Passport,
icon: "bwi-globe",
},
{
id: "identity",
name: this.i18nService.t("typeIdentity"),
Expand Down Expand Up @@ -270,6 +276,7 @@ export class VaultFilterComponent {
const excludeTypes: CipherStatus[] = ["favorites"];
if (!newTypesEnabled) {
excludeTypes.push(CipherType.BankAccount);
excludeTypes.push(CipherType.Passport);
}

const builderFilter = {} as VaultFilterList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ export class EmergencyViewDialogComponent {
case CipherType.BankAccount:
this.title = this.i18nService.t("viewItemHeaderBankAccount");
break;
case CipherType.Passport:
this.title = this.i18nService.t("viewItemHeaderPassport");
break;
}
}

Expand Down
7 changes: 7 additions & 0 deletions apps/web/src/app/dirt/event-logs/services/event.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,13 @@ export class EventService {
this.getShortId(ev.cipherId),
);
break;
case EventType.Cipher_ClientCopiedPassportNumber:
msg = this.i18nService.t("copiedPassportNumberItemId", this.formatCipherId(ev, options));
humanReadableMsg = this.i18nService.t(
"copiedPassportNumberItemId",
this.getShortId(ev.cipherId),
);
break;
// Collection
case EventType.Collection_Created:
msg = this.i18nService.t("createdCollectionId", this.formatCollectionId(ev));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,13 @@
</button>
}

@if (isPassportCipher) {
<button type="button" bitMenuItem appCopyField="passportNumber" [cipher]="cipher">
<bit-icon name="bwi-clone" />
{{ "copyPassportNumber" | i18n }}
</button>
}

@if (showMenuDivider) {
<bit-menu-divider></bit-menu-divider>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,10 @@ export class VaultCipherRowComponent<C extends CipherViewLike> implements OnInit
);
}

protected get isPassportCipher(): boolean {
return CipherViewLikeUtils.getType(this.cipher) === this.CipherType.Passport && !this.isDeleted;
}

protected get isSecureNoteCipher() {
return (
CipherViewLikeUtils.getType(this.cipher) === this.CipherType.SecureNote &&
Expand All @@ -398,13 +402,20 @@ export class VaultCipherRowComponent<C extends CipherViewLike> implements OnInit
);
}

protected get hasPassportOptions(): boolean {
return (
this.isPassportCipher && CipherViewLikeUtils.hasCopyableValue(this.cipher, "passportNumber")
);
}

protected get showMenuDivider(): boolean {
return (
this.hasVisibleLoginOptions ||
this.hasVisibleCardOptions ||
this.hasVisibleIdentityOptions ||
this.hasVisibleSecureNoteOptions ||
this.hasBankAccountOptions
this.hasBankAccountOptions ||
this.hasPassportOptions
);
}

Expand Down
Loading
Loading