Add a throbber when loading repo permissions

This commit is contained in:
Joseph Schorr 2014-10-29 14:21:08 -04:00
parent dfe143270c
commit c65031eea5
2 changed files with 5 additions and 3 deletions

View file

@ -1330,7 +1330,7 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerServi
var name = $routeParams.name; var name = $routeParams.name;
$scope.Features = Features; $scope.Features = Features;
$scope.permissions = {'team': [], 'user': []}; $scope.permissions = {'team': [], 'user': [], 'loading': 2};
$scope.logsShown = 0; $scope.logsShown = 0;
$scope.deleting = false; $scope.deleting = false;
@ -1680,6 +1680,7 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, TriggerServi
var permissionsFetch = Restangular.one('repository/' + namespace + '/' + name + '/permissions/' + kind + '/'); var permissionsFetch = Restangular.one('repository/' + namespace + '/' + name + '/permissions/' + kind + '/');
permissionsFetch.get().then(function(resp) { permissionsFetch.get().then(function(resp) {
$scope.permissions[kind] = resp.permissions; $scope.permissions[kind] = resp.permissions;
$scope.permissions['loading']--;
}, function() { }, function() {
$scope.permissions[kind] = null; $scope.permissions[kind] = null;
}); });

View file

@ -92,8 +92,9 @@
<i class="info-icon fa fa-info-circle" data-placement="left" data-content="Allow any number of users, robot accounts or teams to read, write or administer this repository"></i> <i class="info-icon fa fa-info-circle" data-placement="left" data-content="Allow any number of users, robot accounts or teams to read, write or administer this repository"></i>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<!-- Throbber -->
<table class="permissions"> <span class="quay-spinner" ng-show="permissions.loading > 0"></span>
<table class="permissions" ng-show="permissions.loading <= 0">
<thead> <thead>
<tr> <tr>
<td style="min-width: 400px;">User<span ng-show="repo.is_organization">/Team</span>/Robot Account</td> <td style="min-width: 400px;">User<span ng-show="repo.is_organization">/Team</span>/Robot Account</td>