Merge pull request #1571 from coreos-inc/js-error

Fix NPE and UI fixes for heatmap
This commit is contained in:
josephschorr 2016-06-22 16:04:19 -04:00 committed by GitHub
commit 46ea7ce2ed
3 changed files with 8 additions and 2 deletions

View file

@ -29,6 +29,10 @@ angular.module('quay').directive('repoPanelInfo', function () {
}; };
$scope.getAggregatedUsage = function(stats, days) { $scope.getAggregatedUsage = function(stats, days) {
if (!stats || !stats.length) {
return 0;
}
var count = 0; var count = 0;
var startDate = moment().subtract(days + 1, 'days'); var startDate = moment().subtract(days + 1, 'days');
for (var i = 0; i < stats.length; ++i) { for (var i = 0; i < stats.length; ++i) {

View file

@ -39,10 +39,12 @@ angular.module('quay').directive('heatmap', function () {
domainMargin: [10, 10, 10, 10], domainMargin: [10, 10, 10, 10],
displayLegend: false, displayLegend: false,
tooltip: true, tooltip: true,
weekStartOnMonday: false,
legendColors: { legendColors: {
empty: "#f4f4f4", empty: "#f4f4f4",
min: "#c9e9fb", min: "#c9e9fb",
max: "steelblue", max: "steelblue",
base: 'white'
} }
}); });
} }
@ -59,7 +61,7 @@ angular.module('quay').directive('heatmap', function () {
}; };
$scope.$watch('data', function() { $scope.$watch('data', function() {
$timeout(refresh, 500); $timeout(refresh, 750);
}); });
} }
}; };