subvault operations

This commit is contained in:
Kyle Spearrin 2017-03-30 21:08:07 -04:00
parent 1db6d7f32b
commit 2692bbaa63
3 changed files with 35 additions and 2 deletions

View File

@ -1,7 +1,8 @@
angular
.module('bit.organization')
.controller('organizationSubvaultsController', function ($scope, $state, apiService, $uibModal, cipherService, $filter) {
.controller('organizationSubvaultsController', function ($scope, $state, apiService, $uibModal, cipherService, $filter,
toastr) {
$scope.subvaults = [];
$scope.loading = true;
$scope.$on('$viewContentLoaded', function () {
@ -48,9 +49,17 @@
if (index > -1) {
$scope.subvaults.splice(index, 1);
}
toastr.success(subvault.name + ' has been deleted.', 'Subvault Deleted');
}, function () {
toastr.error(subvault.name + ' was not able to be deleted.', 'Error');
});
};
$scope.users = function (subvault) {
};
function loadList() {
apiService.subvaults.listOrganization({ orgId: $state.params.orgId }, function (list) {
$scope.subvaults = cipherService.decryptSubvaults(list.Data, $state.params.orgId, true);

View File

@ -33,10 +33,29 @@
<button type="button" ng-click="add()" class="btn btn-default btn-flat">Add a Subvault</button>
</div>
<div class="table-responsive" ng-show="subvaults.length">
<table class="table table-striped table-hover">
<table class="table table-striped table-hover table-vmiddle">
<tbody>
<tr ng-repeat="subvault in filteredSubvaults = (subvaults | filter: (filterSearch || '') |
orderBy: ['name'])">
<td style="width: 70px;">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-cog"></i> <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a href="javascript:void(0)" ng-click="users(subvault)">
<i class="fa fa-fw fa-users"></i> Users
</a>
</li>
<li>
<a href="javascript:void(0)" ng-click="delete(subvault)" class="text-red">
<i class="fa fa-fw fa-trash"></i> Delete
</a>
</li>
</ul>
</div>
</td>
<td valign="middle">
<a href="javascript:void(0)" ng-click="edit(subvault)">
{{subvault.name}}

View File

@ -179,6 +179,11 @@ form .btn .loading-icon {
.table td .label {
font-size: 85%;
font-weight: normal;
}
.box-header.with-border + .box-body .table > tbody > tr:first-child > td {
border-top: 0;
}
/* Callouts */