1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

[system_tracking] Disable single result view for host-to-host compares

This commit is contained in:
Joe Fiorini 2015-07-02 16:10:08 -04:00
parent d41b8a363f
commit 714d6a98bf

View File

@ -177,71 +177,75 @@ function controller($rootScope,
$scope.error = null;
if (_.isEmpty(info.factData)) {
// info = _.reject({
// name: 'NoScanDifferences',
// message: 'No differences in the scans on the dates you selected. Please try selecting different dates.',
// dateValues:
// { leftDate: $scope.leftDate.clone(),
// rightDate: $scope.rightDate.clone()
// }
// });
$scope.singleFactOnly = true;
$scope.factData = info.leftData.map(function(fact) {
var keyNameMap = activeModule.keyNameMap;
var nameKey = activeModule.nameKey;
var renderOptions = _.merge({}, activeModule);
var isNestedDisplay = false;
var facts;
if (_.isObject(renderOptions.factTemplate) &&
_.isArray(renderOptions.compareKey)) {
if ($scope.compareMode === 'host-to-host') {
info = _.reject({
name: 'NoScanDifferences',
message: 'No differences in the scans on the dates you selected. Please try selecting different dates.',
dateValues:
{ leftDate: $scope.leftDate.clone(),
rightDate: $scope.rightDate.clone()
}
});
} else {
$scope.singleFactOnly = true;
$scope.factData = info.leftData.map(function(fact) {
var keyNameMap = activeModule.keyNameMap;
var nameKey = activeModule.nameKey;
var renderOptions = _.merge({}, activeModule);
var isNestedDisplay = false;
var facts;
isNestedDisplay = true;
if (_.isObject(renderOptions.factTemplate) &&
_.isArray(renderOptions.compareKey)) {
var templates = _.mapValues(renderOptions.factTemplate, function(template, key) {
if (template === true) {
return { render: function(fact) {
return fact[key];
}
isNestedDisplay = true;
var templates = _.mapValues(renderOptions.factTemplate, function(template, key) {
if (template === true) {
return { render: function(fact) {
return fact[key];
}
};
} else {
return new FactTemplate(template);
}
});
facts = _.map(templates, function(template, key) {
var keyName = key;
if (_.isObject(keyNameMap) && keyNameMap.hasOwnProperty(key)) {
keyName = keyNameMap[key];
}
renderOptions.factTemplate = template;
var formattedValue = formatFactForDisplay(fact, renderOptions);
return { keyName: keyName,
isNestedDisplay: true,
value1: formattedValue
};
} else {
return new FactTemplate(template);
}
});
});
facts = _.map(templates, function(template, key) {
var keyName = key;
if (_.isObject(keyNameMap) && keyNameMap.hasOwnProperty(key)) {
keyName = keyNameMap[key];
}
renderOptions.factTemplate = template;
} else {
renderOptions.factTemplate = new FactTemplate(renderOptions.factTemplate);
var formattedValue = formatFactForDisplay(fact, renderOptions);
return { keyName: keyName,
isNestedDisplay: true,
isNestedDisplay = false;
facts = { keyName: fact[nameKey],
value1: formattedValue
};
});
}
$scope.isNestedDisplay = isNestedDisplay;
} else {
renderOptions.factTemplate = new FactTemplate(renderOptions.factTemplate);
var formattedValue = formatFactForDisplay(fact, renderOptions);
isNestedDisplay = false;
facts = { keyName: fact[nameKey],
value1: formattedValue
};
}
$scope.isNestedDisplay = isNestedDisplay;
return { displayKeyPath: fact[renderOptions.nameKey],
nestingLevel: 0,
containsValueArray: false,
facts: facts
};
});
return { displayKeyPath: fact[renderOptions.nameKey],
nestingLevel: 0,
containsValueArray: false,
facts: facts
};
});
}
} else {
$scope.singleFactOnly = false;
$scope.factData = info.factData;