aboutsummaryrefslogtreecommitdiffstats
path: root/3rd_party/static/testapi-ui/components/application
diff options
context:
space:
mode:
authorDan Xu <xudan16@huawei.com>2019-04-11 06:39:25 +0000
committerGerrit Code Review <gerrit@opnfv.org>2019-04-11 06:39:25 +0000
commitdbcc039303c7f010348814694b8f75d621aa51e3 (patch)
tree2ecc14d87b24166c2e6d49f33103b63e1ca4c6fd /3rd_party/static/testapi-ui/components/application
parentd32ce7d109fb36277681629c8e648777664862b2 (diff)
parent71bdc6752f47b7da7282f786570fbe717973fb6d (diff)
Merge "Enhanced OVP Web Portal"
Diffstat (limited to '3rd_party/static/testapi-ui/components/application')
-rw-r--r--3rd_party/static/testapi-ui/components/application/application.html231
-rw-r--r--3rd_party/static/testapi-ui/components/application/applicationController.js198
2 files changed, 122 insertions, 307 deletions
diff --git a/3rd_party/static/testapi-ui/components/application/application.html b/3rd_party/static/testapi-ui/components/application/application.html
index 0b45ab3..5e78546 100644
--- a/3rd_party/static/testapi-ui/components/application/application.html
+++ b/3rd_party/static/testapi-ui/components/application/application.html
@@ -1,207 +1,4 @@
<div class="container-fluid common-main-container">
- <div class="top-site-banner">
- <div class="container">
- <p class="p1">Complete this application then start your CVP journey</p>
- </div>
- </div>
-
- <div class="row" style="margin-top: 20px;">
- <div class="col-lg-12 container">
- <form id="OsLogoProgramForm_Form" action="/brand/logo-request/Form" method="post"
- enctype="application/x-www-form-urlencoded">
- <p id="OsLogoProgramForm_Form_error" class="message" style="display: none;"></p>
- <fieldset>
- <div class="field text col-md-4">
- <label class="left" >Organization name</label>
- <i uib-tooltip="Organization name" class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <div class="middleColumn">
- <input type="text" class="text form-control" ng-model="ctrl.organization_name" required="required"
- aria-required="true">
- </div>
- </div>
- <div class="field text col-md-4">
- <label class="left">Organization website (if public)</label>
- <i uib-tooltip="Organization website if it is public"
- class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <div class="middleColumn">
- <input type="text" class="text form-control" ng-model="ctrl.organization_web" required="required"
- aria-required="true">
- </div>
- </div>
- <div class="col-md-4"></div>
- <div class="field email text col-md-4">
- <label class="left">Product name and/or identifier</label>
- <i uib-tooltip="Product name and/or identifier" class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <div class="middleColumn">
- <input type="text" class="email text form-control" ng-model="ctrl.product_name" required="required"
- aria-required="true">
- </div>
- </div>
- <div class="field text col-md-4">
- <label class="left">Product specifications</label>
- <i uib-tooltip="A link of product specifications"
- class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <div class="middleColumn">
- <input type="text" class="text form-control" ng-model="ctrl.product_spec" required="required"
- aria-required="true">
- </div>
- </div>
- <div class="field text col-md-4">
- <label class="left">Product public documentation</label>
- <i uib-tooltip="A link of product public documentation"
- class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <div class="middleColumn">
- <input type="text" class="text form-control" ng-model="ctrl.product_documentation" required="required"
- aria-required="true">
- </div>
- </div>
- <div class="field text col-md-4">
- <label class="left">Product categories</label>
- <i uib-tooltip="Product categories" class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <div class="middleColumn">
- <select class="form-control" ng-model="ctrl.product_categories">
- <option value="soft&hard">software and hardware</option>
- <option value="soft&3rd">software and third party hardware</option>
- </select>
- </div>
- </div>
- <div class="field text col-md-4">
- <label class="left">Primary contact name</label>
- <i uib-tooltip="Primary contact name" class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <div class="middleColumn">
- <input type="text" class="text form-control" ng-model="ctrl.prim_name" required="required"
- aria-required="true">
- </div>
- </div>
- <div class="field text col-md-4">
- <label class="left">Primary business email</label>
- <i uib-tooltip="Only the Business email address should be used for official communication with OPNFV CVP"
- class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <div class="middleColumn">
- <input type="text" class="text form-control" ng-model="ctrl.prim_email" required="required"
- aria-required="true">
- </div>
- </div>
- <div class="field text col-md-4">
- <label class="left">Primary postal address</label>
- <i uib-tooltip="Primary postal address" class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <div class="middleColumn">
- <input type="text" class="text form-control" ng-model="ctrl.prim_address" required="required"
- aria-required="true">
- </div>
- </div>
- <div class="field text col-md-4">
- <label class="left">Primary phone number</label>
- <i uib-tooltip="Primary phone number" class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <div class="middleColumn">
- <input type="text" class="text form-control" ng-model="ctrl.prim_phone" required="required"
- aria-required="true">
- </div>
- </div>
- <div class="field text col-md-4">
- <label class="left">Description</label>
- <i uib-tooltip="Product Description" class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <div class="middleColumn">
- <input type="text" class="text form-control" ng-model="ctrl.description">
- </div>
- </div>
- <div class="field text col-md-4">
- <label class="left">SUT Version</label>
- <i uib-tooltip="SUT Version" class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <div class="middleColumn">
- <input type="text" class="text form-control" ng-model="ctrl.sut_version">
- </div>
- </div>
- <div class="field text col-md-4">
- <label class="left">SUT HW Version</label>
- <i uib-tooltip="SUT HW Version - leave blank if not applicable"
- class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <div class="middleColumn">
- <input type="text" class="text form-control" ng-model="ctrl.sut_hw_version">
- </div>
- </div>
- <div class="field text col-md-4">
- <label class="left">OVP Version</label>
- <i uib-tooltip="OVP Version" class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <div class="middleColumn">
- <input type="text" class="text form-control" ng-model="ctrl.ovp_version">
- </div>
- </div>
- <div class="field text col-md-4">
- <label class="left">OVP Category</label>
- <i uib-tooltip="OVP Category" class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <div class="middleColumn">
- <input type="text" class="text form-control" ng-model="ctrl.ovp_category">
- </div>
- </div>
- <div class="field text col-md-4">
- <label class="left">Company Logo</label>
- <i uib-tooltip="Company Logo" class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <div class="middleColumn">
- <input type="text" class="text form-control" ng-model="ctrl.company_logo">
- </div>
- </div>
- <div class="field text col-md-4">
- <label class="left">Approve Date</label>
- <i uib-tooltip="Approve Date - YYYY-MM-DD" class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <div class="middleColumn">
- <input type="text" class="text form-control" ng-model="ctrl.approve_date">
- </div>
- </div>
- <div class="field text col-md-4">
- <label class="left">Approved</label>
- <i uib-tooltip="Approved - insert true or false" class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <div class="middleColumn">
- <input type="text" class="text form-control" ng-model="ctrl.approved">
- </div>
- </div>
- <div class="field text col-md-4">
- <label class="left">Test ID</label>
- <i uib-tooltip="Test ID - enter approved test_id"
- class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <div class="middleColumn">
- <input type="text" class="text form-control" ng-model="ctrl.test_id">
- </div>
- </div>
- <div class="field text col-md-4">
- <label class="left">Location</label>
- <i uib-tooltip="Location" class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <div class="middleColumn">
- <select class="form-control" ng-model="ctrl.lab_location">
- <option value="internal">internal vendor lab</option>
- <option value="third">third-party lab</option>
- </select>
- </div>
- </div>
- <div ng-if="ctrl.lab_location=='third'" class="field text">
- <div class="field text col-md-4">
- <label class="left">Lab Name</label>
- <i uib-tooltip="Lab Name" class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <input type="text" class="text form-control" ng-model="ctrl.lab_name">
- </div>
- <div class="field text col-md-4">
- <label class="left">Lab Email</label>
- <i uib-tooltip="Lab Email" class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <input type="text" class="text form-control" ng-model="ctrl.lab_email">
- </div>
- <div class="field text col-md-4">
- <label class="left">Lab Address</label>
- <i uib-tooltip="Lab Address" class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <input type="text" class="text form-control" ng-model="ctrl.lab_address">
- </div>
- <div class="field text col-md-4">
- <label class="left">Lab Phone Number</label>
- <i uib-tooltip="Lab Phone Number" class="glyphicon glyphicon-question-sign opnfv-blue"></i>
- <input type="text" class="text form-control" ng-model="ctrl.lab_phone">
- </div>
- </div>
- </fieldset>
- </form>
- </div>
- </div>
- <div class="Actions">
- <button class="btn btn-success cvp-btn" ng-click="ctrl.openConfirmModal()">Submit</button>
- </div>
<div class="results-table" style="margin-top: 30px; overflow: scroll;">
<table class="table table-striped table-hover">
<thead>
@@ -217,7 +14,7 @@
<th>Primary business email</th>
<th>Primary postal address</th>
<th>Primary phone number</th>
- <th>Owner</th>
+ <th>User ID</th>
<th>Description</th>
<th>SUT version</th>
<th>SUT HW version</th>
@@ -225,7 +22,6 @@
<th>OVP category</th>
<th>Company logo</th>
<th>Approve date</th>
- <th>Approved</th>
<th>Test ID</th>
<th>Location</th>
<th>Operation</th>
@@ -284,7 +80,6 @@
<td>{{ app.ovp_category }}</td>
<td>{{ app.company_logo }}</td>
<td>{{ app.approve_date }}</td>
- <td>{{ app.approved }}</td>
<td>{{ app.test_id }}</td>
<td>
<span popover-enable="app.lab_location != 'internal'" uib-popover-template="ctrl.lab_tpl"
@@ -293,7 +88,13 @@
<i ng-if="app.lab_location != 'internal'" class="glyphicon glyphicon-info-sign opnfv-blue"></i>
</td>
<td>
- <a ng-click="ctrl.deleteApp(app._id)" class="badge badge-info">
+ <a ng-click="ctrl.toggleApproveApp(app._id, 'true')" class="badge badge-info"
+ ng-if="app.approved == 'false'"
+ data-toggle="tooltip" title="Approve Application">
+ <i class="glyphicon glyphicon-ok" ></i>
+ </a>
+ <a ng-click="ctrl.deleteApp(app._id)" class="badge badge-info"
+ data-toggle="tooltip" title="Delete Application">
<i class="glyphicon glyphicon-remove" ></i>
</a>
</td>
@@ -315,20 +116,4 @@
</uib-pagination>
</div>
</div>
-
- <div>
- <br>
- <h3>Company Logo Upload for Directory</h3>
- <form enctype="multipart/form-data" method="post">
- <div class="form-group col-m-3">
- <input class="form-contrl btn btn-success cvp-btn medium accent-color regular-button" file-model="logoFile"
- type="file">
- </div>
- <div class="form-group col-m-3">
- <a class="btn btn-success cvp-btn medium accent-color regular-button" ng-click="ctrl.uploadLogo()">
- <span>Upload Logo</span>
- </a>
- </div>
- </form>
- </div>
</div>
diff --git a/3rd_party/static/testapi-ui/components/application/applicationController.js b/3rd_party/static/testapi-ui/components/application/applicationController.js
index e2a4f75..6ae157e 100644
--- a/3rd_party/static/testapi-ui/components/application/applicationController.js
+++ b/3rd_party/static/testapi-ui/components/application/applicationController.js
@@ -28,35 +28,36 @@
$uibModal, testapiApiUrl, raiseAlert, ngDialog, $scope) {
var ctrl = this;
- ctrl.uploadLogo = uploadLogo;
+// ctrl.uploadLogo = uploadLogo;
function init() {
- ctrl.organization_name = null;
- ctrl.organization_web = null;
- ctrl.product_name = null;
- ctrl.product_spec = null;
- ctrl.product_documentation = null;
- ctrl.product_categories = "soft&hard";
- ctrl.prim_name = null;
- ctrl.prim_email = null;
- ctrl.prim_address = null;
- ctrl.prim_phone = null;
- ctrl.description = null;
- ctrl.sut_version = null;
- ctrl.sut_hw_version = null;
- ctrl.ovp_version = "2018.01";
- ctrl.ovp_category = "Infrastructure";
- 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;
- ctrl.lab_address = null;
- ctrl.lab_phone = null;
ctrl.applications = [];
- ctrl.showApplications = [];
+// ctrl.organization_name = null;
+// ctrl.organization_web = null;
+// ctrl.product_name = null;
+// ctrl.product_spec = null;
+// ctrl.product_documentation = null;
+// ctrl.product_categories = "soft&hard";
+// ctrl.prim_name = null;
+// ctrl.prim_email = null;
+// ctrl.prim_address = null;
+// ctrl.prim_phone = null;
+// ctrl.description = null;
+// ctrl.sut_version = null;
+// ctrl.sut_hw_version = null;
+// ctrl.ovp_version = "2018.01";
+// ctrl.ovp_category = "Infrastructure";
+// 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;
+// ctrl.lab_address = null;
+// ctrl.lab_phone = null;
+// ctrl.applications = [];
+// ctrl.showApplications = [];
ctrl.totalItems = null;
ctrl.currentPage = 1;
@@ -70,52 +71,52 @@
}
- ctrl.submitForm = function() {
- var data = {
- "organization_name": ctrl.organization_name,
- "organization_web": ctrl.organization_web,
- "product_name": ctrl.product_name,
- "product_spec": ctrl.product_spec,
- "product_documentation": ctrl.product_documentation,
- "product_categories": ctrl.product_categories,
- "prim_name": ctrl.prim_name,
- "prim_email": ctrl.prim_email,
- "prim_address": ctrl.prim_address,
- "prim_phone": ctrl.prim_phone,
- "description": ctrl.description,
- "sut_version": ctrl.sut_version,
- "sut_hw_version": ctrl.sut_hw_version,
- "ovp_version": ctrl.ovp_version,
- "ovp_category": ctrl.ovp_category,
- "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,
- "lab_phone": ctrl.lab_phone
- };
- $http.post(testapiApiUrl + "/cvp/applications", data).then(function(resp) {
- if (resp.data.code && resp.data.code != 0) {
- alert(resp.data.msg);
- return;
- }
- getApplication();
- }, function(error) {
- });
- }
-
- ctrl.openConfirmModal = function() {
- var resp = confirm("Are you sure to submit?");
- if (resp) {
- ctrl.submitForm();
- }
- }
-
- ctrl.cancelSubmit = function() {
- ngDialog.close();
- }
+// ctrl.submitForm = function() {
+// var data = {
+// "organization_name": ctrl.organization_name,
+// "organization_web": ctrl.organization_web,
+// "product_name": ctrl.product_name,
+// "product_spec": ctrl.product_spec,
+// "product_documentation": ctrl.product_documentation,
+// "product_categories": ctrl.product_categories,
+// "prim_name": ctrl.prim_name,
+// "prim_email": ctrl.prim_email,
+// "prim_address": ctrl.prim_address,
+// "prim_phone": ctrl.prim_phone,
+// "description": ctrl.description,
+// "sut_version": ctrl.sut_version,
+// "sut_hw_version": ctrl.sut_hw_version,
+// "ovp_version": ctrl.ovp_version,
+// "ovp_category": ctrl.ovp_category,
+// "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,
+// "lab_phone": ctrl.lab_phone
+// };
+// $http.post(testapiApiUrl + "/cvp/applications", data).then(function(resp) {
+// if (resp.data.code && resp.data.code != 0) {
+// alert(resp.data.msg);
+// return;
+// }
+// getApplication();
+// }, function(error) {
+// });
+// }
+
+// ctrl.openConfirmModal = function() {
+// var resp = confirm("Are you sure to submit?");
+// if (resp) {
+// ctrl.submitForm();
+// }
+// }
+//
+// ctrl.cancelSubmit = function() {
+// ngDialog.close();
+// }
ctrl.updatePage = function() {
getApplication();
@@ -136,23 +137,52 @@
});
}
- function uploadLogo() {
- var file = $scope.logoFile;
- var fd = new FormData();
- fd.append('file', file);
+ ctrl.toggleApproveApp = function(id, approved) {
+ if (approved === 'true') {
+ var text = 'Are you sure you want to approve this application?';
+ } else {
+ var text = 'Are you sure you want to remove approval of this application?';
+ }
+
+ var resp = confirm(text);
+ if (!resp)
+ return;
- $http.post(testapiApiUrl + "/cvp/applications/uploadlogo", fd, {
+ var updateUrl = testapiApiUrl + "/cvp/applications/" + id;
+ var data = {};
+ data['item'] = 'approved';
+ data['approved'] = approved;
+
+ $http.put(updateUrl, JSON.stringify(data), {
transformRequest: angular.identity,
- headers: {'Content-Type': undefined}
- }).then(function(resp) {
- if (resp.data.code && resp.data.code != 0) {
- alert(resp.data.msg);
- return;
- }
+ headers: {'Content-Type': 'application/json'}}).then(function(ret) {
+ if (ret.data.code && ret.data.code != 0) {
+ alert(ret.data.msg);
+ return;
+ }
+ getApplication();
}, function(error) {
+ alert('Error when update data');
});
+ }
- };
+// 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) {