From afaaf7d73a1a1fde8724eb69ef846a527c7dcdae Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Sat, 25 Feb 2017 22:38:30 -0500 Subject: [PATCH] modal UI for sharing folders/logins from vault --- src/app/vault/vaultController.js | 25 +++++++++++++++++++++++++ src/app/vault/vaultShareController.js | 21 +++++++++++++++++++++ src/app/vault/views/vault.html | 3 ++- src/app/vault/views/vaultShare.html | 26 ++++++++++++++++++++++++++ src/index.html | 1 + 5 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 src/app/vault/vaultShareController.js create mode 100644 src/app/vault/views/vaultShare.html diff --git a/src/app/vault/vaultController.js b/src/app/vault/vaultController.js index c86571d1f0..c3873d9e17 100644 --- a/src/app/vault/vaultController.js +++ b/src/app/vault/vaultController.js @@ -181,4 +181,29 @@ var logins = $filter('filter')($scope.logins, { folderId: folder.id }); return logins.length === 0; }; + + $scope.shareLogin = function (login) { + share(login.id, login.name, false); + }; + + $scope.shareFolder = function (folder) { + share(folder.id, folder.name, true); + }; + + function share(id, name, isFolder) { + var shareModel = $uibModal.open({ + animation: true, + templateUrl: 'app/vault/views/vaultShare.html', + controller: 'vaultShareController', + resolve: { + id: function () { return id; }, + name: function () { return name; }, + isFolder: function () { return isFolder; } + } + }); + + shareModel.result.then(function (result) { + + }); + } }); diff --git a/src/app/vault/vaultShareController.js b/src/app/vault/vaultShareController.js new file mode 100644 index 0000000000..dadc6ca105 --- /dev/null +++ b/src/app/vault/vaultShareController.js @@ -0,0 +1,21 @@ +angular + .module('bit.vault') + + .controller('vaultShareController', function ($scope, apiService, $uibModalInstance, cryptoService, cipherService, + id, name, isFolder, $analytics) { + $analytics.eventTrack('vaultShareController', { category: 'Modal' }); + $scope.cipher = { + id: id, + name: name, + isFolder: isFolder + }; + + $scope.savePromise = null; + $scope.save = function (model) { + $uibModalInstance.close({}); + }; + + $scope.close = function () { + $uibModalInstance.dismiss('cancel'); + }; + }); diff --git a/src/app/vault/views/vault.html b/src/app/vault/views/vault.html index 66174af4cc..e03ce6e27b 100644 --- a/src/app/vault/views/vault.html +++ b/src/app/vault/views/vault.html @@ -16,7 +16,8 @@ {{folder.name}} {{folderLogins.length}} logins
-
diff --git a/src/app/vault/views/vaultShare.html b/src/app/vault/views/vaultShare.html new file mode 100644 index 0000000000..9d01b9158f --- /dev/null +++ b/src/app/vault/views/vaultShare.html @@ -0,0 +1,26 @@ + +
+ + +
\ No newline at end of file diff --git a/src/index.html b/src/index.html index bcb4eec9a1..93e05fbe74 100644 --- a/src/index.html +++ b/src/index.html @@ -115,6 +115,7 @@ +