From 48c522aa17067457b7916e5aa4c611186ac52f44 Mon Sep 17 00:00:00 2001 From: chouseknecht Date: Sun, 28 Jul 2013 07:03:37 -0400 Subject: [PATCH] AC-275 Fixed Credential list not showing usernamer and team values. --- awx/ui/static/js/controllers/Credentials.js | 12 ++++++++++++ awx/ui/static/js/lists/Credentials.js | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) 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' }