From c094a26cbfaaf8965a18d7cc820f2e4651d8f518 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 8 Jun 2017 22:25:01 -0400 Subject: [PATCH] copy password from vault listings --- src/app/services/cipherService.js | 3 ++- src/app/vault/vaultController.js | 6 ++++++ src/app/vault/vaultSharedController.js | 6 ++++++ src/app/vault/views/vault.html | 12 ++++++++++++ src/app/vault/views/vaultShared.html | 6 ++++++ 5 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/app/services/cipherService.js b/src/app/services/cipherService.js index a50294df7a..6e9da09895 100644 --- a/src/app/services/cipherService.js +++ b/src/app/services/cipherService.js @@ -57,7 +57,8 @@ angular favorite: encryptedCipher.Favorite, edit: encryptedCipher.Edit, name: _service.decryptProperty(encryptedCipher.Data.Name, key, false), - username: _service.decryptProperty(encryptedCipher.Data.Username, key, true) + username: _service.decryptProperty(encryptedCipher.Data.Username, key, true), + password: _service.decryptProperty(encryptedCipher.Data.Password, key, true) }; return login; diff --git a/src/app/vault/vaultController.js b/src/app/vault/vaultController.js index 5b65db1fa3..e2b05ac0f5 100644 --- a/src/app/vault/vaultController.js +++ b/src/app/vault/vaultController.js @@ -118,6 +118,11 @@ return item.name.toLowerCase(); } + $scope.clipboardError = function (e) { + alert('Your web browser does not support easy clipboard copying. ' + + 'Edit the login and copy it manually instead.'); + }; + $scope.collapseExpand = function (folder, favorite) { if (!$localStorage.collapsedFolders) { $localStorage.collapsedFolders = {}; @@ -147,6 +152,7 @@ login.folderId = returnVal.data.folderId; login.name = returnVal.data.name; login.username = returnVal.data.username; + login.password = returnVal.data.password; login.favorite = returnVal.data.favorite; sortScopedLoginData(); diff --git a/src/app/vault/vaultSharedController.js b/src/app/vault/vaultSharedController.js index c0a3a67f86..74e1c5b469 100644 --- a/src/app/vault/vaultSharedController.js +++ b/src/app/vault/vaultSharedController.js @@ -47,6 +47,11 @@ }); }); + $scope.clipboardError = function (e) { + alert('Your web browser does not support easy clipboard copying. ' + + 'Edit the login and copy it manually instead.'); + }; + $scope.filterByCollection = function (collection) { return function (cipher) { if (!cipher.collectionIds || !cipher.collectionIds.length) { @@ -97,6 +102,7 @@ login.folderId = rootLogin.folderId = returnVal.data.folderId; login.name = rootLogin.name = returnVal.data.name; login.username = rootLogin.username = returnVal.data.username; + login.password = rootLogin.username = returnVal.data.password; login.favorite = rootLogin.favorite = returnVal.data.favorite; } else if (returnVal.action === 'partialEdit') { diff --git a/src/app/vault/views/vault.html b/src/app/vault/views/vault.html index 0e09b7624b..7b80d336bd 100644 --- a/src/app/vault/views/vault.html +++ b/src/app/vault/views/vault.html @@ -71,6 +71,12 @@ Collections +
  • + + Copy Password + +
  • Delete @@ -159,6 +165,12 @@ Collections
  • +
  • + + Copy Password + +
  • Delete diff --git a/src/app/vault/views/vaultShared.html b/src/app/vault/views/vaultShared.html index d37474bdb7..67b0bdd5e2 100644 --- a/src/app/vault/views/vaultShared.html +++ b/src/app/vault/views/vaultShared.html @@ -67,6 +67,12 @@ Collections
  • +
  • + + Copy Password + +