Fix teams list in entity search

The new version of Angular 1 no longer allows us to loop over an object, so we construct an array instead.

Fixes #1519
This commit is contained in:
Joseph Schorr 2016-06-06 11:47:53 -04:00
parent 3351195480
commit b06b5b420a

View file

@ -78,7 +78,9 @@ angular.module('quay').directive('entitySearch', function () {
// Note: We load the org here again so that we always have the fully up-to-date
// teams list.
ApiService.getOrganization(null, {'orgname': $scope.namespace}).then(function(resp) {
$scope.teams = resp.teams;
$scope.teams = Object.keys(resp.teams).map(function(key) {
return resp.teams[key];
});
});
}
@ -113,7 +115,7 @@ angular.module('quay').directive('entitySearch', function () {
$scope.handleTeamCreated = function(created) {
$scope.setEntity(created.name, 'team', false, created.avatar);
$scope.teams[created.name] = created;
$scope.teams.push(created);
};
$scope.handleRobotCreated = function(created) {