mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
[PM-10247] Browser Refresh - Fix save credential banner (#10520)
* [PM-10247] Prioritize initialValues when initiating the CipherForm child forms * [PM-10247] Fetch the addEditCipherInfo when opening the cipher form in Browser and override any initialValues if present * [PM-10247] Fix item details section tests * [PM-10247] Add login details section test * [PM-10247] Add autofill options tests * [PM-10247] Undo webpack config change * [PM-10247] Fix failing tests * [PM-10247] Add additional tests for addEditCipherInfo
This commit is contained in:
@@ -95,6 +95,10 @@ export class LoginDetailsSectionComponent implements OnInit {
|
||||
return true;
|
||||
}
|
||||
|
||||
get initialValues() {
|
||||
return this.cipherFormContainer.config.initialValues;
|
||||
}
|
||||
|
||||
constructor(
|
||||
private cipherFormContainer: CipherFormContainer,
|
||||
private formBuilder: FormBuilder,
|
||||
@@ -139,8 +143,8 @@ export class LoginDetailsSectionComponent implements OnInit {
|
||||
|
||||
private initFromExistingCipher(existingLogin: LoginView) {
|
||||
this.loginDetailsForm.patchValue({
|
||||
username: existingLogin.username,
|
||||
password: existingLogin.password,
|
||||
username: this.initialValues?.username ?? existingLogin.username,
|
||||
password: this.initialValues?.password ?? existingLogin.password,
|
||||
totp: existingLogin.totp,
|
||||
});
|
||||
|
||||
@@ -154,8 +158,8 @@ export class LoginDetailsSectionComponent implements OnInit {
|
||||
|
||||
private async initNewCipher() {
|
||||
this.loginDetailsForm.patchValue({
|
||||
username: this.cipherFormContainer.config.initialValues?.username || "",
|
||||
password: "",
|
||||
username: this.initialValues?.username || "",
|
||||
password: this.initialValues?.password || "",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user