notes about sharing

This commit is contained in:
Kyle Spearrin 2017-04-11 17:29:45 -04:00
parent d619167c02
commit 5f130bdda7
4 changed files with 71 additions and 41 deletions

View File

@ -14,6 +14,13 @@
<label for="email">Name</label>
<input type="text" id="name" name="Name" ng-model="model.name" class="form-control" required api-field />
</div>
<div class="callout callout-default">
<h4><i class="fa fa-info-circle"></i> Note</h4>
<p>
After creating the subvault, you can associate a user to it by selecting a specific user on the "People" page.
</p>
<p>You can associate logins to the subvault by sharing from "My vault".</p>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="form.$loading">
@ -22,4 +29,3 @@
<button type="button" class="btn btn-default btn-flat" ng-click="close()">Close</button>
</div>
</form>

View File

@ -14,6 +14,14 @@
<label for="email">Name</label>
<input type="text" id="name" name="Name" ng-model="subvault.name" class="form-control" required api-field />
</div>
<div class="callout callout-default">
<h4><i class="fa fa-info-circle"></i> Note</h4>
<p>
Select "Users" from the listing options to manage existing users for this subvault. Associate new users by
managing the user's subvault access on the "People" page.
</p>
<p>You can associate logins to this subvault by sharing from "My vault".</p>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary btn-flat" ng-disabled="form.$loading">

View File

@ -1,7 +1,8 @@
angular
.module('bit.vault')
.controller('vaultShareController', function ($scope, apiService, $uibModalInstance, authService, cipherService, loginId, $analytics) {
.controller('vaultShareController', function ($scope, apiService, $uibModalInstance, authService, cipherService,
loginId, $analytics, $state) {
$analytics.eventTrack('vaultShareController', { category: 'Modal' });
$scope.model = {};
$scope.login = {};
@ -30,7 +31,7 @@
setFirstOrg = false;
for (var i in profile.organizations) {
if (profile.organizations.hasOwnProperty(i)) {
if (profile.organizations.hasOwnProperty(i) && profile.organizations[i].enabled) {
orgs.push({
id: profile.organizations[i].id,
name: profile.organizations[i].name
@ -111,4 +112,10 @@
$scope.close = function () {
$uibModalInstance.dismiss('cancel');
};
$scope.createOrg = function () {
$state.go('backend.user.settingsCreateOrg').then(function () {
$uibModalInstance.dismiss('cancel');
});
};
});

View File

@ -11,46 +11,55 @@
<li ng-repeat="e in form.$errors">{{e}}</li>
</ul>
</div>
<div class="form-group">
<label for="organization">Organization</label> <span>*</span>
<select id="organization" name="Organization" ng-model="model.organizationId" class="form-control">
<option ng-repeat="org in organizations | orderBy: ['name']" value="{{org.id}}">{{org.name}}</option>
</select>
<div ng-show="!organizations.length" class="callout callout-default">
<h4><i class="fa fa-info-circle"></i> No Organizations</h4>
<p>You do not belong to any organizations.</p>
<a ng-click="createOrg()" class="btn btn-default btn-flat">
Create an Organization
</a>
</div>
<div ng-show="loadingSubvaults && !orgSubvaults.length">
<p>Loading...</p>
</div>
<div ng-show="!loadingSubvaults && !orgSubvaults.length">
<p>No subvaults with write access.</p>
</div>
<div class="table-responsive" ng-show="orgSubvaults.length" style="margin: 0;">
<table class="table table-striped table-hover" style="margin: 0;">
<thead>
<tr>
<th style="width: 40px;">
<input type="checkbox"
ng-checked="allSelected()"
ng-click="toggleSubvaultSelectionAll($event)">
</th>
<th>Subvault</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="subvault in orgSubvaults =
<div ng-show="organizations.length">
<div class="form-group">
<label for="organization">Organization</label> <span>*</span>
<select id="organization" name="Organization" ng-model="model.organizationId" class="form-control">
<option ng-repeat="org in organizations | orderBy: ['name']" value="{{org.id}}">{{org.name}}</option>
</select>
</div>
<div ng-show="loadingSubvaults && !orgSubvaults.length">
<p>Loading...</p>
</div>
<div ng-show="!loadingSubvaults && !orgSubvaults.length">
<p>No subvaults with write access.</p>
</div>
<div class="table-responsive" ng-show="orgSubvaults.length" style="margin: 0;">
<table class="table table-striped table-hover" style="margin: 0;">
<thead>
<tr>
<th style="width: 40px;">
<input type="checkbox"
ng-checked="allSelected()"
ng-click="toggleSubvaultSelectionAll($event)">
</th>
<th>Subvault</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="subvault in orgSubvaults =
(subvaults | filter: { organizationId: model.organizationId } | orderBy: ['name'])">
<td valign="middle">
<input type="checkbox"
name="selectedSubvaults[]"
value="{{subvault.id}}"
ng-checked="subvaultSelected(subvault)"
ng-click="toggleSubvaultSelection(subvault.id)">
</td>
<td valign="middle" ng-click="toggleSubvaultSelection(subvault.id)">
{{subvault.name}}
</td>
</tr>
</tbody>
</table>
<td valign="middle">
<input type="checkbox"
name="selectedSubvaults[]"
value="{{subvault.id}}"
ng-checked="subvaultSelected(subvault)"
ng-click="toggleSubvaultSelection(subvault.id)">
</td>
<td valign="middle" ng-click="toggleSubvaultSelection(subvault.id)">
{{subvault.name}}
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="modal-footer">