From 2955cfbfe8cf04f7436d489b807281312236388c Mon Sep 17 00:00:00 2001 From: Joe Fiorini Date: Mon, 22 Jun 2015 11:03:12 -0400 Subject: [PATCH] [system_tracking] Display message when dates for retrieved data change --- .../date-picker/date-picker.directive.js | 3 ++- .../date-picker/date-picker.partial.html | 3 ++- .../system-tracking.controller.js | 10 +++++++++ .../system-tracking.partial.html | 21 +++++++++++++++++-- 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/awx/ui/static/js/system-tracking/date-picker/date-picker.directive.js b/awx/ui/static/js/system-tracking/date-picker/date-picker.directive.js index f1dad3e8c0..0a216262e5 100644 --- a/awx/ui/static/js/system-tracking/date-picker/date-picker.directive.js +++ b/awx/ui/static/js/system-tracking/date-picker/date-picker.directive.js @@ -14,7 +14,8 @@ export default scope: { date: '=', minDate: '=', - autoUpdate: '=?' + autoUpdate: '=?', + inputClass: '&' }, templateUrl: '/static/js/system-tracking/date-picker/date-picker.partial.html', link: function(scope, element, attrs) { diff --git a/awx/ui/static/js/system-tracking/date-picker/date-picker.partial.html b/awx/ui/static/js/system-tracking/date-picker/date-picker.partial.html index 46b2a0d5de..09bc001065 100644 --- a/awx/ui/static/js/system-tracking/date-picker/date-picker.partial.html +++ b/awx/ui/static/js/system-tracking/date-picker/date-picker.partial.html @@ -4,6 +4,7 @@ class="DatePicker-input" type="text" readonly - ng-model="dateValue"> + ng-model="dateValue" + ng-class="inputClass()">

{{error}}

diff --git a/awx/ui/static/js/system-tracking/system-tracking.controller.js b/awx/ui/static/js/system-tracking/system-tracking.controller.js index 5782c9a3ab..a413fa11e2 100644 --- a/awx/ui/static/js/system-tracking/system-tracking.controller.js +++ b/awx/ui/static/js/system-tracking/system-tracking.controller.js @@ -72,6 +72,8 @@ function controller($rootScope, $scope.leftDataNoScans = false; $scope.rightDataNoScans = false; + $scope.leftDateWarning = false; + $scope.rightDateWarning = false; waitIndicator('start'); @@ -97,6 +99,10 @@ function controller($rootScope, $scope.leftScanDate = $scope.leftDate; } else { $scope.leftScanDate = moment(responses[0].timestamp); + + if (!$scope.leftScanDate.isSame($scope.leftDate, 'd')) { + $scope.leftDateWarning = true; + } } if (_.isEmpty(data[1])) { @@ -104,6 +110,10 @@ function controller($rootScope, $scope.rightScanDate = $scope.rightDate; } else { $scope.rightScanDate = moment(responses[1].timestamp); + + if (!$scope.rightScanDate.isSame($scope.rightDate, 'd')) { + $scope.rightDateWarning = true; + } } return data; diff --git a/awx/ui/static/js/system-tracking/system-tracking.partial.html b/awx/ui/static/js/system-tracking/system-tracking.partial.html index f01d586b91..d5e41b8360 100644 --- a/awx/ui/static/js/system-tracking/system-tracking.partial.html +++ b/awx/ui/static/js/system-tracking/system-tracking.partial.html @@ -21,11 +21,28 @@
{{ factModulePickersLabelLeft }} - + + + + There were no fact scans on this date, using a prior scan instead. +
{{ factModulePickersLabelRight }} - + + + + There were no fact scans on this date, using a prior scan instead. +