1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-11 05:43:41 +00:00

PM-19102 Autofill new identity information in the popout (#13822)

* PM-17187 Autofill new card information in the popout

* Add new identity autofill to browser extension

* Add ability to save values from autoselect fields
This commit is contained in:
Jeffrey Holland
2025-04-10 08:08:13 +02:00
committed by GitHub
parent 7e2cbbf616
commit 46470cce2a
4 changed files with 142 additions and 1 deletions

View File

@@ -840,7 +840,7 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
return;
}
const clonedNode = formFieldElement.cloneNode() as FillableFormFieldElement;
const clonedNode = formFieldElement.cloneNode(true) as FillableFormFieldElement;
const identityLoginFields: AutofillFieldQualifierType[] = [
AutofillFieldQualifier.identityUsername,
AutofillFieldQualifier.identityEmail,

View File

@@ -488,5 +488,79 @@ const mapAddEditCipherInfoToInitialValues = (
initialValues.username = cipher.identity.username;
}
if (cipher.type == CipherType.Identity) {
const identity = cipher.identity;
if (identity != null) {
if (identity.title != null) {
initialValues.title = identity.title;
}
if (identity.firstName != null) {
initialValues.firstName = identity.firstName;
}
if (identity.middleName != null) {
initialValues.middleName = identity.middleName;
}
if (identity.lastName != null) {
initialValues.lastName = identity.lastName;
}
if (identity.company != null) {
initialValues.company = identity.company;
}
if (identity.ssn != null) {
initialValues.ssn = identity.ssn;
}
if (identity.passportNumber != null) {
initialValues.passportNumber = identity.passportNumber;
}
if (identity.licenseNumber != null) {
initialValues.licenseNumber = identity.licenseNumber;
}
if (identity.email != null) {
initialValues.email = identity.email;
}
if (identity.phone != null) {
initialValues.phone = identity.phone;
}
if (identity.address1 != null) {
initialValues.address1 = identity.address1;
}
if (identity.address2 != null) {
initialValues.address2 = identity.address2;
}
if (identity.address3 != null) {
initialValues.address3 = identity.address3;
}
if (identity.city != null) {
initialValues.city = identity.city;
}
if (identity.state != null) {
initialValues.state = identity.state;
}
if (identity.postalCode != null) {
initialValues.postalCode = identity.postalCode;
}
if (identity.country != null) {
initialValues.country = identity.country;
}
}
}
return initialValues;
};