From d048542288c8d4de39e9991741c6be5abcd36afc Mon Sep 17 00:00:00 2001 From: alecmerdler Date: Wed, 10 May 2017 01:05:03 -0700 Subject: [PATCH] ixed race condition for retrieving image security scan on vulnerability view --- static/js/directives/ui/image-feature-view.js | 12 ++++++++++++ static/js/directives/ui/image-vulnerability-view.js | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/static/js/directives/ui/image-feature-view.js b/static/js/directives/ui/image-feature-view.js index cbf27fbca..efaefc9eb 100644 --- a/static/js/directives/ui/image-feature-view.js +++ b/static/js/directives/ui/image-feature-view.js @@ -86,6 +86,18 @@ angular.module('quay').directive('imageFeatureView', function () { $scope.$watch('options.reverse', buildOrderedFeatures); $scope.$watch('options.filter', buildOrderedFeatures); + $scope.$watch('repository', function(repository) { + if ($scope.isEnabled && $scope.repository && $scope.image) { + loadImageVulnerabilities(); + } + }); + + $scope.$watch('image', function(image) { + if ($scope.isEnabled && $scope.repository && $scope.image) { + loadImageVulnerabilities(); + } + }); + $scope.$watch('isEnabled', function(isEnabled) { if ($scope.isEnabled && $scope.repository && $scope.image) { loadImageVulnerabilities(); diff --git a/static/js/directives/ui/image-vulnerability-view.js b/static/js/directives/ui/image-vulnerability-view.js index c8b693aa2..be4f6fd81 100644 --- a/static/js/directives/ui/image-vulnerability-view.js +++ b/static/js/directives/ui/image-vulnerability-view.js @@ -123,6 +123,18 @@ angular.module('quay').directive('imageVulnerabilityView', function () { $scope.$watch('options.filter', buildOrderedVulnerabilities); $scope.$watch('options.fixableVulns', buildOrderedVulnerabilities); + $scope.$watch('repository', function(repository) { + if ($scope.isEnabled && $scope.repository && $scope.image) { + loadImageVulnerabilities(); + } + }); + + $scope.$watch('image', function(image) { + if ($scope.isEnabled && $scope.repository && $scope.image) { + loadImageVulnerabilities(); + } + }); + $scope.$watch('isEnabled', function(isEnabled) { if ($scope.isEnabled && $scope.repository && $scope.image) { loadImageVulnerabilities();