From 9c22ee3e29182e3da594769425b685ff397f4cfe Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Wed, 4 May 2016 15:25:30 -0400 Subject: [PATCH] Remove old security scanner UI code --- .../directives/old-image-security-view.html | 116 ------------------ static/js/app.js | 3 - .../directives/ui/old-image-security-view.js | 84 ------------- static/js/pages/exp-new-sec-layout.js | 19 --- static/js/pages/image-view.js | 1 - static/partials/image-view.html | 9 +- 6 files changed, 2 insertions(+), 230 deletions(-) delete mode 100644 static/directives/old-image-security-view.html delete mode 100644 static/js/directives/ui/old-image-security-view.js delete mode 100644 static/js/pages/exp-new-sec-layout.js diff --git a/static/directives/old-image-security-view.html b/static/directives/old-image-security-view.html deleted file mode 100644 index 252f9678f..000000000 --- a/static/directives/old-image-security-view.html +++ /dev/null @@ -1,116 +0,0 @@ -
- -
-
-
-
- -

Image Security

-
-
This image has not been indexed yet
-
- Please try again in a few minutes. -
-
- -
-
This image could not be indexed
-
- Our security scanner was unable to index this image. -
-
- -
-
This image contains no recognized security vulnerabilities
-
- Quay currently indexes Debian, Red Hat and Ubuntu based images. -
-
- -
- - - - - - - - - - - - - - -
VulnerabilityPriorityIntroduced byDescription
{{ vulnerability.name }} - - {{ vulnerability.feature.name }} {{ vulnerability.feature.version }}{{ vulnerability.description }}
- -
-
No matching vulnerabilities found
-
- Please adjust your filter above. -
-
-
-
- - -
-
- - -
-
-
- -

Image Packages

-
-
This image has not been indexed yet
-
- Please try again in a few minutes. -
-
- -
-
This image could not be indexed
-
- Our security scanner was unable to index this image. -
-
- - - - - - - - - - - - - -
Package NamePackage VersionPackage OS
{{ feature.name }}{{ feature.version }}{{ feature.namespace }}
- -
-
No matching packages found
-
- Please adjust your filter above. -
-
-
-
-
diff --git a/static/js/app.js b/static/js/app.js index 0b68bfbd1..dd1f4727f 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -178,9 +178,6 @@ quayApp.config(['$routeProvider', '$locationProvider', 'pages', function($routeP // Enterprise marketing page .route('/enterprise', 'enterprise') - // Experiments - .route('/__exp/newseclayout', 'exp-new-sec-layout') - // Default: Redirect to the landing page .otherwise({redirectTo: '/'}); }]); diff --git a/static/js/directives/ui/old-image-security-view.js b/static/js/directives/ui/old-image-security-view.js deleted file mode 100644 index 218c5f466..000000000 --- a/static/js/directives/ui/old-image-security-view.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Old image security view until formally released. - */ -angular.module('quay').directive('oldImageSecurityView', function () { - var directiveDefinitionObject = { - priority: 0, - templateUrl: '/static/directives/old-image-security-view.html', - replace: false, - transclude: true, - restrict: 'C', - scope: { - 'repository': '=repository', - 'image': '=image', - 'isEnabled': '=isEnabled', - 'view': '@view' - }, - controller: function($scope, $element, Config, ApiService, Features, VulnerabilityService, ImageMetadataService) { - var loadImageSecurity = function() { - if (!Features.SECURITY_SCANNER || $scope.securityResource) { return; } - - $scope.VulnerabilityLevels = VulnerabilityService.getLevels(); - $scope.options = { - 'vulnFilter': '', - 'packageFilter': '' - }; - - var params = { - 'repository': $scope.repository.namespace + '/' + $scope.repository.name, - 'imageid': $scope.image.id, - 'vulnerabilities': true, - }; - - $scope.securityResource = ApiService.getRepoImageSecurityAsResource(params).get(function(resp) { - $scope.securityStatus = resp.status; - $scope.securityFeatures = []; - $scope.securityVulnerabilities = []; - - if (resp.data && resp.data.Layer && resp.data.Layer.Features) { - resp.data.Layer.Features.forEach(function(feature) { - feature_obj = { - 'name': feature.Name, - 'namespace': feature.Namespace, - 'version': feature.Version, - 'addedBy': feature.AddedBy, - } - feature_vulnerabilities = [] - - if (feature.Vulnerabilities) { - feature.Vulnerabilities.forEach(function(vuln) { - vuln_obj = { - 'name': vuln.Name, - 'namespace': vuln.Namespace, - 'description': vuln.Description, - 'link': vuln.Link, - 'severity': vuln.Severity, - 'metadata': vuln.Metadata, - 'feature': jQuery.extend({}, feature_obj), - 'fixedBy': vuln.FixedBy, - 'index': VulnerabilityService.LEVELS[vuln['Severity']]['index'], - } - - feature_vulnerabilities.push(vuln_obj) - $scope.securityVulnerabilities.push(vuln_obj); - }); - } - - feature_obj['vulnerabilities'] = feature_vulnerabilities - $scope.securityFeatures.push(feature_obj); - }); - } - - return resp; - }); - }; - - $scope.$watch('isEnabled', function(isEnabled) { - if ($scope.isEnabled && $scope.repository && $scope.image) { - loadImageSecurity(); - } - }); - } - }; - return directiveDefinitionObject; -}); \ No newline at end of file diff --git a/static/js/pages/exp-new-sec-layout.js b/static/js/pages/exp-new-sec-layout.js deleted file mode 100644 index 3df719060..000000000 --- a/static/js/pages/exp-new-sec-layout.js +++ /dev/null @@ -1,19 +0,0 @@ -(function() { - /** - * Experiment enable page: New layout - */ - angular.module('quayPages').config(['pages', function(pages) { - pages.create('exp-new-sec-layout', 'exp-new-sec-layout.html', ExpCtrl, { - 'newLayout': true - }); - }]); - - function ExpCtrl($scope, CookieService) { - $scope.isEnabled = CookieService.get('quay.exp-new-sec-layout') == 'true'; - - $scope.setEnabled = function(value) { - $scope.isEnabled = value; - CookieService.putPermanent('quay.exp-new-sec-layout', value.toString()); - }; - } -}()); \ No newline at end of file diff --git a/static/js/pages/image-view.js b/static/js/pages/image-view.js index cb22712ee..a83c169ef 100644 --- a/static/js/pages/image-view.js +++ b/static/js/pages/image-view.js @@ -17,7 +17,6 @@ $scope.imageSecurityCounter = 0; $scope.imagePackageCounter = 0; - $scope.newUIExperiment = true; //CookieService.get('quay.exp-new-sec-layout') == 'true'; $scope.options = { 'vulnFilter': '' diff --git a/static/partials/image-view.html b/static/partials/image-view.html index 2feaf53dc..a773d567f 100644 --- a/static/partials/image-view.html +++ b/static/partials/image-view.html @@ -15,7 +15,6 @@ -
@@ -44,16 +43,12 @@
-
- -
+
-
- -
+