From 772983d58e28848f3945eccd278adf8cbb01a262 Mon Sep 17 00:00:00 2001 From: Eddie Arrage Date: Thu, 31 May 2018 23:59:31 +0000 Subject: Add improvements to OVP directory and logo upload - Formatting changes to directory on home page based on OPNFV marketing - Updated branding guide link - Added test_id field to mongo applications collection to associate to approved results for directory - Set Test ID from user accounts with administrator role in Applications view - Provide file upload function for administrator to post company logos for OVP directory - Company logos are stored and served through tornado from cvp-cvpapi container rather than cvp-web JIRA: DOVETAIL-663 JIRA: DOVETAIL-664 Change-Id: I1226b42883afa2ea2eb5551e3836211abbb94b20 Signed-off-by: Eddie Arrage --- .../static/testapi-ui/assets/css/home/home.css | 14 ++++++- .../components/application/application.html | 23 ++++++++++++ .../application/applicationController.js | 21 +++++++++++ .../testapi-ui/components/directory/directory.html | 2 +- .../static/testapi-ui/components/home/home.html | 9 +++-- .../resources/application_handlers.py | 43 ++++++++++++++++++++++ cvp/opnfv_testapi/router/url_mappings.py | 4 ++ 7 files changed, 110 insertions(+), 6 deletions(-) diff --git a/cvp/3rd_party/static/testapi-ui/assets/css/home/home.css b/cvp/3rd_party/static/testapi-ui/assets/css/home/home.css index ce8c88e2..f6f9a2ee 100644 --- a/cvp/3rd_party/static/testapi-ui/assets/css/home/home.css +++ b/cvp/3rd_party/static/testapi-ui/assets/css/home/home.css @@ -55,9 +55,21 @@ #directory_inner > thead > tr > th { border-bottom: 2px solid #ddd; - padding: 8px; + padding-bottom: 8px; } #directory_inner > tbody > tr > td { border-bottom: 1px solid #ddd; } + +.company_logo { + padding-right: 30px; + padding-left: 20px; + padding-top: 20px; + padding-bottom: 20px; +} + +.company_row:hover { + cursor: pointer; + text-decoration: underline; +} diff --git a/cvp/3rd_party/static/testapi-ui/components/application/application.html b/cvp/3rd_party/static/testapi-ui/components/application/application.html index dc27585d..17b17c68 100644 --- a/cvp/3rd_party/static/testapi-ui/components/application/application.html +++ b/cvp/3rd_party/static/testapi-ui/components/application/application.html @@ -179,6 +179,13 @@ urpose. Once we understand more about your product or service, we can determine +
+ + +
+ +
+
@@ -243,6 +250,7 @@ urpose. Once we understand more about your product or service, we can determine Company logo Approve date Approved + Test ID Location Operation @@ -302,6 +310,7 @@ urpose. Once we understand more about your product or service, we can determine {{ app.company_logo }} {{ app.approve_date }} {{ app.approved }} + {{ app.test_id }} {{ app.lab_location | labLocation}} @@ -322,4 +331,18 @@ urpose. Once we understand more about your product or service, we can determine
+ +
+
+

Company Logo Upload for Directory

+
+
+ +
+ +
+
+ diff --git a/cvp/3rd_party/static/testapi-ui/components/application/applicationController.js b/cvp/3rd_party/static/testapi-ui/components/application/applicationController.js index 32f1053e..5666ff23 100644 --- a/cvp/3rd_party/static/testapi-ui/components/application/applicationController.js +++ b/cvp/3rd_party/static/testapi-ui/components/application/applicationController.js @@ -30,6 +30,7 @@ $uibModal, testapiApiUrl, raiseAlert, ngDialog, $scope) { var ctrl = this; + ctrl.uploadLogo=uploadLogo; function init(){ ctrl.organization_name = null; @@ -52,6 +53,7 @@ ctrl.company_logo = null; ctrl.approve_date = null; ctrl.approved = "false"; + ctrl.test_id = null; ctrl.lab_location="internal"; ctrl.lab_name = null; ctrl.lab_email=null; @@ -94,6 +96,7 @@ "company_logo": ctrl.company_logo, "approve_date": ctrl.approve_date, "approved": ctrl.approved, + "test_id": ctrl.test_id, "lab_location": ctrl.lab_location, "lab_email": ctrl.lab_email, "lab_address": ctrl.lab_address, @@ -141,6 +144,24 @@ }); } + function uploadLogo(){ + var file = $scope.logoFile; + var fd = new FormData(); + fd.append('file', file); + + $http.post(testapiApiUrl + "/cvp/applications/uploadlogo", fd, { + transformRequest: angular.identity, + headers: {'Content-Type': undefined} + }).then(function(resp){ + if(resp.data.code && resp.data.code != 0) { + alert(resp.data.msg); + return; + } + }, function(error){ + }); + + }; + function getApplication(){ $http.get(testapiApiUrl + "/cvp/applications?page="+ctrl.currentPage+"&signed&per_page="+ctrl.itemsPerPage).then(function(response){ ctrl.applications = response.data.applications; diff --git a/cvp/3rd_party/static/testapi-ui/components/directory/directory.html b/cvp/3rd_party/static/testapi-ui/components/directory/directory.html index d1383138..1174752c 100644 --- a/cvp/3rd_party/static/testapi-ui/components/directory/directory.html +++ b/cvp/3rd_party/static/testapi-ui/components/directory/directory.html @@ -3,7 +3,7 @@

Compliance Marks Granted to {{ctrl.companyID}}

- + diff --git a/cvp/3rd_party/static/testapi-ui/components/home/home.html b/cvp/3rd_party/static/testapi-ui/components/home/home.html index f7d61cda..184980b3 100644 --- a/cvp/3rd_party/static/testapi-ui/components/home/home.html +++ b/cvp/3rd_party/static/testapi-ui/components/home/home.html @@ -61,7 +61,7 @@ " target="_blank">2018.01 Reviewer Guide 
2018.01 Guidelines Addendum 
-
OPNFV Verified Brand Guidelines