diff --git a/jslib b/jslib
index cd1828da23..f8d8ca2253 160000
--- a/jslib
+++ b/jslib
@@ -1 +1 @@
-Subproject commit cd1828da23129bd8a53d2891313c6b71ac5c22e3
+Subproject commit f8d8ca225360a0ed05f54642ed89da282d8a1021
diff --git a/src/popup2/vault/add-edit.component.html b/src/popup2/vault/add-edit.component.html
index c19043ea79..aac81019e6 100644
--- a/src/popup2/vault/add-edit.component.html
+++ b/src/popup2/vault/add-edit.component.html
@@ -27,7 +27,7 @@
-
+
diff --git a/src/popup2/vault/add-edit.component.ts b/src/popup2/vault/add-edit.component.ts
index 562ac96e80..268ffb2756 100644
--- a/src/popup2/vault/add-edit.component.ts
+++ b/src/popup2/vault/add-edit.component.ts
@@ -11,6 +11,8 @@ import {
import { ToasterService } from 'angular2-toaster';
import { Angulartics2 } from 'angulartics2';
+import { CipherType } from 'jslib/enums/cipherType';
+
import { AuditService } from 'jslib/abstractions/audit.service';
import { CipherService } from 'jslib/abstractions/cipher.service';
import { FolderService } from 'jslib/abstractions/folder.service';
@@ -40,9 +42,35 @@ export class AddEditComponent extends BaseAddEditComponent implements OnInit {
if (params.cipherId) {
this.cipherId = params.cipherId;
}
+ if (params.folderId) {
+ this.folderId = params.folderId;
+ }
+ if (params.type) {
+ const type = parseInt(params.type, null);
+ this.type = type;
+ }
this.editMode = !params.cipherId;
await this.load();
+
+ if (!this.editMode) {
+ if (params.name) {
+ this.cipher.name = params.name;
+ }
+ if (params.uri) {
+ this.cipher.login.uris[0].uri = params.uri;
+ }
+ }
});
+
+ setTimeout(() => {
+ if (!this.editMode) {
+ if (this.cipher.name != null && this.cipher.name !== '') {
+ document.getElementById('loginUsername').focus();
+ } else {
+ document.getElementById('name').focus();
+ }
+ }
+ }, 200);
}
async submit(): Promise {
diff --git a/src/popup2/vault/ciphers.component.ts b/src/popup2/vault/ciphers.component.ts
index ea2bdb704f..2428481511 100644
--- a/src/popup2/vault/ciphers.component.ts
+++ b/src/popup2/vault/ciphers.component.ts
@@ -38,6 +38,8 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On
searchText: string;
state: any;
showAdd = true;
+ folderId: string = null;
+ type: CipherType = null;
constructor(cipherService: CipherService, private route: ActivatedRoute,
private router: Router, private location: Location,
@@ -52,8 +54,8 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On
this.route.queryParams.subscribe(async (params) => {
if (params.type) {
this.searchPlaceholder = this.i18nService.t('searchType');
- const t = parseInt(params.type, null);
- switch (t) {
+ this.type = parseInt(params.type, null);
+ switch (this.type) {
case CipherType.Login:
this.groupingTitle = this.i18nService.t('logins');
break;
@@ -69,19 +71,19 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On
default:
break;
}
- await super.load((c) => c.type === t);
+ await super.load((c) => c.type === this.type);
} else if (params.folderId) {
- const folderId = params.folderId === 'none' ? null : params.folderId;
+ this.folderId = params.folderId === 'none' ? null : params.folderId;
this.searchPlaceholder = this.i18nService.t('searchFolder');
- if (folderId != null) {
- const folder = await this.folderService.get(folderId);
+ if (this.folderId != null) {
+ const folder = await this.folderService.get(this.folderId);
if (folder != null) {
this.groupingTitle = (await folder.decrypt()).name;
}
} else {
this.groupingTitle = this.i18nService.t('noneFolder');
}
- await super.load((c) => c.folderId === folderId);
+ await super.load((c) => c.folderId === this.folderId);
} else if (params.collectionId) {
this.showAdd = false;
this.searchPlaceholder = this.i18nService.t('searchCollection');
@@ -89,7 +91,7 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On
if (collection != null) {
this.groupingTitle = (await collection.decrypt()).name;
}
- await super.load((c) => c.collectionIds.indexOf(params.collectionId) > -1);
+ await super.load((c) => c.collectionIds != null && c.collectionIds.indexOf(params.collectionId) > -1);
} else {
this.groupingTitle = this.i18nService.t('allItems');
await super.load();
@@ -131,7 +133,7 @@ export class CiphersComponent extends BaseCiphersComponent implements OnInit, On
addCipher() {
super.addCipher();
- this.router.navigate(['/add-cipher']);
+ this.router.navigate(['/add-cipher'], { queryParams: { folderId: this.folderId, type: this.type } });
}
back() {
diff --git a/src/popup2/vault/current-tab.component.html b/src/popup2/vault/current-tab.component.html
index a591105f93..e61671eeff 100644
--- a/src/popup2/vault/current-tab.component.html
+++ b/src/popup2/vault/current-tab.component.html
@@ -17,7 +17,9 @@
- {{'loading' | i18n}}
+
+
+
+ (onSelected)="fillCipher($event)" (onView)="viewCipher($event)"
+ *ngIf="loginCiphers.length">
+
+ {{'autoFillInfo' | i18n}}
+
+
-