1
0
mirror of https://github.com/bitwarden/browser synced 2024-12-27 10:23:48 +01:00

remove share login modal and add organizations box

This commit is contained in:
Kyle Spearrin 2017-02-28 23:43:54 -05:00
parent 0d2e296eda
commit 05a92ebd26
6 changed files with 27 additions and 112 deletions

View File

@ -109,6 +109,31 @@
</button>
</div>
</div>
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">Organizations</h3>
</div>
<div class="box-body no-padding">
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th style="width: 75px; min-width: 75px;"></th>
<th>Name</th>
<th style="width: 200px;">Plan</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td>sdfsdf</td>
<td>dfd</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">Danger Zone</h3>

View File

@ -163,20 +163,4 @@
var logins = $filter('filter')($scope.logins, { folderId: folder.id });
return logins.length === 0;
};
$scope.shareLogin = function (login) {
var shareModel = $uibModal.open({
animation: true,
templateUrl: 'app/vault/views/vaultShareLogin.html',
controller: 'vaultShareLoginController',
size: 'lg',
resolve: {
id: function () { return login.id; }
}
});
shareModel.result.then(function (result) {
});
};
});

View File

@ -1,33 +0,0 @@
angular
.module('bit.vault')
.controller('vaultShareLoginController', function ($scope, apiService, $uibModalInstance, cryptoService, cipherService,
id, $analytics) {
$analytics.eventTrack('vaultShareLoginController', { category: 'Modal' });
apiService.logins.get({
id: id
}, function (login) {
$scope.login = cipherService.decryptLogin(login);
});
$scope.enablePromise = null;
$scope.enable = function () {
var shareKey = cryptoService.makeShareKey();
var encLogin = cipherService.encryptLogin($scope.login, shareKey);
encLogin.key = cryptoService.rsaEncrypt(shareKey);
$scope.enablePromise = apiService.logins.put({ id: $scope.login.id }, encLogin, function (login) {
$scope.login = cipherService.decryptLogin(login);
}).$promise;
};
$scope.sharePromise = null;
$scope.share = function () {
$uibModalInstance.close({});
};
$scope.close = function () {
$uibModalInstance.dismiss('cancel');
};
});

View File

@ -47,7 +47,7 @@
<table class="table table-striped table-hover table-selectable">
<thead>
<tr>
<th style="width: 115px; min-width: 115px;"></th>
<th style="width: 75px; min-width: 75px;"></th>
<th>Name</th>
<th style="width: 300px;">Username</th>
</tr>
@ -64,10 +64,6 @@
uib-tooltip="View/Edit">
<i class="fa fa-lg fa-pencil"></i>
</button>
<button type="button" ng-click="shareLogin(login)" class="btn btn-link btn-table"
uib-tooltip="Share">
<i class="fa fa-lg fa-user-plus"></i>
</button>
</td>
<td ng-click="editLogin(login)">
<span ng-click="$event.stopPropagation()">

View File

@ -1,57 +0,0 @@
<div class="modal-header">
<button type="button" class="close" ng-click="close()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="editFolderModelLabel">
<i class="fa fa-user-plus"></i> Share Login <small>{{login.name}}</small>
</h4>
</div>
<form name="enableForm" ng-submit="enableForm.$valid && enable()" api-form="savePromise" ng-if="!login.key">
<div class="modal-body">
<div class="callout callout-danger validation-errors" ng-show="enableForm.$errors">
<h4>Errors have occured</h4>
<ul>
<li ng-repeat="e in enableForm.$errors">{{e}}</li>
</ul>
</div>
Sharing is not enabled.
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="enableForm.$loading">
<i class="fa fa-refresh fa-spin loading-icon" ng-show="enableForm.$loading"></i>Enable Sharing
</button>
<button type="button" class="btn btn-default btn-flat" ng-click="close()">Close</button>
</div>
</form>
<form name="shareForm" ng-submit="shareForm.$valid && share()" api-form="savePromise" ng-if="login.key">
<div class="modal-body">
<div class="callout callout-danger validation-errors" ng-show="shareForm.$errors">
<h4>Errors have occured</h4>
<ul>
<li ng-repeat="e in shareForm.$errors">{{e}}</li>
</ul>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group" show-errors>
<label for="email">Recipient Email address</label> <span>*</span>
<input type="email" id="email" name="Email" ng-model="share.email" class="form-control"
placeholder="bob@example.com" required api-field />
</div>
<div class="checkbox">
<label>
<input type="checkbox" ng-model="share.readonly" name="Edit" />
Recipient can edit?
</label>
</div>
</div>
<div class="col-md-6">
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="shareForm.$loading">
<i class="fa fa-refresh fa-spin loading-icon" ng-show="shareForm.$loading"></i>Share
</button>
<button type="button" class="btn btn-default btn-flat" ng-click="close()">Close</button>
</div>
</form>

View File

@ -60,7 +60,7 @@
ng-class="{active: $state.is('backend.shared') || $state.is('backend.sharedMe')}">
<a ui-sref="backend.shared">
<small class="label pull-right bg-yellow">beta</small>
<i class="fa fa-users fa-fw"></i> <span>Sharing Center</span>
<i class="fa fa-share-alt fa-fw"></i> <span>Sharing Center</span>
</a>
<ul class="treeview-menu" ng-class="{'menu-open': $state.is('backend.shared')
|| $state.is('backend.sharedMe')}">