From 1ebae5c284c8b6c08d73a57e668b4fb6c065546b Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 27 Apr 2017 09:33:12 -0400 Subject: [PATCH] rename subvault => collection --- src/app/config.js | 20 ++--- .../organizationPeopleController.js | 2 +- .../organizationPeopleEditController.js | 76 +++++++++---------- .../organizationPeopleInviteController.js | 60 +++++++-------- .../organizationSubvaultsAddController.js | 14 ++-- .../organizationSubvaultsController.js | 64 ++++++++-------- .../organizationSubvaultsEditController.js | 20 ++--- .../organizationSubvaultsGroupsController.js | 6 +- .../organizationSubvaultsUsersController.js | 20 ++--- .../organizationVaultController.js | 76 +++++++++---------- ...ganizationVaultLoginSubvaultsController.js | 70 ++++++++--------- .../views/organizationDashboard.html | 8 +- .../views/organizationDelete.html | 2 +- .../views/organizationPeople.html | 4 +- .../views/organizationPeopleEdit.html | 54 ++++++------- .../views/organizationPeopleInvite.html | 54 ++++++------- .../views/organizationSubvaults.html | 36 ++++----- .../views/organizationSubvaultsAdd.html | 6 +- .../views/organizationSubvaultsEdit.html | 12 +-- .../views/organizationSubvaultsGroups.html | 2 +- .../views/organizationSubvaultsUsers.html | 6 +- .../organization/views/organizationVault.html | 42 +++++----- .../organizationVaultLoginSubvaults.html | 28 +++---- src/app/services/apiService.js | 16 ++-- src/app/services/cipherService.js | 48 ++++++------ .../views/settingsCreateOrganization.html | 6 +- src/app/vault/vaultController.js | 8 +- .../vault/vaultLoginSubvaultsController.js | 74 +++++++++--------- src/app/vault/vaultShareController.js | 62 +++++++-------- src/app/vault/vaultSubvaultsController.js | 70 ++++++++--------- src/app/vault/views/vault.html | 8 +- src/app/vault/views/vaultLoginSubvaults.html | 30 ++++---- src/app/vault/views/vaultShare.html | 30 ++++---- src/app/vault/views/vaultSubvaults.html | 48 ++++++------ src/app/views/organizationLayout.html | 6 +- src/app/views/userLayout.html | 6 +- src/index.html | 16 ++-- 37 files changed, 555 insertions(+), 555 deletions(-) diff --git a/src/app/config.js b/src/app/config.js index c696535da9..8e90cd745e 100644 --- a/src/app/config.js +++ b/src/app/config.js @@ -82,11 +82,11 @@ angular refreshFromServer: false } }) - .state('backend.user.subvaults', { - url: '^/subvaults', - templateUrl: 'app/vault/views/vaultSubvaults.html', - controller: 'vaultSubvaultsController', - data: { pageTitle: 'Subvaults' } + .state('backend.user.collections', { + url: '^/collections', + templateUrl: 'app/vault/views/vaultCollections.html', + controller: 'vaultCollectionsController', + data: { pageTitle: 'Collections' } }) .state('backend.user.settings', { url: '^/settings', @@ -134,11 +134,11 @@ angular controller: 'organizationPeopleController', data: { pageTitle: 'Organization People' } }) - .state('backend.org.subvaults', { - url: '/organization/:orgId/subvaults', - templateUrl: 'app/organization/views/organizationSubvaults.html', - controller: 'organizationSubvaultsController', - data: { pageTitle: 'Organization Subvaults' } + .state('backend.org.collections', { + url: '/organization/:orgId/collections', + templateUrl: 'app/organization/views/organizationCollections.html', + controller: 'organizationCollectionsController', + data: { pageTitle: 'Organization Collections' } }) .state('backend.org.settings', { url: '/organization/:orgId/settings', diff --git a/src/app/organization/organizationPeopleController.js b/src/app/organization/organizationPeopleController.js index f4f819e009..308a95e9f9 100644 --- a/src/app/organization/organizationPeopleController.js +++ b/src/app/organization/organizationPeopleController.js @@ -94,7 +94,7 @@ email: list.Data[i].Email, status: list.Data[i].Status, type: list.Data[i].Type, - accessAllSubvaults: list.Data[i].AccessAllSubvaults + accessAllCollections: list.Data[i].AccessAllCollections }; users.push(user); diff --git a/src/app/organization/organizationPeopleEditController.js b/src/app/organization/organizationPeopleEditController.js index af812c59fc..69efd33373 100644 --- a/src/app/organization/organizationPeopleEditController.js +++ b/src/app/organization/organizationPeopleEditController.js @@ -6,88 +6,88 @@ $analytics.eventTrack('organizationPeopleEditController', { category: 'Modal' }); $scope.loading = true; - $scope.subvaults = []; - $scope.selectedSubvaults = {}; + $scope.collections = []; + $scope.selectedCollections = {}; $uibModalInstance.opened.then(function () { - apiService.subvaults.listOrganization({ orgId: $state.params.orgId }, function (list) { - $scope.subvaults = cipherService.decryptSubvaults(list.Data, $state.params.orgId, true); + apiService.collections.listOrganization({ orgId: $state.params.orgId }, function (list) { + $scope.collections = cipherService.decryptCollections(list.Data, $state.params.orgId, true); $scope.loading = false; }); apiService.organizationUsers.get({ orgId: $state.params.orgId, id: id }, function (user) { - var subvaults = {}; - if (user && user.Subvaults) { - for (var i = 0; i < user.Subvaults.Data.length; i++) { - subvaults[user.Subvaults.Data[i].SubvaultId] = { - subvaultId: user.Subvaults.Data[i].SubvaultId, - readOnly: user.Subvaults.Data[i].ReadOnly + var collections = {}; + if (user && user.Collections) { + for (var i = 0; i < user.Collections.Data.length; i++) { + collections[user.Collections.Data[i].CollectionId] = { + collectionId: user.Collections.Data[i].CollectionId, + readOnly: user.Collections.Data[i].ReadOnly }; } } $scope.email = user.Email; $scope.type = user.Type; - $scope.accessAllSubvaults = user.AccessAllSubvaults; - $scope.selectedSubvaults = subvaults; + $scope.accessAllCollections = user.AccessAllCollections; + $scope.selectedCollections = collections; }); }); - $scope.toggleSubvaultSelectionAll = function ($event) { - var subvaults = {}; + $scope.toggleCollectionSelectionAll = function ($event) { + var collections = {}; if ($event.target.checked) { - for (var i = 0; i < $scope.subvaults.length; i++) { - subvaults[$scope.subvaults[i].id] = { - subvaultId: $scope.subvaults[i].id, - readOnly: ($scope.subvaults[i].id in $scope.selectedSubvaults) ? - $scope.selectedSubvaults[$scope.subvaults[i].id].readOnly : false + for (var i = 0; i < $scope.collections.length; i++) { + collections[$scope.collections[i].id] = { + collectionId: $scope.collections[i].id, + readOnly: ($scope.collections[i].id in $scope.selectedCollections) ? + $scope.selectedCollections[$scope.collections[i].id].readOnly : false }; } } - $scope.selectedSubvaults = subvaults; + $scope.selectedCollections = collections; }; - $scope.toggleSubvaultSelection = function (id) { - if (id in $scope.selectedSubvaults) { - delete $scope.selectedSubvaults[id]; + $scope.toggleCollectionSelection = function (id) { + if (id in $scope.selectedCollections) { + delete $scope.selectedCollections[id]; } else { - $scope.selectedSubvaults[id] = { - subvaultId: id, + $scope.selectedCollections[id] = { + collectionId: id, readOnly: false }; } }; - $scope.toggleSubvaultReadOnlySelection = function (id) { - if (id in $scope.selectedSubvaults) { - $scope.selectedSubvaults[id].readOnly = !!!$scope.selectedSubvaults[id].readOnly; + $scope.toggleCollectionReadOnlySelection = function (id) { + if (id in $scope.selectedCollections) { + $scope.selectedCollections[id].readOnly = !!!$scope.selectedCollections[id].readOnly; } }; - $scope.subvaultSelected = function (subvault) { - return subvault.id in $scope.selectedSubvaults; + $scope.collectionSelected = function (collection) { + return collection.id in $scope.selectedCollections; }; $scope.allSelected = function () { - return Object.keys($scope.selectedSubvaults).length === $scope.subvaults.length; + return Object.keys($scope.selectedCollections).length === $scope.collections.length; }; $scope.submitPromise = null; $scope.submit = function (model) { - var subvaults = []; - if (!$scope.accessAllSubvaults) { - for (var subvaultId in $scope.selectedSubvaults) { - if ($scope.selectedSubvaults.hasOwnProperty(subvaultId)) { - subvaults.push($scope.selectedSubvaults[subvaultId]); + var collections = []; + if (!$scope.accessAllCollections) { + for (var collectionId in $scope.selectedCollections) { + if ($scope.selectedCollections.hasOwnProperty(collectionId)) { + collections.push($scope.selectedCollections[collectionId]); } } } $scope.submitPromise = apiService.organizationUsers.put({ orgId: $state.params.orgId, id: id }, { type: $scope.type, - subvaults: subvaults, - accessAllSubvaults: $scope.accessAllSubvaults + collections: collections, + accessAllCollections: $scope.accessAllCollections }, function () { $analytics.eventTrack('Edited User'); $uibModalInstance.close(); diff --git a/src/app/organization/organizationPeopleInviteController.js b/src/app/organization/organizationPeopleInviteController.js index 2d1aff4685..d8ad5c9801 100644 --- a/src/app/organization/organizationPeopleInviteController.js +++ b/src/app/organization/organizationPeopleInviteController.js @@ -6,68 +6,68 @@ $analytics.eventTrack('organizationPeopleInviteController', { category: 'Modal' }); $scope.loading = true; - $scope.subvaults = []; - $scope.selectedSubvaults = {}; + $scope.collections = []; + $scope.selectedCollections = {}; $scope.model = { type: 'User' }; $uibModalInstance.opened.then(function () { - apiService.subvaults.listOrganization({ orgId: $state.params.orgId }, function (list) { - $scope.subvaults = cipherService.decryptSubvaults(list.Data, $state.params.orgId, true); + apiService.collections.listOrganization({ orgId: $state.params.orgId }, function (list) { + $scope.collections = cipherService.decryptCollections(list.Data, $state.params.orgId, true); $scope.loading = false; }); }); - $scope.toggleSubvaultSelectionAll = function ($event) { - var subvaults = {}; + $scope.toggleCollectionSelectionAll = function ($event) { + var collections = {}; if ($event.target.checked) { - for (var i = 0; i < $scope.subvaults.length; i++) { - subvaults[$scope.subvaults[i].id] = { - subvaultId: $scope.subvaults[i].id, - readOnly: ($scope.subvaults[i].id in $scope.selectedSubvaults) ? - $scope.selectedSubvaults[$scope.subvaults[i].id].readOnly : false + for (var i = 0; i < $scope.collections.length; i++) { + collections[$scope.collections[i].id] = { + collectionId: $scope.collections[i].id, + readOnly: ($scope.collections[i].id in $scope.selectedCollections) ? + $scope.selectedCollections[$scope.collections[i].id].readOnly : false }; } } - $scope.selectedSubvaults = subvaults; + $scope.selectedCollections = collections; }; - $scope.toggleSubvaultSelection = function (id) { - if (id in $scope.selectedSubvaults) { - delete $scope.selectedSubvaults[id]; + $scope.toggleCollectionSelection = function (id) { + if (id in $scope.selectedCollections) { + delete $scope.selectedCollections[id]; } else { - $scope.selectedSubvaults[id] = { - subvaultId: id, + $scope.selectedCollections[id] = { + collectionId: id, readOnly: false }; } }; - $scope.toggleSubvaultReadOnlySelection = function (id) { - if (id in $scope.selectedSubvaults) { - $scope.selectedSubvaults[id].readOnly = !!!$scope.selectedSubvaults[id].readOnly; + $scope.toggleCollectionReadOnlySelection = function (id) { + if (id in $scope.selectedCollections) { + $scope.selectedCollections[id].readOnly = !!!$scope.selectedCollections[id].readOnly; } }; - $scope.subvaultSelected = function (subvault) { - return subvault.id in $scope.selectedSubvaults; + $scope.collectionSelected = function (collection) { + return collection.id in $scope.selectedCollections; }; $scope.allSelected = function () { - return Object.keys($scope.selectedSubvaults).length === $scope.subvaults.length; + return Object.keys($scope.selectedCollections).length === $scope.collections.length; }; $scope.submitPromise = null; $scope.submit = function (model) { - var subvaults = []; + var collections = []; - if (!model.accessAllSubvaults) { - for (var subvaultId in $scope.selectedSubvaults) { - if ($scope.selectedSubvaults.hasOwnProperty(subvaultId)) { - subvaults.push($scope.selectedSubvaults[subvaultId]); + if (!model.accessAllCollections) { + for (var collectionId in $scope.selectedCollections) { + if ($scope.selectedCollections.hasOwnProperty(collectionId)) { + collections.push($scope.selectedCollections[collectionId]); } } } @@ -75,8 +75,8 @@ $scope.submitPromise = apiService.organizationUsers.invite({ orgId: $state.params.orgId }, { email: model.email, type: model.type, - subvaults: subvaults, - accessAllSubvaults: model.accessAllSubvaults + collections: collections, + accessAllCollections: model.accessAllCollections }, function () { $analytics.eventTrack('Invited User'); $uibModalInstance.close(); diff --git a/src/app/organization/organizationSubvaultsAddController.js b/src/app/organization/organizationSubvaultsAddController.js index 256d84ce46..d58efe7011 100644 --- a/src/app/organization/organizationSubvaultsAddController.js +++ b/src/app/organization/organizationSubvaultsAddController.js @@ -1,16 +1,16 @@ angular .module('bit.organization') - .controller('organizationSubvaultsAddController', function ($scope, $state, $uibModalInstance, apiService, cipherService, + .controller('organizationCollectionsAddController', function ($scope, $state, $uibModalInstance, apiService, cipherService, $analytics) { - $analytics.eventTrack('organizationSubvaultsAddController', { category: 'Modal' }); + $analytics.eventTrack('organizationCollectionsAddController', { category: 'Modal' }); $scope.submit = function (model) { - var subvault = cipherService.encryptSubvault(model, $state.params.orgId); - $scope.submitPromise = apiService.subvaults.post({ orgId: $state.params.orgId }, subvault, function (response) { - $analytics.eventTrack('Created Subvault'); - var decSubvault = cipherService.decryptSubvault(response, $state.params.orgId, true); - $uibModalInstance.close(decSubvault); + var collection = cipherService.encryptCollection(model, $state.params.orgId); + $scope.submitPromise = apiService.collections.post({ orgId: $state.params.orgId }, collection, function (response) { + $analytics.eventTrack('Created Collection'); + var decCollection = cipherService.decryptCollection(response, $state.params.orgId, true); + $uibModalInstance.close(decCollection); }).$promise; }; diff --git a/src/app/organization/organizationSubvaultsController.js b/src/app/organization/organizationSubvaultsController.js index 072b47fe2f..c761fab26a 100644 --- a/src/app/organization/organizationSubvaultsController.js +++ b/src/app/organization/organizationSubvaultsController.js @@ -1,9 +1,9 @@ angular .module('bit.organization') - .controller('organizationSubvaultsController', function ($scope, $state, apiService, $uibModal, cipherService, $filter, + .controller('organizationCollectionsController', function ($scope, $state, apiService, $uibModal, cipherService, $filter, toastr, $analytics) { - $scope.subvaults = []; + $scope.collections = []; $scope.loading = true; $scope.$on('$viewContentLoaded', function () { loadList(); @@ -12,41 +12,41 @@ $scope.add = function () { var modal = $uibModal.open({ animation: true, - templateUrl: 'app/organization/views/organizationSubvaultsAdd.html', - controller: 'organizationSubvaultsAddController' + templateUrl: 'app/organization/views/organizationCollectionsAdd.html', + controller: 'organizationCollectionsAddController' }); - modal.result.then(function (subvault) { - $scope.subvaults.push(subvault); + modal.result.then(function (collection) { + $scope.collections.push(collection); }); }; - $scope.edit = function (subvault) { + $scope.edit = function (collection) { var modal = $uibModal.open({ animation: true, - templateUrl: 'app/organization/views/organizationSubvaultsEdit.html', - controller: 'organizationSubvaultsEditController', + templateUrl: 'app/organization/views/organizationCollectionsEdit.html', + controller: 'organizationCollectionsEditController', resolve: { - id: function () { return subvault.id; } + id: function () { return collection.id; } } }); - modal.result.then(function (editedSubvault) { - var existingSubvaults = $filter('filter')($scope.subvaults, { id: editedSubvault.id }, true); - if (existingSubvaults && existingSubvaults.length > 0) { - existingSubvaults[0].name = editedSubvault.name; + modal.result.then(function (editedCollection) { + var existingCollections = $filter('filter')($scope.collections, { id: editedCollection.id }, true); + if (existingCollections && existingCollections.length > 0) { + existingCollections[0].name = editedCollection.name; } }); }; - $scope.users = function (subvault) { + $scope.users = function (collection) { var modal = $uibModal.open({ animation: true, - templateUrl: 'app/organization/views/organizationSubvaultsUsers.html', - controller: 'organizationSubvaultsUsersController', + templateUrl: 'app/organization/views/organizationCollectionsUsers.html', + controller: 'organizationCollectionsUsersController', size: 'lg', resolve: { - subvault: function () { return subvault; } + collection: function () { return collection; } } }); @@ -55,13 +55,13 @@ }); }; - $scope.groups = function (subvault) { + $scope.groups = function (collection) { var modal = $uibModal.open({ animation: true, - templateUrl: 'app/organization/views/organizationSubvaultsGroups.html', - controller: 'organizationSubvaultsGroupsController', + templateUrl: 'app/organization/views/organizationCollectionsGroups.html', + controller: 'organizationCollectionsGroupsController', resolve: { - subvault: function () { return subvault; } + collection: function () { return collection; } } }); @@ -70,27 +70,27 @@ }); }; - $scope.delete = function (subvault) { - if (!confirm('Are you sure you want to delete this subvault (' + subvault.name + ')?')) { + $scope.delete = function (collection) { + if (!confirm('Are you sure you want to delete this collection (' + collection.name + ')?')) { return; } - apiService.subvaults.del({ orgId: $state.params.orgId, id: subvault.id }, function () { - var index = $scope.subvaults.indexOf(subvault); + apiService.collections.del({ orgId: $state.params.orgId, id: collection.id }, function () { + var index = $scope.collections.indexOf(collection); if (index > -1) { - $scope.subvaults.splice(index, 1); + $scope.collections.splice(index, 1); } - $analytics.eventTrack('Deleted Subvault'); - toastr.success(subvault.name + ' has been deleted.', 'Subvault Deleted'); + $analytics.eventTrack('Deleted Collection'); + toastr.success(collection.name + ' has been deleted.', 'Collection Deleted'); }, function () { - toastr.error(subvault.name + ' was not able to be deleted.', 'Error'); + toastr.error(collection.name + ' was not able to be deleted.', 'Error'); }); }; function loadList() { - apiService.subvaults.listOrganization({ orgId: $state.params.orgId }, function (list) { - $scope.subvaults = cipherService.decryptSubvaults(list.Data, $state.params.orgId, true); + apiService.collections.listOrganization({ orgId: $state.params.orgId }, function (list) { + $scope.collections = cipherService.decryptCollections(list.Data, $state.params.orgId, true); $scope.loading = false; }); } diff --git a/src/app/organization/organizationSubvaultsEditController.js b/src/app/organization/organizationSubvaultsEditController.js index ed5a7f2443..80ba1eabcd 100644 --- a/src/app/organization/organizationSubvaultsEditController.js +++ b/src/app/organization/organizationSubvaultsEditController.js @@ -1,23 +1,23 @@ angular .module('bit.organization') - .controller('organizationSubvaultsEditController', function ($scope, $state, $uibModalInstance, apiService, cipherService, + .controller('organizationCollectionsEditController', function ($scope, $state, $uibModalInstance, apiService, cipherService, $analytics, id) { - $analytics.eventTrack('organizationSubvaultsEditController', { category: 'Modal' }); - $scope.subvault = {}; + $analytics.eventTrack('organizationCollectionsEditController', { category: 'Modal' }); + $scope.collection = {}; $uibModalInstance.opened.then(function () { - apiService.subvaults.get({ orgId: $state.params.orgId, id: id }, function (subvault) { - $scope.subvault = cipherService.decryptSubvault(subvault); + apiService.collections.get({ orgId: $state.params.orgId, id: id }, function (collection) { + $scope.collection = cipherService.decryptCollection(collection); }); }); $scope.submit = function (model) { - var subvault = cipherService.encryptSubvault(model, $state.params.orgId); - $scope.submitPromise = apiService.subvaults.put({ orgId: $state.params.orgId }, subvault, function (response) { - $analytics.eventTrack('Edited Subvault'); - var decSubvault = cipherService.decryptSubvault(response, $state.params.orgId, true); - $uibModalInstance.close(decSubvault); + var collection = cipherService.encryptCollection(model, $state.params.orgId); + $scope.submitPromise = apiService.collections.put({ orgId: $state.params.orgId }, collection, function (response) { + $analytics.eventTrack('Edited Collection'); + var decCollection = cipherService.decryptCollection(response, $state.params.orgId, true); + $uibModalInstance.close(decCollection); }).$promise; }; diff --git a/src/app/organization/organizationSubvaultsGroupsController.js b/src/app/organization/organizationSubvaultsGroupsController.js index 0016d23624..170dd2f349 100644 --- a/src/app/organization/organizationSubvaultsGroupsController.js +++ b/src/app/organization/organizationSubvaultsGroupsController.js @@ -1,9 +1,9 @@ angular .module('bit.organization') - .controller('organizationSubvaultsGroupsController', function ($scope, $state, $uibModalInstance, subvault, $analytics) { - $analytics.eventTrack('organizationSubvaultsGroupsController', { category: 'Modal' }); - $scope.subvault = subvault; + .controller('organizationCollectionsGroupsController', function ($scope, $state, $uibModalInstance, collection, $analytics) { + $analytics.eventTrack('organizationCollectionsGroupsController', { category: 'Modal' }); + $scope.collection = collection; $scope.close = function () { $uibModalInstance.dismiss('cancel'); diff --git a/src/app/organization/organizationSubvaultsUsersController.js b/src/app/organization/organizationSubvaultsUsersController.js index 38bcda19c8..30967da2af 100644 --- a/src/app/organization/organizationSubvaultsUsersController.js +++ b/src/app/organization/organizationSubvaultsUsersController.js @@ -1,19 +1,19 @@ angular .module('bit.organization') - .controller('organizationSubvaultsUsersController', function ($scope, $state, $uibModalInstance, apiService, cipherService, - $analytics, subvault, toastr) { - $analytics.eventTrack('organizationSubvaultsUsersController', { category: 'Modal' }); + .controller('organizationCollectionsUsersController', function ($scope, $state, $uibModalInstance, apiService, cipherService, + $analytics, collection, toastr) { + $analytics.eventTrack('organizationCollectionsUsersController', { category: 'Modal' }); $scope.loading = true; - $scope.subvault = subvault; + $scope.collection = collection; $scope.users = []; $uibModalInstance.opened.then(function () { $scope.loading = false; - apiService.subvaultUsers.listSubvault( + apiService.collectionUsers.listCollection( { orgId: $state.params.orgId, - subvaultId: subvault.id + collectionId: collection.id }, function (userList) { if (userList && userList.Data.length) { @@ -27,7 +27,7 @@ type: userList.Data[i].Type, status: userList.Data[i].Status, readOnly: userList.Data[i].ReadOnly, - accessAllSubvaults: userList.Data[i].AccessAllSubvaults + accessAllCollections: userList.Data[i].AccessAllCollections }); } $scope.users = users; @@ -37,13 +37,13 @@ $scope.remove = function (user) { if (!confirm('Are you sure you want to remove this user (' + user.email + ') from this ' + - 'subvault (' + subvault.name + ')?')) { + 'collection (' + collection.name + ')?')) { return; } - apiService.subvaultUsers.del({ orgId: $state.params.orgId, id: user.id }, null, function () { + apiService.collectionUsers.del({ orgId: $state.params.orgId, id: user.id }, null, function () { toastr.success(user.email + ' has been removed.', 'User Removed'); - $analytics.eventTrack('Removed User From Subvault'); + $analytics.eventTrack('Removed User From Collection'); var index = $scope.users.indexOf(user); if (index > -1) { $scope.users.splice(index, 1); diff --git a/src/app/organization/organizationVaultController.js b/src/app/organization/organizationVaultController.js index 1b3b251344..f72a4c9b8f 100644 --- a/src/app/organization/organizationVaultController.js +++ b/src/app/organization/organizationVaultController.js @@ -4,25 +4,25 @@ .controller('organizationVaultController', function ($scope, apiService, cipherService, $analytics, $q, $state, $localStorage, $uibModal, $filter) { $scope.logins = []; - $scope.subvaults = []; + $scope.collections = []; $scope.loading = true; $scope.$on('$viewContentLoaded', function () { - var subvaultPromise = apiService.subvaults.listOrganization({ orgId: $state.params.orgId }, function (subvaults) { - var decSubvaults = [{ + var collectionPromise = apiService.collections.listOrganization({ orgId: $state.params.orgId }, function (collections) { + var decCollections = [{ id: null, name: 'Unassigned', - collapsed: $localStorage.collapsedOrgSubvaults && 'unassigned' in $localStorage.collapsedOrgSubvaults + collapsed: $localStorage.collapsedOrgCollections && 'unassigned' in $localStorage.collapsedOrgCollections }]; - for (var i = 0; i < subvaults.Data.length; i++) { - var decSubvault = cipherService.decryptSubvault(subvaults.Data[i], null, true); - decSubvault.collapsed = $localStorage.collapsedOrgSubvaults && - decSubvault.id in $localStorage.collapsedOrgSubvaults; - decSubvaults.push(decSubvault); + for (var i = 0; i < collections.Data.length; i++) { + var decCollection = cipherService.decryptCollection(collections.Data[i], null, true); + decCollection.collapsed = $localStorage.collapsedOrgCollections && + decCollection.id in $localStorage.collapsedOrgCollections; + decCollections.push(decCollection); } - $scope.subvaults = decSubvaults; + $scope.collections = decCollections; }).$promise; var cipherPromise = apiService.ciphers.listOrganizationDetails({ organizationId: $state.params.orgId }, @@ -39,22 +39,22 @@ $scope.logins = decLogins; }).$promise; - $q.all([subvaultPromise, cipherPromise]).then(function () { + $q.all([collectionPromise, cipherPromise]).then(function () { $scope.loading = false; }); }); - $scope.filterBySubvault = function (subvault) { + $scope.filterByCollection = function (collection) { return function (cipher) { - if (!cipher.subvaultIds || !cipher.subvaultIds.length) { - return subvault.id === null; + if (!cipher.collectionIds || !cipher.collectionIds.length) { + return collection.id === null; } - return cipher.subvaultIds.indexOf(subvault.id) > -1; + return cipher.collectionIds.indexOf(collection.id) > -1; }; }; - $scope.subvaultSort = function (item) { + $scope.collectionSort = function (item) { if (!item.id) { return ''; } @@ -62,58 +62,58 @@ return item.name.toLowerCase(); }; - $scope.collapseExpand = function (subvault) { - if (!$localStorage.collapsedOrgSubvaults) { - $localStorage.collapsedOrgSubvaults = {}; + $scope.collapseExpand = function (collection) { + if (!$localStorage.collapsedOrgCollections) { + $localStorage.collapsedOrgCollections = {}; } - var id = subvault.id || 'unassigned'; + var id = collection.id || 'unassigned'; - if (id in $localStorage.collapsedOrgSubvaults) { - delete $localStorage.collapsedOrgSubvaults[id]; + if (id in $localStorage.collapsedOrgCollections) { + delete $localStorage.collapsedOrgCollections[id]; } else { - $localStorage.collapsedOrgSubvaults[id] = true; + $localStorage.collapsedOrgCollections[id] = true; } }; - $scope.editSubvaults = function (cipher) { + $scope.editCollections = function (cipher) { var modal = $uibModal.open({ animation: true, - templateUrl: 'app/organization/views/organizationVaultLoginSubvaults.html', - controller: 'organizationVaultLoginSubvaultsController', + templateUrl: 'app/organization/views/organizationVaultLoginCollections.html', + controller: 'organizationVaultLoginCollectionsController', resolve: { cipher: function () { return cipher; }, - subvaults: function () { return $scope.subvaults; } + collections: function () { return $scope.collections; } } }); modal.result.then(function (response) { - if (response.subvaultIds) { - cipher.subvaultIds = response.subvaultIds; + if (response.collectionIds) { + cipher.collectionIds = response.collectionIds; } }); }; - $scope.removeLogin = function (login, subvault) { + $scope.removeLogin = function (login, collection) { if (!confirm('Are you sure you want to remove this login (' + login.name + ') from the ' + - 'subvault (' + subvault.name + ') ?')) { + 'collection (' + collection.name + ') ?')) { return; } var request = { - subvaultIds: [] + collectionIds: [] }; - for (var i = 0; i < login.subvaultIds.length; i++) { - if (login.subvaultIds[i] !== subvault.id) { - request.subvaultIds.push(login.subvaultIds[i]); + for (var i = 0; i < login.collectionIds.length; i++) { + if (login.collectionIds[i] !== collection.id) { + request.collectionIds.push(login.collectionIds[i]); } } - apiService.ciphers.putSubvaults({ id: login.id }, request).$promise.then(function (response) { - $analytics.eventTrack('Removed Login From Subvault'); - login.subvaultIds = request.subvaultIds; + apiService.ciphers.putCollections({ id: login.id }, request).$promise.then(function (response) { + $analytics.eventTrack('Removed Login From Collection'); + login.collectionIds = request.collectionIds; }); }; diff --git a/src/app/organization/organizationVaultLoginSubvaultsController.js b/src/app/organization/organizationVaultLoginSubvaultsController.js index 5ebf07b547..4dbd3e6e5a 100644 --- a/src/app/organization/organizationVaultLoginSubvaultsController.js +++ b/src/app/organization/organizationVaultLoginSubvaultsController.js @@ -1,78 +1,78 @@ angular .module('bit.organization') - .controller('organizationVaultLoginSubvaultsController', function ($scope, apiService, $uibModalInstance, cipherService, - cipher, $analytics, subvaults) { - $analytics.eventTrack('organizationVaultLoginSubvaultsController', { category: 'Modal' }); + .controller('organizationVaultLoginCollectionsController', function ($scope, apiService, $uibModalInstance, cipherService, + cipher, $analytics, collections) { + $analytics.eventTrack('organizationVaultLoginCollectionsController', { category: 'Modal' }); $scope.cipher = {}; - $scope.subvaults = []; - $scope.selectedSubvaults = {}; + $scope.collections = []; + $scope.selectedCollections = {}; $uibModalInstance.opened.then(function () { - var subvaultUsed = []; - for (var i = 0; i < subvaults.length; i++) { - if (subvaults[i].id) { - subvaultUsed.push(subvaults[i]); + var collectionUsed = []; + for (var i = 0; i < collections.length; i++) { + if (collections[i].id) { + collectionUsed.push(collections[i]); } } - $scope.subvaults = subvaultUsed; + $scope.collections = collectionUsed; $scope.cipher = cipher; - var selectedSubvaults = {}; - if ($scope.cipher.subvaultIds) { - for (i = 0; i < $scope.cipher.subvaultIds.length; i++) { - selectedSubvaults[$scope.cipher.subvaultIds[i]] = true; + var selectedCollections = {}; + if ($scope.cipher.collectionIds) { + for (i = 0; i < $scope.cipher.collectionIds.length; i++) { + selectedCollections[$scope.cipher.collectionIds[i]] = true; } } - $scope.selectedSubvaults = selectedSubvaults; + $scope.selectedCollections = selectedCollections; }); - $scope.toggleSubvaultSelectionAll = function ($event) { - var subvaults = {}; + $scope.toggleCollectionSelectionAll = function ($event) { + var collections = {}; if ($event.target.checked) { - for (var i = 0; i < $scope.subvaults.length; i++) { - subvaults[$scope.subvaults[i].id] = true; + for (var i = 0; i < $scope.collections.length; i++) { + collections[$scope.collections[i].id] = true; } } - $scope.selectedSubvaults = subvaults; + $scope.selectedCollections = collections; }; - $scope.toggleSubvaultSelection = function (id) { - if (id in $scope.selectedSubvaults) { - delete $scope.selectedSubvaults[id]; + $scope.toggleCollectionSelection = function (id) { + if (id in $scope.selectedCollections) { + delete $scope.selectedCollections[id]; } else { - $scope.selectedSubvaults[id] = true; + $scope.selectedCollections[id] = true; } }; - $scope.subvaultSelected = function (subvault) { - return subvault.id in $scope.selectedSubvaults; + $scope.collectionSelected = function (collection) { + return collection.id in $scope.selectedCollections; }; $scope.allSelected = function () { - return Object.keys($scope.selectedSubvaults).length === $scope.subvaults.length; + return Object.keys($scope.selectedCollections).length === $scope.collections.length; }; $scope.submit = function () { var request = { - subvaultIds: [] + collectionIds: [] }; - for (var id in $scope.selectedSubvaults) { - if ($scope.selectedSubvaults.hasOwnProperty(id)) { - request.subvaultIds.push(id); + for (var id in $scope.selectedCollections) { + if ($scope.selectedCollections.hasOwnProperty(id)) { + request.collectionIds.push(id); } } - $scope.submitPromise = apiService.ciphers.putSubvaultsAdmin({ id: cipher.id }, request) + $scope.submitPromise = apiService.ciphers.putCollectionsAdmin({ id: cipher.id }, request) .$promise.then(function (response) { - $analytics.eventTrack('Edited Login Subvaults'); + $analytics.eventTrack('Edited Login Collections'); $uibModalInstance.close({ - action: 'subvaultsEdit', - subvaultIds: request.subvaultIds + action: 'collectionsEdit', + collectionIds: request.collectionIds }); }); }; diff --git a/src/app/organization/views/organizationDashboard.html b/src/app/organization/views/organizationDashboard.html index 5ca7355ec6..be3edc186d 100644 --- a/src/app/organization/views/organizationDashboard.html +++ b/src/app/organization/views/organizationDashboard.html @@ -8,7 +8,7 @@

Organization Disabled

- This organization is currently disabled. Users will not see your shared logins or subvaults. + This organization is currently disabled. Users will not see your shared logins or collections. Contact us if you would like to reinstate this organization.

@@ -20,12 +20,12 @@

Let's Get Started!

-

Dashboard features are coming soon. Get started by inviting users and creating your subvaults.

+

Dashboard features are coming soon. Get started by inviting users and creating your collections.

Invite Users - - Manage Subvaults + + Manage Collections
diff --git a/src/app/organization/views/organizationDelete.html b/src/app/organization/views/organizationDelete.html index 4f4db0d84b..96941a9d31 100644 --- a/src/app/organization/views/organizationDelete.html +++ b/src/app/organization/views/organizationDelete.html @@ -5,7 +5,7 @@
-

Subvault Access

+

Collection Access

-
-
- Loading subvaults... +
+
+ Loading collections...
-
-

No subvaults for your organization.

+
+

No collections for your organization.

-
+
- + diff --git a/src/app/organization/views/organizationPeopleInvite.html b/src/app/organization/views/organizationPeopleInvite.html index a55be3a28e..cc06d4bafe 100644 --- a/src/app/organization/views/organizationPeopleInvite.html +++ b/src/app/organization/views/organizationPeopleInvite.html @@ -23,13 +23,13 @@
@@ -39,60 +39,60 @@
-

Subvault Access

+

Collection Access

-
-
- Loading subvaults... +
+
+ Loading collections...
-
-

No subvaults for your organization.

+
+

No collections for your organization.

-
+
+ ng-click="toggleCollectionSelectionAll($event)"> Name Read Only
+ name="selectedCollections[]" + value="{{collection.id}}" + ng-checked="collectionSelected(collection)" + ng-click="toggleCollectionSelection(collection.id)"> - {{subvault.name}} + {{collection.name}} + name="selectedCollectionsReadonly[]" + value="{{collection.id}}" + ng-disabled="!collectionSelected(collection)" + ng-checked="collectionSelected(collection) && selectedCollections[collection.id].readOnly" + ng-click="toggleCollectionReadOnlySelection(collection.id)">
- + diff --git a/src/app/organization/views/organizationSubvaults.html b/src/app/organization/views/organizationSubvaults.html index 680afd7127..4c7f1c731b 100644 --- a/src/app/organization/views/organizationSubvaults.html +++ b/src/app/organization/views/organizationSubvaults.html @@ -1,6 +1,6 @@ 

- Subvaults + Collections share with your organization

@@ -10,33 +10,33 @@  
-
-
+
+
Loading...
-
- No subvaults to list. +
+ No collections to list.
-
-

There are no subvaults yet for your organization.

- +
+

There are no collections yet for your organization.

+
-
+
+ ng-click="toggleCollectionSelectionAll($event)"> Name Read Only
+ name="selectedCollections[]" + value="{{collection.id}}" + ng-checked="collectionSelected(collection)" + ng-click="toggleCollectionSelection(collection.id)"> - {{subvault.name}} + {{collection.name}} + name="selectedCollectionsReadonly[]" + value="{{collection.id}}" + ng-disabled="!collectionSelected(collection)" + ng-checked="collectionSelected(collection) && selectedCollections[collection.id].readOnly" + ng-click="toggleCollectionReadOnlySelection(collection.id)">
- + diff --git a/src/app/organization/views/organizationSubvaultsAdd.html b/src/app/organization/views/organizationSubvaultsAdd.html index 035ab1f506..a7991339a8 100644 --- a/src/app/organization/views/organizationSubvaultsAdd.html +++ b/src/app/organization/views/organizationSubvaultsAdd.html @@ -1,6 +1,6 @@ 
- - {{subvault.name}} + + {{collection.name}}
- + diff --git a/src/app/organization/views/organizationVault.html b/src/app/organization/views/organizationVault.html index 3fd7cc021d..0f2df3d238 100644 --- a/src/app/organization/views/organizationVault.html +++ b/src/app/organization/views/organizationVault.html @@ -3,37 +3,37 @@ Org Vault , + count="collections.length > 0 ? collections.length - 1 : 0" + when="{'1': '{} collection', 'other': '{} collections'}">,
-

Loading...

-
+

Loading...

+

- - {{subvault.name}} - + + {{collection.name}} +

-
-
No logins in this subvault.
-
No unassigned logins.
-
+
+
No logins in this collection.
+
No unassigned logins.
+
- diff --git a/src/app/organization/views/organizationVaultLoginSubvaults.html b/src/app/organization/views/organizationVaultLoginSubvaults.html index 3f163d4646..9dd9ee1850 100644 --- a/src/app/organization/views/organizationVaultLoginSubvaults.html +++ b/src/app/organization/views/organizationVaultLoginSubvaults.html @@ -1,42 +1,42 @@ 
@@ -42,13 +42,13 @@
- {{login.name}} + {{login.name}}
{{login.username}}
- + - @@ -44,7 +44,7 @@
+ ng-click="toggleCollectionSelectionAll($event)"> Name
+ name="selectedCollections[]" + value="{{collection.id}}" + ng-checked="collectionSelected(collection)" + ng-click="toggleCollectionSelection(collection.id)"> - {{subvault.name}} + + {{collection.name}}
- + - @@ -47,7 +47,7 @@ -

Subvault Access

-
+

Collection Access

+

Loading...

-
-

No Subvaults

-

You do not have write access to any subvaults for this organization.

+
+

No Collections

+

You do not have write access to any collections for this organization.

-
+
+ ng-click="toggleCollectionSelectionAll($event)"> Name
+ name="selectedCollections[]" + value="{{collection.id}}" + ng-checked="collectionSelected(collection)" + ng-click="toggleCollectionSelection(collection.id)"> - {{subvault.name}} + + {{collection.name}}
- + - diff --git a/src/app/vault/views/vaultSubvaults.html b/src/app/vault/views/vaultSubvaults.html index b0b4cd230e..32f0884b3a 100644 --- a/src/app/vault/views/vaultSubvaults.html +++ b/src/app/vault/views/vaultSubvaults.html @@ -1,57 +1,57 @@ 

- Subvaults + Collections - , + ,

-
+

Loading...

-
-

No Subvaults

+
+

No Collections

- You do not have any subvaults being shared with you. + You do not have any collections being shared with you.

- Subvaults allow you to share logins with other bitwarden users. To start using subvaults create an organization or + Collections allow you to share logins with other bitwarden users. To start using collections create an organization or ask an existing organization to invite you.

Create an Organization
-
+

- {{subvault.name}} - + {{collection.name}} +

-
-
-

No logins in this subvault.

+
+
+

No logins in this collection.

- Share a login to this subvault by selecting Share or - Subvaults from the login's options () menu. + Share a login to this collection by selecting Share or + Collections from the login's options () menu.

-
+
+ ng-click="toggleCollectionSelectionAll($event)"> Name
+ name="selectedCollections[]" + value="{{collection.id}}" + ng-checked="collectionSelected(collection)" + ng-click="toggleCollectionSelection(collection.id)"> - {{subvault.name}} + + {{collection.name}}
-
@@ -65,12 +65,12 @@
  • - - Subvaults + + Collections
  • - + Remove
  • diff --git a/src/app/views/organizationLayout.html b/src/app/views/organizationLayout.html index c50cb2452b..d8623dca1b 100644 --- a/src/app/views/organizationLayout.html +++ b/src/app/views/organizationLayout.html @@ -41,9 +41,9 @@ Vault -
  • - - Subvaults +
  • + + Collections
  • diff --git a/src/app/views/userLayout.html b/src/app/views/userLayout.html index b9dfe04734..1325cb5839 100644 --- a/src/app/views/userLayout.html +++ b/src/app/views/userLayout.html @@ -54,11 +54,11 @@
  • -
  • - +
  • + NEW - Subvaults + Collections
  • diff --git a/src/index.html b/src/index.html index fd966efe20..5b4941aefc 100644 --- a/src/index.html +++ b/src/index.html @@ -126,18 +126,18 @@ - - + + - - - - + + + + @@ -145,9 +145,9 @@ - + - +