From 68286074cf2e12943e03a8c1c4ad3a72cddbdd38 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Tue, 12 Nov 2013 16:20:24 +0000 Subject: [PATCH] AC-502 home page widgets should now show 0 rather than ' ' for empty values. --- awx/ui/static/js/widgets/InventorySyncStatus.js | 10 +++++++--- awx/ui/static/js/widgets/JobStatus.js | 9 ++++++++- awx/ui/static/js/widgets/SCMSyncStatus.js | 4 ++-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/awx/ui/static/js/widgets/InventorySyncStatus.js b/awx/ui/static/js/widgets/InventorySyncStatus.js index ae302cf6cb..435b0cb63a 100644 --- a/awx/ui/static/js/widgets/InventorySyncStatus.js +++ b/awx/ui/static/js/widgets/InventorySyncStatus.js @@ -13,7 +13,11 @@ angular.module('InventorySyncStatusWidget', ['RestServices', 'Utilities']) return function(params) { var scope = $rootScope.$new(); - var inventoryCount, inventoryFails, groupCount, groupFails, hostCount; + var inventoryCount = 0; + var inventoryFails = 0; + var groupCount = 0; + var groupFails = 0; + var hostCount = 0; var hostFails = 0; var counts = 0; var expectedCounts = 5; @@ -34,10 +38,10 @@ angular.module('InventorySyncStatusWidget', ['RestServices', 'Utilities']) html += (label == 'Hosts' || label == 'Groups') ? " class=\"pad-left-sm\" " : ""; html += ">" + label + "\n"; html += ""; - html += (fail > 0) ? "" + fail + "" : ""; + html += "" + fail + ""; html += "\n"; html += ""; - html += (count > 0) ? "" + count + "" : ""; + html += "" + count + ""; html += "\n"; return html; } diff --git a/awx/ui/static/js/widgets/JobStatus.js b/awx/ui/static/js/widgets/JobStatus.js index 238c56e302..9e0f2769d6 100644 --- a/awx/ui/static/js/widgets/JobStatus.js +++ b/awx/ui/static/js/widgets/JobStatus.js @@ -13,7 +13,14 @@ angular.module('JobStatusWidget', ['RestServices', 'Utilities']) return function(params) { var scope = $rootScope.$new(); - var jobCount, jobFails, inventoryCount, inventoryFails, groupCount, groupFails, hostCount, hostFails; + var jobCount = 0; + var jobFails = 0; + var inventoryCount = 0; + var inventoryFails = 0; + var groupCount = 0; + var groupFails = 0; + var hostCount = 0; + var hostFails = 0; var counts = 0; var expectedCounts = 8; var target = params.target; diff --git a/awx/ui/static/js/widgets/SCMSyncStatus.js b/awx/ui/static/js/widgets/SCMSyncStatus.js index 7fce1a0275..7e35a986a5 100644 --- a/awx/ui/static/js/widgets/SCMSyncStatus.js +++ b/awx/ui/static/js/widgets/SCMSyncStatus.js @@ -36,10 +36,10 @@ angular.module('SCMSyncStatusWidget', ['RestServices', 'Utilities']) var html = '' html += "" + label + "\n"; html += ""; - html += (fail > 0) ? "" + fail + "" : ""; + html += "" + fail + ""; html += "\n"; html += ""; - html += (count > 0) ? "" + count + "" : ""; + html += "" + count + ""; html += "\n"; html += "\n"; return html;