mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 02:19:58 -03:30
Fix issue with host columns getting flipped
This commit is contained in:
parent
dae25b7123
commit
d2c7d7331d
@ -41,13 +41,13 @@ export default
|
||||
function flatCompare(basisFacts, comparatorFacts, nameKey, compareKeys, factTemplate) {
|
||||
|
||||
|
||||
return basisFacts.reduce(function(arr, basisFact) {
|
||||
return basisFacts.facts.reduce(function(arr, basisFact) {
|
||||
var searcher = {};
|
||||
searcher[nameKey] = basisFact[nameKey];
|
||||
|
||||
var basisTemplate, comparatorTemplate, slottedValues, basisValue, comparatorValue;
|
||||
|
||||
var matchingFact = _.where(comparatorFacts, searcher);
|
||||
var matchingFact = _.where(comparatorFacts.facts, searcher);
|
||||
var diffs;
|
||||
|
||||
if (_.isEmpty(matchingFact)) {
|
||||
|
||||
@ -83,10 +83,15 @@ function controller($rootScope,
|
||||
// Save the position of the data so we
|
||||
// don't lose it later
|
||||
|
||||
facts[0].position = 'left';
|
||||
facts[1].position = 'right';
|
||||
var wrappedFacts =
|
||||
facts.map(function(facts, index) {
|
||||
return { position: index === 0 ? 'left' : 'right',
|
||||
isEmpty: _.isEmpty(facts),
|
||||
facts: facts
|
||||
};
|
||||
});
|
||||
|
||||
var splitFacts = _.partition(facts, _.isEmpty);
|
||||
var splitFacts = _.partition(facts, 'isEmpty');
|
||||
var emptyScans = splitFacts[0];
|
||||
var nonEmptyScans = splitFacts[1];
|
||||
var result;
|
||||
@ -109,12 +114,9 @@ function controller($rootScope,
|
||||
dateValue: emptyScans[0].position === 'left' ? $scope.leftDate.clone() : $scope.rightDate.clone()
|
||||
});
|
||||
} else {
|
||||
result = _.promise(facts);
|
||||
result = _.promise(wrappedFacts);
|
||||
}
|
||||
|
||||
delete facts[0].position;
|
||||
delete facts[1].position;
|
||||
|
||||
// all scans have data, rejoice!
|
||||
return result;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user