ui updates for vault logins list

This commit is contained in:
Kyle Spearrin 2017-03-25 16:09:06 -04:00
parent 636c709671
commit 3c83741b13
4 changed files with 27 additions and 16 deletions

View File

@ -1,11 +1,13 @@
angular
.module('bit.vault')
.controller('vaultAddLoginController', function ($scope, apiService, $uibModalInstance, cryptoService, cipherService, passwordService, folders, selectedFolder, $analytics) {
.controller('vaultAddLoginController', function ($scope, apiService, $uibModalInstance, cryptoService, cipherService,
passwordService, folders, selectedFolder, $analytics, checkedFavorite) {
$analytics.eventTrack('vaultAddLoginController', { category: 'Modal' });
$scope.folders = folders;
$scope.login = {
folderId: selectedFolder ? selectedFolder.id : null
folderId: selectedFolder ? selectedFolder.id : null,
favorite: checkedFavorite === true
};
$scope.savePromise = null;

View File

@ -92,14 +92,15 @@
$scope.addLogin();
});
$scope.addLogin = function (folder) {
$scope.addLogin = function (folder, favorite) {
var addModel = $uibModal.open({
animation: true,
templateUrl: 'app/vault/views/vaultAddLogin.html',
controller: 'vaultAddLoginController',
resolve: {
folders: function () { return $scope.folders; },
selectedFolder: function () { return folder; }
selectedFolder: function () { return folder; },
checkedFavorite: function () { return favorite; }
}
});

View File

@ -23,7 +23,7 @@
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
<li>
<a href="#" ng-click="addLogin()">Add Login</a>
<a href="#" ng-click="addLogin(null, true)">Add Login</a>
</li>
</ul>
</div>
@ -35,7 +35,7 @@
<div class="box-body" ng-class="{'no-padding': favoriteLogins.length}">
<div ng-show="!favoriteLogins.length">
<p>No favorite logins.</p>
<button type="button" ng-click="addLogin()" class="btn btn-default btn-flat">Add a Login</button>
<button type="button" ng-click="addLogin(null, true)" class="btn btn-default btn-flat">Add a Login</button>
</div>
<div class="table-responsive" ng-show="favoriteLogins.length">
<table class="table table-striped table-hover table-selectable">
@ -54,15 +54,17 @@
uib-tooltip="Delete">
<i class="fa fa-lg fa-trash"></i>
</button>
<div class="tooltip-wrapper"
uib-tooltip="{{login.organizationId ? 'Already shared.' : 'Share'}}">
<button type="button" ng-click="share(login)" class="btn btn-link btn-table"
uib-tooltip="Share">
ng-disabled="login.organizationId !== null">
<i class="fa fa-lg fa-share-alt"></i>
</button>
</div>
</td>
<td ng-click="editLogin(login)">
<span ng-click="$event.stopPropagation()">
<a href="javascript:void(0)" ng-click="editLogin(login)">{{login.name}}</a>
<i class="fa fa-star text-muted" uib-tooltip="Favorite" ng-show="login.favorite"></i>
</span>
</td>
<td ng-click="editLogin(login)">
@ -126,11 +128,13 @@
uib-tooltip="Delete">
<i class="fa fa-lg fa-trash"></i>
</button>
<div class="tooltip-wrapper"
uib-tooltip="{{login.organizationId ? 'Already shared.' : 'Share'}}">
<button type="button" ng-click="share(login)" class="btn btn-link btn-table"
uib-tooltip="{{login.organizationId ? 'Already shared.' : 'Share'}}"
ng-disabled="login.organizationId !== null">
<i class="fa fa-lg fa-share-alt"></i>
</button>
</div>
</td>
<td ng-click="editLogin(login)">
<span ng-click="$event.stopPropagation()">

View File

@ -250,3 +250,7 @@ form .btn .loading-icon {
text-decoration: line-through;
color: @text-muted;
}
.tooltip-wrapper {
display: inline-block;
}