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