1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

[PM-9190] Use updateFn for patchCipher so that the current CipherView is available for context (#10258)

This commit is contained in:
Shane Melton
2024-07-25 07:50:39 -07:00
committed by GitHub
parent 14f51544c7
commit f4023762a8
13 changed files with 175 additions and 124 deletions

View File

@@ -110,12 +110,15 @@ export class ItemDetailsSectionComponent implements OnInit {
map(() => this.itemDetailsForm.getRawValue()),
)
.subscribe((value) => {
this.cipherFormContainer.patchCipher({
name: value.name,
organizationId: value.organizationId,
folderId: value.folderId,
collectionIds: value.collectionIds?.map((c) => c.id) || [],
favorite: value.favorite,
this.cipherFormContainer.patchCipher((cipher) => {
Object.assign(cipher, {
name: value.name,
organizationId: value.organizationId,
folderId: value.folderId,
collectionIds: value.collectionIds?.map((c) => c.id) || [],
favorite: value.favorite,
} as CipherView);
return cipher;
});
});
}
@@ -212,7 +215,6 @@ export class ItemDetailsSectionComponent implements OnInit {
this.itemDetailsForm.controls.favorite.enable();
this.itemDetailsForm.controls.folderId.enable();
} else if (this.config.mode === "edit") {
//
this.readOnlyCollections = this.collections
.filter(
(c) => c.readOnly && this.originalCipherView.collectionIds.includes(c.id as CollectionId),