mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-22 11:45:59 +01:00
[fix] Prefill add cipher form from filter data (#2700)
This commit is contained in:
parent
83ccbf2c90
commit
ee43ef9ba1
@ -397,7 +397,7 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
this.addType = type;
|
||||
this.action = "add";
|
||||
this.cipherId = null;
|
||||
this.updateCollectionProperties();
|
||||
this.prefillNewCipherFromFilter();
|
||||
this.go();
|
||||
}
|
||||
|
||||
@ -747,19 +747,21 @@ export class VaultComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
}
|
||||
|
||||
private updateCollectionProperties() {
|
||||
if (this.collectionId != null) {
|
||||
const collection = this.vaultFilterComponent.collections?.fullList?.filter(
|
||||
(c) => c.id === this.collectionId
|
||||
private prefillNewCipherFromFilter() {
|
||||
if (this.activeFilter.selectedCollectionId != null) {
|
||||
const collection = this.vaultFilterComponent.collections.fullList.filter(
|
||||
(c) => c.id === this.activeFilter.selectedCollectionId
|
||||
);
|
||||
if (collection != null && collection.length > 0) {
|
||||
if (collection.length > 0) {
|
||||
this.addOrganizationId = collection[0].organizationId;
|
||||
this.addCollectionIds = [this.collectionId];
|
||||
return;
|
||||
this.addCollectionIds = [this.activeFilter.selectedCollectionId];
|
||||
}
|
||||
} else if (this.activeFilter.selectedOrganizationId) {
|
||||
this.addOrganizationId = this.activeFilter.selectedOrganizationId;
|
||||
}
|
||||
if (this.activeFilter.selectedFolderId && this.activeFilter.selectedFolder) {
|
||||
this.folderId = this.activeFilter.selectedFolderId;
|
||||
}
|
||||
this.addOrganizationId = null;
|
||||
this.addCollectionIds = null;
|
||||
}
|
||||
|
||||
private async canNavigateAway(action: string, cipher?: CipherView) {
|
||||
|
Loading…
Reference in New Issue
Block a user