From 539bf16aa469087ffb6b906c9b2883ac733b8c6f Mon Sep 17 00:00:00 2001 From: Paul Van Eck Date: Tue, 6 Dec 2016 15:11:37 -0800 Subject: [PATCH] Add additional columns to user results table This will allow the table to display some more pertinent info regarding each test run. Also, the public Catalog header button was disabled for now as we ease in new features. Change-Id: Ibb8a4eec216a383a346f5a58fa20010bc1d60689 --- .../app/components/results/results.html | 25 ++++++++++++++++++- .../components/results/resultsController.js | 24 ++++++++++++++++++ refstack-ui/app/shared/header/header.html | 2 ++ refstack-ui/tests/unit/ControllerSpec.js | 17 ++++++++++++- 4 files changed, 66 insertions(+), 2 deletions(-) diff --git a/refstack-ui/app/components/results/results.html b/refstack-ui/app/components/results/results.html index 1f0c3b9c..2a43cd1e 100644 --- a/refstack-ui/app/components/results/results.html +++ b/refstack-ui/app/components/results/results.html @@ -49,6 +49,11 @@ Upload Date Test Run ID + Vendor + Product (version) + Target Program + Guideline + Verified Shared @@ -66,7 +71,25 @@ {{result.created_at}} - {{result.id}} + + {{result.id.slice(0, 8)}}...{{result.id.slice(-8)}} + + + + {{ctrl.vendors[result.product_version.product_info.organization_id].name || '-'}} + + {{result.product_version.product_info.name || '-'}} + + ({{result.product_version.version}}) + + + {{ctrl.targetMappings[result.meta.target] || '-'}} + {{result.meta.guideline.slice(0, -5) || '-'}} + + + - + + diff --git a/refstack-ui/app/components/results/resultsController.js b/refstack-ui/app/components/results/resultsController.js index 747e59de..7b4aed11 100644 --- a/refstack-ui/app/components/results/resultsController.js +++ b/refstack-ui/app/components/results/resultsController.js @@ -38,6 +38,7 @@ ctrl.associateMeta = associateMeta; ctrl.getVersionList = getVersionList; ctrl.getUserProducts = getUserProducts; + ctrl.getVendors = getVendors; ctrl.associateProductVersion = associateProductVersion; ctrl.getProductVersions = getProductVersions; ctrl.prepVersionEdit = prepVersionEdit; @@ -99,6 +100,8 @@ ctrl.update(); } + ctrl.getVendors(); + /** * This will contact the Refstack API to get a listing of test run * results. @@ -244,6 +247,27 @@ }); } + /** + * This will contact the Refstack API to get a listing of + * vendors. + */ + function getVendors() { + var contentUrl = refstackApiUrl + '/vendors'; + ctrl.vendorsRequest = + $http.get(contentUrl).success(function (data) { + ctrl.vendors = {}; + data.vendors.forEach(function(vendor) { + ctrl.vendors[vendor.id] = vendor; + }); + }).error(function (error) { + ctrl.vendors = null; + ctrl.showError = true; + ctrl.error = + 'Error retrieving vendor listing from server: ' + + angular.toJson(error); + }); + } + /** * Send a PUT request to the API server to associate a product with * a test result. diff --git a/refstack-ui/app/shared/header/header.html b/refstack-ui/app/shared/header/header.html index aa6984fd..797ab859 100644 --- a/refstack-ui/app/shared/header/header.html +++ b/refstack-ui/app/shared/header/header.html @@ -19,6 +19,7 @@ RefStack
  • About
  • DefCore Guidelines
  • Community Results
  • +