diff --git a/refstack-ui/app/assets/css/style.css b/refstack-ui/app/assets/css/style.css index 235b79dc..3f3b4e60 100644 --- a/refstack-ui/app/assets/css/style.css +++ b/refstack-ui/app/assets/css/style.css @@ -80,6 +80,12 @@ h1, h2, h3, h4, h5, h6 { cursor: help; } +.checkbox-verified { + border: 1px solid #A9A9A9; + text-align: center; + width: 150px; +} + .capabilities { color: #4B4B4B; } diff --git a/refstack-ui/app/components/results-report/resultsReport.html b/refstack-ui/app/components/results-report/resultsReport.html index 84960e5d..0b3c366d 100644 --- a/refstack-ui/app/components/results-report/resultsReport.html +++ b/refstack-ui/app/components/results-report/resultsReport.html @@ -5,22 +5,50 @@
Test ID: {{ctrl.testId}}
-
Cloud ID: {{ctrl.resultsData.cpid}}
+
Cloud ID: {{ctrl.resultsData.cpid}}
Upload Date: {{ctrl.resultsData.created_at}} UTC
Duration: {{ctrl.resultsData.duration_seconds}} seconds
Total Number of Passed Tests: {{ctrl.resultsData.results.length}} -
-
+
+
+
+ Product: + {{ctrl.resultsData.product_version.product_info.name}} + + ({{ctrl.resultsData.product_version.version}}) +
+
+
+ Associated Guideline: + {{ctrl.resultsData.meta.guideline.slice(0, -5)}} +
+
+ Associated Target Program: + {{ctrl.targetMappings[ctrl.resultsData.meta.target]}} +
+
-
+
+
+
+
+ +
+
@@ -84,6 +112,8 @@ NO

+

Verified: + YES


Capability Overview

diff --git a/refstack-ui/app/components/results-report/resultsReportController.js b/refstack-ui/app/components/results-report/resultsReportController.js index d28053a6..b53184e7 100644 --- a/refstack-ui/app/components/results-report/resultsReportController.js +++ b/refstack-ui/app/components/results-report/resultsReportController.js @@ -36,10 +36,11 @@ ctrl.getVersionList = getVersionList; ctrl.getResults = getResults; - ctrl.isEditingAllowed = isEditingAllowed; + ctrl.isResultAdmin = isResultAdmin; ctrl.isShared = isShared; ctrl.shareTestRun = shareTestRun; ctrl.deleteTestRun = deleteTestRun; + ctrl.updateVerificationStatus = updateVerificationStatus; ctrl.updateGuidelines = updateGuidelines; ctrl.getTargetCapabilities = getTargetCapabilities; ctrl.buildCapabilityV1_2 = buildCapabilityV1_2; @@ -114,6 +115,7 @@ $http.get(content_url).success(function (data) { ctrl.resultsData = data; ctrl.version = ctrl.resultsData.meta.guideline; + ctrl.isVerified = ctrl.resultsData.verification_status; if (ctrl.resultsData.meta.target) { ctrl.target = ctrl.resultsData.meta.target; } @@ -127,14 +129,14 @@ } /** - * This tells you whether the current results can be edited/managed - * based on if the current user is the owner of the results set. - * @returns {Boolean} true if editing is allowed + * This tells you whether the current user has administrative + * privileges for the test result. + * @returns {Boolean} true if the user has admin privileges. */ - function isEditingAllowed() { + function isResultAdmin() { return Boolean(ctrl.resultsData && (ctrl.resultsData.user_role === 'owner' || - ctrl.resultsData.user_role == 'foundation')); + ctrl.resultsData.user_role === 'foundation')); } /** * This tells you whether the current results are shared with the @@ -190,6 +192,27 @@ }); } + /** + * This will send a request to the API to delete the current + * test results set. + */ + function updateVerificationStatus() { + var content_url = [ + refstackApiUrl, '/results/', ctrl.testId + ].join(''); + var data = {'verification_status': ctrl.isVerified}; + ctrl.updateRequest = + $http.put(content_url, data).success( + function () { + ctrl.resultsData.verification_status = ctrl.isVerified; + raiseAlert('success', '', + 'Verification status changed!'); + }).error(function (error) { + ctrl.isVerified = ctrl.resultsData.verification_status; + raiseAlert('danger', error.title, error.detail); + }); + } + /** * This will contact the Refstack API server to retrieve the JSON * content of the guideline file corresponding to the selected diff --git a/refstack-ui/app/components/results/results.html b/refstack-ui/app/components/results/results.html index 2552fba3..1f0c3b9c 100644 --- a/refstack-ui/app/components/results/results.html +++ b/refstack-ui/app/components/results/results.html @@ -32,7 +32,7 @@

-
+
@@ -82,8 +82,8 @@