1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 16:51:11 +03:00

fixed system tracking date issues

This commit is contained in:
John Mitchell 2015-10-16 17:56:46 -04:00
parent 3ae78ca6e8
commit ed8aa45693
2 changed files with 10 additions and 2 deletions

View File

@ -5,6 +5,12 @@ export default
return _.pluck(nonEmptyResults, 'versions[0]');
}
// if the version that will be displayed on the left is before the
// version that will be displayed on the right, flip them
if (nonEmptyResults[0].versions[0].timestamp > nonEmptyResults[1].versions[0].timestamp) {
nonEmptyResults = nonEmptyResults.reverse();
}
var firstTimestamp = nonEmptyResults[0].versions[0].timestamp;
var hostIdsWithDupes =

View File

@ -4,8 +4,10 @@ function resolveEmptyVersions(service, _, candidate, previousResult) {
candidate = _.merge({}, candidate);
if (_.isEmpty(candidate.versions)) {
var originalStartDate = candidate.dateRange.from.clone();
// theoretically, returning no versions, but also returning only a single version for _a particular date_ acts as an empty version problem. If there is only one version returned, you'll need to check previous dates as well.
if (_.isEmpty(candidate.versions) || candidate.versions.length === 1) {
// this marks the end of the date put in the datepicker. this needs to be the end, rather than the beginning of the date, because you may have returned one valid version on the date the datepicker had in it.
var originalStartDate = candidate.dateRange.to.clone();
if (!_.isUndefined(previousResult)) {
candidate.dateRange.from = moment(previousResult.versions[0].timestamp);