Add the team membership to the robots view

This commit is contained in:
Joseph Schorr 2015-04-01 13:56:30 -04:00
parent e6354571f6
commit fde9666647
6 changed files with 112 additions and 28 deletions

View file

@ -23,4 +23,8 @@
font-style: normal !important;
font-weight: normal !important;
font-variant: normal !important;
}
a .avatar-element .letter {
cursor: pointer !important;
}

View file

@ -83,4 +83,8 @@
.robots-manager-element .repo-circle.no-background .fa-lock {
bottom: 5px;
right: 2px;
}
.robots-manager-element .member-perm-summary {
margin-right: 14px;
}

View file

@ -28,16 +28,17 @@
<table class="co-table" ng-if="robots.length">
<thead>
<td class="caret-col" ng-if="organization.is_admin"></td>
<td class="caret-col" ng-if="organization.is_admin && Config.isNewLayout()"></td>
<td>Robot Account Name</td>
<td>Repository Permissions</td>
<td ng-if="organization && Config.isNewLayout()">Teams</td>
<td ng-if="Config.isNewLayout()">Repository Permissions</td>
<td class="options-col"></td>
</thead>
<tbody ng-repeat="robotInfo in robots">
<tr ng-class="robotInfo.showing_permissions ? 'open' : 'closed'">
<td class="caret-col" ng-if="organization.is_admin">
<span ng-if="robotInfo.permission_count > 0" ng-click="showPermissions(robotInfo)">
<td class="caret-col" ng-if="organization.is_admin && Config.isNewLayout()">
<span ng-if="robotInfo.repositories.length > 0" ng-click="showPermissions(robotInfo)">
<i class="fa"
ng-class="robotInfo.showing_permissions ? 'fa-caret-down' : 'fa-caret-right'"
data-title="View Permissions List" bs-tooltip></i>
@ -49,13 +50,29 @@
<span class="prefix">{{ getPrefix(robotInfo.name) }}+</span>{{ getShortenedName(robotInfo.name) }}
</a>
</td>
<td>
<span class="empty" ng-if="robotInfo.permission_count == 0">(No permissions on any repositories)</span>
<span ng-if="robotInfo.permission_count > 0">
<td ng-if="organization && Config.isNewLayout()">
<span class="empty" ng-if="robotInfo.teams.length == 0">
(Not a member of any team)
</span>
<span class="empty" ng-if="robotInfo.teams.length > 0">
<span ng-repeat="team in robotInfo.teams"
data-title="Team {{ team.name }}" bs-tooltip>
<span class="anchor" is-text-only="!organization.admin" href="/organization/{{ organization.name }}/teams/{{ team.name }}">
<span class="avatar" size="24" data="team.avatar"></span>
</span>
</span>
</span>
</td>
<td ng-if="Config.isNewLayout()">
<span class="empty" ng-if="robotInfo.repositories.length == 0">
(No permissions on any repositories)
</span>
<span class="member-perm-summary" ng-if="robotInfo.repositories.length > 0">
Permissions on
<span class="anchor" href="javascript:void(0)" is-text-only="!organization.is_admin" ng-click="showPermissions(robotInfo)">{{ robotInfo.permission_count }}
<span ng-if="robotInfo.permission_count == 1">repository</span>
<span ng-if="robotInfo.permission_count > 1">repositories</span>
<span class="anchor" href="javascript:void(0)" is-text-only="!organization.is_admin" ng-click="showPermissions(robotInfo)">{{ robotInfo.repositories.length }}
<span ng-if="robotInfo.repositories.length == 1">repository</span>
<span ng-if="robotInfo.repositories.length > 1">repositories</span>
</span>
</span>
</td>

View file

@ -12,7 +12,7 @@ angular.module('quay').directive('robotsManager', function () {
'organization': '=organization',
'user': '=user'
},
controller: function($scope, $element, ApiService, $routeParams, CreateService) {
controller: function($scope, $element, ApiService, $routeParams, CreateService, Config) {
$scope.ROBOT_PATTERN = ROBOT_PATTERN;
// TODO(jschorr): move this to a service.
@ -26,6 +26,7 @@ angular.module('quay').directive('robotsManager', function () {
$scope.loading = false;
$scope.shownRobot = null;
$scope.showRobotCounter = 0;
$scope.Config = Config;
var loadRobotPermissions = function(info) {
var shortName = $scope.getShortenedName(info.name);