1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-23 11:56:00 +01:00

handle errors in org people edit

This commit is contained in:
Kyle Spearrin 2017-03-29 21:26:48 -04:00
parent 916519a43a
commit 616a442fcb
2 changed files with 9 additions and 2 deletions

View File

@ -69,6 +69,7 @@
return Object.keys($scope.selectedSubvaults).length === $scope.subvaults.length; return Object.keys($scope.selectedSubvaults).length === $scope.subvaults.length;
}; };
$scope.submitPromise = null;
$scope.submit = function (model) { $scope.submit = function (model) {
var subvaults = []; var subvaults = [];
for (var subvaultId in $scope.selectedSubvaults) { for (var subvaultId in $scope.selectedSubvaults) {
@ -77,12 +78,12 @@
} }
} }
apiService.organizationUsers.put({ orgId: $state.params.orgId, id: id }, { $scope.submitPromise = apiService.organizationUsers.put({ orgId: $state.params.orgId, id: id }, {
type: $scope.type, type: $scope.type,
subvaults: subvaults subvaults: subvaults
}, function () { }, function () {
$uibModalInstance.close(); $uibModalInstance.close();
}); }).$promise;
}; };
$scope.close = function () { $scope.close = function () {

View File

@ -4,6 +4,12 @@
</div> </div>
<form name="form" ng-submit="form.$valid && submit()" api-form="submitPromise"> <form name="form" ng-submit="form.$valid && submit()" api-form="submitPromise">
<div class="modal-body"> <div class="modal-body">
<div class="callout callout-danger validation-errors" ng-show="form.$errors">
<h4>Errors have occured</h4>
<ul>
<li ng-repeat="e in form.$errors">{{e}}</li>
</ul>
</div>
<h4>User Type</h4> <h4>User Type</h4>
<div class="form-group"> <div class="form-group">
<div class="radio"> <div class="radio">