Fix handling of non-features from Clair and other small UI fixes

This commit is contained in:
Joseph Schorr 2016-03-04 18:07:44 -05:00
parent 5b7d6b0638
commit 65037ac5e1
8 changed files with 95 additions and 17 deletions

View file

@ -171,8 +171,11 @@ angular.module('quay').directive('repoPanelTags', function () {
'index': 100000
};
var hasFeatures = false;
if (resp.data && resp.data.Layer && resp.data.Layer.Features) {
resp.data.Layer.Features.forEach(function(feature) {
hasFeatures = true;
if (feature.Vulnerabilities) {
feature.Vulnerabilities.forEach(function(vuln) {
if (VulnerabilityService.LEVELS[vuln.Severity].index == 0) {
@ -197,6 +200,7 @@ angular.module('quay').directive('repoPanelTags', function () {
}
imageData.hasVulnerabilities = !!vulnerabilities.length;
imageData.hasFeatures = hasFeatures;
imageData.vulnerabilities = vulnerabilities;
imageData.highestVulnerability = highest;
}