1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-04 01:23:57 +00:00

attachments for org logins

This commit is contained in:
Kyle Spearrin
2017-07-07 15:43:24 -04:00
parent 76da9b1f18
commit abed4df973
13 changed files with 218 additions and 28 deletions

View File

@@ -2,7 +2,7 @@
.module('bit.organization')
.controller('organizationVaultController', function ($scope, apiService, cipherService, $analytics, $q, $state,
$localStorage, $uibModal, $filter) {
$localStorage, $uibModal, $filter, authService) {
$scope.logins = [];
$scope.collections = [];
$scope.loading = true;
@@ -139,6 +139,37 @@
});
};
$scope.attachments = function (login) {
authService.getUserProfile().then(function (profile) {
return !!profile.organizations[login.organizationId].maxStorageGb;
}).then(function (useStorage) {
if (!useStorage) {
$uibModal.open({
animation: true,
templateUrl: 'app/views/paidOrgRequired.html',
controller: 'paidOrgRequiredController',
resolve: {
orgId: function () { return login.organizationId; }
}
});
return;
}
var attachmentModel = $uibModal.open({
animation: true,
templateUrl: 'app/vault/views/vaultAttachments.html',
controller: 'organizationVaultAttachmentsController',
resolve: {
loginId: function () { return login.id; }
}
});
attachmentModel.result.then(function (hasAttachments) {
login.hasAttachments = hasAttachments;
});
});
};
$scope.removeLogin = function (login, collection) {
if (!confirm('Are you sure you want to remove this login (' + login.name + ') from the ' +
'collection (' + collection.name + ') ?')) {