Merge pull request #2619 from charltonaustin/drop-down_menu_reports_bug

fix(frontend): add subscope
This commit is contained in:
Charlton Austin 2017-05-04 14:43:17 -04:00 committed by GitHub
commit 3b1d696197
2 changed files with 10 additions and 10 deletions

View file

@ -9,7 +9,7 @@
aria-labelledby="entityDropdownMenu">
<li ng-show="lazyLoading" style="padding: 10px"><div class="cor-loader"></div></li>
<li role="presentation" class="dropdown-header" ng-show="!lazyLoading && !robots && !isAdmin && !teams">
<li role="presentation" class="dropdown-header" ng-show="!lazyLoading && !page.robots && !isAdmin && !teams">
You do not have permission to manage teams and robots for this organization
</li>
@ -25,10 +25,10 @@
</a>
</li>
<li role="presentation" class="divider" ng-show="!lazyLoading && robots && isAdmin"></li>
<li role="presentation" class="divider" ng-show="!lazyLoading && page.robots && isAdmin"></li>
<li role="presentation" class="dropdown-header"
ng-show="!lazyLoading && !teams.length && !robots.length && !((includeTeams && isOrganization && isAdmin) || (includeRobots && isAdmin))">
ng-show="!lazyLoading && !teams.length && !page.robots.length && !((includeTeams && isOrganization && isAdmin) || (includeRobots && isAdmin))">
<span ng-if="includeRobots && includeTeams && isOrganization">
No robot accounts or teams found
</span>
@ -59,11 +59,11 @@
</a>
</li>
<li role="presentation" class="divider" ng-show="!lazyLoading && teams && (isAdmin || robots)"></li>
<li role="presentation" class="divider" ng-show="!lazyLoading && teams && (isAdmin || page.robots)"></li>
<li role="presentation" class="dropdown-header" ng-show="!lazyLoading && robots">Robot Accounts</li>
<li role="presentation" class="dropdown-header" ng-show="!lazyLoading && page.robots">Robot Accounts</li>
<li class="menuitem" role="presentation" ng-repeat="robot in robots | orderBy:'name'" ng-show="!lazyLoading">
<li class="menuitem" role="presentation" ng-repeat="robot in page.robots | orderBy:'name'" ng-show="!lazyLoading">
<a role="menuitem" tabindex="-1" ng-click="setEntity(robot.name, 'user', true)">
<i class="fa ci-robot"></i> <span>{{ robot.name }}</span>
</a>

View file

@ -47,7 +47,7 @@ angular.module('quay').directive('entitySearch', function () {
$scope.lazyLoading = true;
$scope.teams = null;
$scope.robots = null;
$scope.page.robots = null;
$scope.isAdmin = false;
$scope.isOrganization = false;
@ -71,7 +71,7 @@ angular.module('quay').directive('entitySearch', function () {
// Reset the cached teams and robots.
$scope.teams = null;
$scope.robots = null;
$scope.page.robots = null;
// Load the organization's teams (if applicable).
if ($scope.isOrganization && isSupported('team')) {
@ -87,7 +87,7 @@ angular.module('quay').directive('entitySearch', function () {
// Load the user/organization's robots (if applicable).
if ($scope.isAdmin && isSupported('robot')) {
ApiService.getRobots($scope.isOrganization ? $scope.namespace : null).then(function(resp) {
$scope.robots = resp.robots;
$scope.page.robots = resp.robots;
$scope.lazyLoading = false;
}, function() {
$scope.lazyLoading = false;
@ -120,7 +120,7 @@ angular.module('quay').directive('entitySearch', function () {
$scope.handleRobotCreated = function(created) {
$scope.setEntity(created.name, 'user', true, created.avatar);
$scope.robots.push(created);
$scope.page.robots.push(created);
};
$scope.setEntity = function(name, kind, is_robot, avatar) {