diff --git a/awx/ui/static/js/controllers/Credentials.js b/awx/ui/static/js/controllers/Credentials.js index 81e77e8689..c9039bfbd0 100644 --- a/awx/ui/static/js/controllers/Credentials.js +++ b/awx/ui/static/js/controllers/Credentials.js @@ -29,6 +29,18 @@ function CredentialsList ($scope, $rootScope, $location, $log, $routeParams, Res SelectionInit({ scope: scope, list: list, url: url, returnToCaller: 1 }); + scope.PostRefershRemove = scope.$on('PostRefresh', function() { + // After a refresh, populate the organization name on each row + for(var i=0; i < scope.credentials.length; i++) { + if (scope.credentials[i].summary_fields.user) { + scope.credentials[i].user_username = scope.credentials[i].summary_fields.user.username; + } + if (scope.credentials[i].summary_fields.team) { + scope.credentials[i].team_name = scope.credentials[i].summary_fields.team.name; + } + } + }); + SearchInit({ scope: scope, set: 'credentials', list: list, url: defaultUrl }); PaginateInit({ scope: scope, list: list, url: defaultUrl }); scope.search(list.iterator); diff --git a/awx/ui/static/js/lists/Credentials.js b/awx/ui/static/js/lists/Credentials.js index b2db4eb1ae..a7cc044518 100644 --- a/awx/ui/static/js/lists/Credentials.js +++ b/awx/ui/static/js/lists/Credentials.js @@ -30,13 +30,13 @@ angular.module('CredentialsListDefinition', []) }, team: { label: 'Team', - ngBind: 'credential.summary_fields.team.name', + ngBind: 'credential.team_name', sourceModel: 'team', sourceField: 'name' }, user: { label: 'User', - ngBind: 'credential.summary_fields.user.usename', + ngBind: 'credential.user_username', sourceModel: 'user', sourceField: 'username' }