diff --git a/jslib b/jslib index aa0b274f8f..a98a8bda9b 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit aa0b274f8fd80db620abd4a85c3086f511e19c88 +Subproject commit a98a8bda9bea5b7bb4459cea9413e0f03b2aa068 diff --git a/src/popup/vault/add-edit.component.ts b/src/popup/vault/add-edit.component.ts index b4cda58eee..f32e1cde86 100644 --- a/src/popup/vault/add-edit.component.ts +++ b/src/popup/vault/add-edit.component.ts @@ -43,6 +43,13 @@ export class AddEditComponent extends BaseAddEditComponent { if (params.folderId) { this.folderId = params.folderId; } + if (params.collectionId) { + const collection = this.writeableCollections.filter((c) => c.id === params.collectionId); + if (collection != null && collection.length > 0) { + this.collectionIds = [collection[0].id]; + this.organizationId = collection[0].organizationId; + } + } if (params.type) { const type = parseInt(params.type, null); this.type = type; diff --git a/src/popup/vault/ciphers.component.html b/src/popup/vault/ciphers.component.html index 83066f5f07..af903b2e20 100644 --- a/src/popup/vault/ciphers.component.html +++ b/src/popup/vault/ciphers.component.html @@ -10,7 +10,7 @@ [(ngModel)]="searchText" (input)="search(200)" appAutofocus> -
+
@@ -57,7 +57,7 @@

{{'noItemsInList' | i18n}}

-
diff --git a/src/popup/vault/ciphers.component.ts b/src/popup/vault/ciphers.component.ts index eb9f0941e7..aa9768dd1c 100644 --- a/src/popup/vault/ciphers.component.ts +++ b/src/popup/vault/ciphers.component.ts @@ -45,8 +45,8 @@ const ComponentId = 'CiphersComponent'; export class CiphersComponent extends BaseCiphersComponent implements OnInit, OnDestroy { groupingTitle: string; state: any; - showAdd = true; folderId: string = null; + collectionId: string = null; type: CipherType = null; pagedCiphers: CipherView[] = []; nestedFolders: Array>; @@ -108,15 +108,15 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On } await super.load((c) => c.folderId === this.folderId); } else if (params.collectionId) { - this.showAdd = false; + this.collectionId = params.collectionId; this.searchPlaceholder = this.i18nService.t('searchCollection'); - const collectionNode = await this.collectionService.getNested(params.collectionId); + const collectionNode = await this.collectionService.getNested(this.collectionId); if (collectionNode != null && collectionNode.node != null) { this.groupingTitle = collectionNode.node.name; this.nestedCollections = collectionNode.children != null && collectionNode.children.length > 0 ? collectionNode.children : null; } - await super.load((c) => c.collectionIds != null && c.collectionIds.indexOf(params.collectionId) > -1); + await super.load((c) => c.collectionIds != null && c.collectionIds.indexOf(this.collectionId) > -1); } else { this.groupingTitle = this.i18nService.t('allItems'); await super.load(); @@ -195,7 +195,13 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On addCipher() { super.addCipher(); - this.router.navigate(['/add-cipher'], { queryParams: { folderId: this.folderId, type: this.type } }); + this.router.navigate(['/add-cipher'], { + queryParams: { + folderId: this.folderId, + type: this.type, + collectionId: this.collectionId, + }, + }); } back() {