Files
awx/awx/ui/static/js/system-tracking/main.js
Joe Fiorini 9526975318 Resolve fact versions before looking up fact views
This adds a step to the fact version lookup that attempts to resolve
fact versions before looking up their views. Resolving a fact version
means finding another version to use when there is a problem with the
one the user selected.

In this case, the resolution process works as follows:

1. Check if either request returned an empty list

If so, request again, changing the dates to look back a year. This
will almost always return something.

2. If we are requesting multiple facts for the same host, and both of
the resolved versions have the same timestamp, they are duplicates and
we cannot compare against them.

Instead we instruct it to grab the selected and the previous versions for
comparison.

For host-to-host view, this also updates the timestamp in the header to
reflect the actual timestamps. It _does not_ update the date picker
dates yet.
2015-06-03 00:16:54 -04:00

35 lines
1.4 KiB
JavaScript

/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
import route from './system-tracking.route';
import factScanDataService from './data-services/fact-scan-data.service';
import getDataForComparison from './data-services/get-data-for-comparison.factory';
import getModuleOptions from './data-services/get-module-options.factory';
import resolveVersions from './data-services/resolve-versions.factory';
import controller from './system-tracking.controller';
import stringOrDateFilter from './string-or-date.filter';
import shared from 'tower/shared/main';
import utilities from 'tower/shared/Utilities';
import datePicker from './date-picker/main';
export default
angular.module('systemTracking',
[ utilities.name,
shared.name,
datePicker.name
])
.service('factScanDataService', factScanDataService)
.factory('getDataForComparison', getDataForComparison)
.factory('getModuleOptions', getModuleOptions)
.factory('resolveVersions', resolveVersions)
.filter('stringOrDate', stringOrDateFilter)
.controller('systemTracking', controller)
.config(['$routeProvider', function($routeProvider) {
var url = route.route;
delete route.route;
$routeProvider.when(url, route);
}]);