From 1e3f2c02e935fb48106c17674ec1e35c4bb14f9d Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Tue, 24 Jun 2014 13:58:39 -0400 Subject: [PATCH] Job detail page refactor Fixed host result sort order --- awx/ui/static/js/helpers/JobDetail.js | 13 +++++-------- awx/ui/static/lib/ansible/list-generator.js | 4 ++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/awx/ui/static/js/helpers/JobDetail.js b/awx/ui/static/js/helpers/JobDetail.js index d322624075..3b5a73f488 100644 --- a/awx/ui/static/js/helpers/JobDetail.js +++ b/awx/ui/static/js/helpers/JobDetail.js @@ -926,19 +926,16 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge if (scope.activePlay && scope.activeTask) { hostResults = JSON.parse(JSON.stringify(scope.jobData.plays[scope.activePlay].tasks[scope.activeTask].hostResults)); keys = Object.keys(hostResults); - - /*keys.sort(function(a,b) { + keys.sort(function(a,b) { if (hostResults[a].name > hostResults[b].name) - return 1; - if (hostResults[a].name < hostResults[b].name) return -1; + if (hostResults[a].name < hostResults[b].name) + return 1; // a must be equal to b return 0; - });*/ - keys.reverse(); - + }); while (idx < keys.length && idx < scope.hostResultsMaxRows) { - result.push(hostResults[keys[idx]]); + result.unshift(hostResults[keys[idx]]); idx++; } } diff --git a/awx/ui/static/lib/ansible/list-generator.js b/awx/ui/static/lib/ansible/list-generator.js index 631e880705..3bf00784bf 100644 --- a/awx/ui/static/lib/ansible/list-generator.js +++ b/awx/ui/static/lib/ansible/list-generator.js @@ -11,9 +11,9 @@ angular.module('ListGenerator', ['GeneratorHelpers']) .factory('GenerateList', ['$location', '$compile', '$rootScope', 'SearchWidget', 'PaginateWidget', 'Attr', 'Icon', - 'Column', 'DropDown', 'NavigationLink', 'Button', 'SelectIcon', 'Breadcrumbs', + 'Column', 'DropDown', 'NavigationLink', 'Button', 'SelectIcon', function ($location, $compile, $rootScope, SearchWidget, PaginateWidget, Attr, Icon, Column, DropDown, NavigationLink, - Button, SelectIcon, Breadcrumbs) { + Button, SelectIcon) { return { setList: function (list) {