From cf043377121fa84a6d1abf0968e441b7ca900e4a Mon Sep 17 00:00:00 2001 From: Joe Fiorini Date: Mon, 8 Jun 2015 09:37:19 -0400 Subject: [PATCH] Fix display of nested facts --- awx/ui/static/js/system-tracking/compare-facts.js | 4 +++- .../static/js/system-tracking/compare-facts/nested-helpers.js | 4 ++-- .../static/js/system-tracking/system-tracking.controller.js | 3 --- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/awx/ui/static/js/system-tracking/compare-facts.js b/awx/ui/static/js/system-tracking/compare-facts.js index 0d5e77398f..04d1ee3a6d 100644 --- a/awx/ui/static/js/system-tracking/compare-facts.js +++ b/awx/ui/static/js/system-tracking/compare-facts.js @@ -9,7 +9,9 @@ import compareFlatFacts from './compare-facts/flat'; export function compareFacts(module, facts) { if (module.displayType === 'nested') { - return compareNestedFacts(facts); + return { factData: compareNestedFacts(facts), + isNestedDisplay: true + }; } else { // For flat structures we compare left-to-right, then right-to-left to // make sure we get a good comparison between both hosts diff --git a/awx/ui/static/js/system-tracking/compare-facts/nested-helpers.js b/awx/ui/static/js/system-tracking/compare-facts/nested-helpers.js index 37c50d9abd..73063b8f40 100644 --- a/awx/ui/static/js/system-tracking/compare-facts/nested-helpers.js +++ b/awx/ui/static/js/system-tracking/compare-facts/nested-helpers.js @@ -127,8 +127,8 @@ export function formatFacts(diffedResults) { } export function findFacts(factData) { - var rightData = factData[0]; - var leftData = factData[1]; + var rightData = factData[0].facts; + var leftData = factData[1].facts; function factObject(keyPath, key, leftValue, rightValue) { var obj = diff --git a/awx/ui/static/js/system-tracking/system-tracking.controller.js b/awx/ui/static/js/system-tracking/system-tracking.controller.js index 2e1bb40d28..53d355566b 100644 --- a/awx/ui/static/js/system-tracking/system-tracking.controller.js +++ b/awx/ui/static/js/system-tracking/system-tracking.controller.js @@ -79,9 +79,6 @@ function controller($rootScope, // arrays in index 1 // - // Save the position of the data so we - // don't lose it later - var wrappedFacts = facts.map(function(facts, index) { return { position: index === 0 ? 'left' : 'right',