diff options
127 files changed, 2105 insertions, 463 deletions
diff --git a/.coveragerc b/.coveragerc index c6af317..5c7f892 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + [run] omit = opnfv_testapi/tests/* [report] @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + { "ignore": [ "order-alphabetical", diff --git a/3rd_party/static/onap-ui/assets/css/ascend.css b/3rd_party/static/onap-ui/assets/css/ascend.css index cd7370f..5e0d7bb 100644 --- a/3rd_party/static/onap-ui/assets/css/ascend.css +++ b/3rd_party/static/onap-ui/assets/css/ascend.css @@ -1,3 +1,12 @@ +/*******************************************************************************
+ * Copyright (c) 2019 opnfv.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Apache License, Version 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *******************************************************************************/
+
.ascend .container-wrap,
.ascend .project-title,
body .vc_text_separator div,
diff --git a/3rd_party/static/onap-ui/assets/css/combine.css b/3rd_party/static/onap-ui/assets/css/combine.css index ce80767..90b9fb2 100644 --- a/3rd_party/static/onap-ui/assets/css/combine.css +++ b/3rd_party/static/onap-ui/assets/css/combine.css @@ -1,3 +1,12 @@ +/******************************************************************************* + * Copyright (c) 2019 opnfv. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Apache License, Version 2.0 + * which accompanies this distribution, and is available at + * http://www.apache.org/licenses/LICENSE-2.0 + *******************************************************************************/ + html { overflow-y: scroll; } diff --git a/3rd_party/static/onap-ui/assets/css/cvp-style.css b/3rd_party/static/onap-ui/assets/css/cvp-style.css index e544458..f366863 100644 --- a/3rd_party/static/onap-ui/assets/css/cvp-style.css +++ b/3rd_party/static/onap-ui/assets/css/cvp-style.css @@ -1,3 +1,12 @@ +/******************************************************************************* + * Copyright (c) 2019 opnfv. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Apache License, Version 2.0 + * which accompanies this distribution, and is available at + * http://www.apache.org/licenses/LICENSE-2.0 + *******************************************************************************/ + .nav>li>a { font-size: 18px; } @@ -112,8 +121,8 @@ border-color: #1080A7; } .btn-success-cust:focus, .btn-success-cust:hover { -border-color: #27CCC0; -background-color: #27CCC0; +border-color: #1080A7; +background-color: #1080A7; } input:invalid { @@ -122,4 +131,4 @@ input:invalid { input:valid { border: 2px solid black; -}
\ No newline at end of file +} diff --git a/3rd_party/static/onap-ui/assets/css/header.css b/3rd_party/static/onap-ui/assets/css/header.css index cc5ad30..23c9668 100644 --- a/3rd_party/static/onap-ui/assets/css/header.css +++ b/3rd_party/static/onap-ui/assets/css/header.css @@ -1,3 +1,12 @@ +/******************************************************************************* + * Copyright (c) 2019 opnfv. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Apache License, Version 2.0 + * which accompanies this distribution, and is available at + * http://www.apache.org/licenses/LICENSE-2.0 + *******************************************************************************/ + .header-container-1 { height: 80px; background-color: #383A35; diff --git a/3rd_party/static/onap-ui/assets/css/home/home.css b/3rd_party/static/onap-ui/assets/css/home/home.css index ed0e3f4..79c10c7 100644 --- a/3rd_party/static/onap-ui/assets/css/home/home.css +++ b/3rd_party/static/onap-ui/assets/css/home/home.css @@ -1,3 +1,12 @@ +/******************************************************************************* + * Copyright (c) 2019 opnfv. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Apache License, Version 2.0 + * which accompanies this distribution, and is available at + * http://www.apache.org/licenses/LICENSE-2.0 + *******************************************************************************/ + .home-container { padding-left: 0px; padding-right: 0px; diff --git a/3rd_party/static/onap-ui/assets/css/index.css b/3rd_party/static/onap-ui/assets/css/index.css index 3140fce..9906291 100644 --- a/3rd_party/static/onap-ui/assets/css/index.css +++ b/3rd_party/static/onap-ui/assets/css/index.css @@ -1,3 +1,12 @@ +/******************************************************************************* + * Copyright (c) 2019 opnfv. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Apache License, Version 2.0 + * which accompanies this distribution, and is available at + * http://www.apache.org/licenses/LICENSE-2.0 + *******************************************************************************/ + .index-header { padding-left: 0px; padding-right: 0px; diff --git a/3rd_party/static/onap-ui/assets/img/icon.png b/3rd_party/static/onap-ui/assets/img/icon.png Binary files differindex 0dc66fe..2a3458a 100644 --- a/3rd_party/static/onap-ui/assets/img/icon.png +++ b/3rd_party/static/onap-ui/assets/img/icon.png diff --git a/3rd_party/static/onap-ui/components/application/application.html b/3rd_party/static/onap-ui/components/application/application.html index 2238ca4..4cf956f 100644 --- a/3rd_party/static/onap-ui/components/application/application.html +++ b/3rd_party/static/onap-ui/components/application/application.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="container-fluid common-main-container"> <div class="results-table" style="margin-top: 30px; overflow: scroll;"> <table class="table table-striped table-hover"> @@ -56,7 +65,8 @@ </div> </script> <tbody style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"> - <tr ng-if="results.status != 'review'" ng-repeat="app in ctrl.applications"> + <tr ng-if="auth.currentUser.role.indexOf('administrator') != -1" + ng-repeat="app in ctrl.applications"> <td>{{ app.creation_date | limitTo: 10 }}</td> <td>{{ app.owner }}</td> <td>{{ app.onap_version }}</td> @@ -80,7 +90,7 @@ <i ng-if="app.lab_location != 'internal'" class="glyphicon glyphicon-info-sign opnfv-blue"></i> </td> <td> - <a ng-click="ctrl.toggleApproveApp(app._id, 'true')" class="badge badge-info" + <a ng-click="ctrl.toggleApproveApp(app._id, 'true', app.owner)" class="badge badge-info" ng-if="app.approved == 'false'" data-toggle="tooltip" title="Approve Application"> <i class="glyphicon glyphicon-ok" ></i> diff --git a/3rd_party/static/onap-ui/components/application/applicationController.js b/3rd_party/static/onap-ui/components/application/applicationController.js index 094ffdc..134b002 100644 --- a/3rd_party/static/onap-ui/components/application/applicationController.js +++ b/3rd_party/static/onap-ui/components/application/applicationController.js @@ -20,17 +20,28 @@ .controller('ApplicationController', ApplicationController); ApplicationController.$inject = [ - '$http', '$stateParams', '$window', '$sce', + '$http', '$state', '$stateParams', '$window', '$sce', '$uibModal', 'testapiApiUrl', 'raiseAlert', 'ngDialog', '$scope' ]; /** */ - function ApplicationController($http, $stateParams, $window, $sce, + function ApplicationController($http, $state, $stateParams, $window, $sce, $uibModal, testapiApiUrl, raiseAlert, ngDialog, $scope) { var ctrl = this; + /** Check to see if this page should display community results. */ + ctrl.isAdministrator = $scope.auth.currentUser.role.indexOf('administrator') != -1; + // Should only be on user-results-page if authenticated. + if (!$scope.auth.isAuthenticated) { + $state.go('home'); + } + // Should only be on applications if administrator + if (!ctrl.isAdministrator) { + $state.go('home'); + } + function init() { ctrl.applications = []; @@ -65,7 +76,7 @@ }); } - ctrl.toggleApproveApp = function(id, approved) { + ctrl.toggleApproveApp = function(id, approved, owner) { if (approved === 'true') { var text = 'Are you sure you want to approve this application?'; } else { @@ -80,6 +91,7 @@ var data = {}; data['item'] = 'approved'; data['approved'] = approved; + data['owner'] = owner; $http.put(updateUrl, JSON.stringify(data), { transformRequest: angular.identity, @@ -95,7 +107,7 @@ } function getApplication() { - $http.get(testapiApiUrl + "/onap/cvp/applications?page=" + ctrl.currentPage + "&signed&per_page=" + ctrl.itemsPerPage).then(function(response) { + $http.get(testapiApiUrl + "/onap/cvp/applications?page=" + ctrl.currentPage + "&signed&per_page=" + ctrl.itemsPerPage + "&applications").then(function(response) { ctrl.applications = response.data.applications; ctrl.totalItems = response.data.pagination.total_pages * ctrl.itemsPerPage; ctrl.currentPage = response.data.pagination.current_page; diff --git a/3rd_party/static/onap-ui/components/directory/directory.html b/3rd_party/static/onap-ui/components/directory/directory.html index 4a04bd7..54bc90d 100644 --- a/3rd_party/static/onap-ui/components/directory/directory.html +++ b/3rd_party/static/onap-ui/components/directory/directory.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="container-fluid common-main-container"> <h3>ONAP Verified Product Directory</h3> <div> diff --git a/3rd_party/static/onap-ui/components/home/home.html b/3rd_party/static/onap-ui/components/home/home.html index 1c1490d..ca58b0a 100644 --- a/3rd_party/static/onap-ui/components/home/home.html +++ b/3rd_party/static/onap-ui/components/home/home.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="container-fluid"> <div class="row"> <div class="col-md-2 home-category" ng-style="{'height': ctrl.height}"> @@ -13,7 +22,7 @@ <div id="collapseTwo" class="panel-collapse collapse"> <div class="panel-body"> <div> - <a href="https://opnfv-dovetail.readthedocs.io/en/latest/testing/user/userguide/testing_guide.html" + <a href="https://opnfv-dovetail.readthedocs.io/en/latest/testing/user/userguide/vnf_test_guide.html" target="_blank" rel="noopener">OVP / Dovetail User Guide <span class="glyphicon glyphicon-new-window" aria-hidden="true"></span> </a> @@ -98,18 +107,20 @@ <a target="_blank" rel="noopener" href="https://www.lfnetworking.org/OVP">OPNFV Verification Program (OVP) page</a> for more information</p></li> <li><p class="home-content-text"> - From the home page, Submit the Participation Form</p></li> + From the home page, submit the + <a target="_blank" rel="noopener" href="https://na3.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=034ffa32-3c2d-4a78-b2ed-af63c3acf192&env=na3-eu1&v=2"> + Participation Form</a></p></li> <li><p class="home-content-text"> Follow the step-by-step instructions in the doc: - <a href="https://opnfv-dovetail.readthedocs.io/en/latest/testing/user/certificationworkflow/index.html">OVP + <a target="_blank" rel="noopener" href="https://opnfv-dovetail.readthedocs.io/en/latest/testing/user/certificationworkflow/index.html">OVP Workflow</a></p></li> <li><p class="home-content-text"> Use this portal to upload your VNF test results when ready</p></li> </ul> <p class="home-content-text" style="padding-bottom: 40px;"> - Please send any questions to <a href="mailto:verified@opnfv.org">verified@opnfv.org</a>. + Please send any questions to <a href="mailto:ovp-support@lfnetworking.org">ovp-support@lfnetworking.org</a>. </p> </div> </div> diff --git a/3rd_party/static/onap-ui/components/logout/logout.html b/3rd_party/static/onap-ui/components/logout/logout.html index 38a5c36..135784e 100644 --- a/3rd_party/static/onap-ui/components/logout/logout.html +++ b/3rd_party/static/onap-ui/components/logout/logout.html @@ -1 +1,10 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div cg-busy="{promise:ctrl.redirectWait,message:'Logging you out...'}"></div> diff --git a/3rd_party/static/onap-ui/components/profile/profile.html b/3rd_party/static/onap-ui/components/profile/profile.html index cb73335..fa633d5 100644 --- a/3rd_party/static/onap-ui/components/profile/profile.html +++ b/3rd_party/static/onap-ui/components/profile/profile.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="container-fluid common-main-container"> <h3>User profile</h3> <div cg-busy="{promise:ctrl.authRequest,message:'Loading'}"></div> diff --git a/3rd_party/static/onap-ui/components/results-report/partials/reportDetails.html b/3rd_party/static/onap-ui/components/results-report/partials/reportDetails.html index 3f3e9c9..20295ab 100644 --- a/3rd_party/static/onap-ui/components/results-report/partials/reportDetails.html +++ b/3rd_party/static/onap-ui/components/results-report/partials/reportDetails.html @@ -1,4 +1,13 @@ <!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + +<!-- HTML for each accordion group that separates the status types on the results report page. --> diff --git a/3rd_party/static/onap-ui/components/results-report/resultsReport.html b/3rd_party/static/onap-ui/components/results-report/resultsReport.html index 38e602d..236ebfd 100644 --- a/3rd_party/static/onap-ui/components/results-report/resultsReport.html +++ b/3rd_party/static/onap-ui/components/results-report/resultsReport.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="container-fluid common-main-container"> <h3>Test Run Results</h3> @@ -15,8 +24,6 @@ <strong>Total: {{ctrl.statistics.total}}, Pass: {{ ctrl.statistics.pass}}, Rate: {{ ctrl.statistics.pass / ctrl.statistics.total * 100 | number:2 }}%</strong><br> <strong>Mandatory Total: {{ctrl.statistics.mandatory.total}}, Pass: {{ ctrl.statistics.mandatory.pass }}, Rate: {{ ctrl.statistics.mandatory.pass / ctrl.statistics.mandatory.total * 100 | number:2 }}%</strong><br> <strong>Optional Total: {{ctrl.statistics.optional.total}}, Pass: {{ ctrl.statistics.optional.pass }}, Rate: {{ ctrl.statistics.optional.pass / ctrl.statistics.optional.total * 100 | number:2 }}%</strong><br> - <hr> - <strong>{{ ctrl.validation }}</strong><br> <div> <hr> diff --git a/3rd_party/static/onap-ui/components/results-report/resultsReportController.js b/3rd_party/static/onap-ui/components/results-report/resultsReportController.js index 09601ad..1997c3d 100644 --- a/3rd_party/static/onap-ui/components/results-report/resultsReportController.js +++ b/3rd_party/static/onap-ui/components/results-report/resultsReportController.js @@ -78,24 +78,54 @@ } function gotoResultLog(case_name) { - var case_area = case_name.split(".")[0]; - var log_url = "/logs/" + ctrl.testId + "/results/"; - log_url += case_area + "_logs/" + case_name + ".out"; - var is_reachable = false; - - $.ajax({ - url: log_url, - async: false, - success: function (response) { - is_reachable = true; - }, - error: function (response) { - alert("Log file could not be found. Please confirm this case has been executed successfully."); + function openFile(log_url) { + var is_reachable = false; + + $.ajax({ + url: log_url, + async: false, + success: function (response) { + is_reachable = true; + }, + error: function (response) { + alert("Log file could not be found. Please confirm this case has been executed successfully."); + } + }); + + if (is_reachable == true) { + window.open(log_url); } - }); + } - if (is_reachable == true) { - window.open(log_url); + var log_url = "/logs/" + ctrl.testId + "/results/"; + if (ctrl.version == '2019.04') { + var case_area = case_name.split(".")[0]; + log_url += case_area + "_logs/" + case_name + ".out"; + openFile(log_url); + } else { + var test_url = testapiApiUrl + '/onap/tests/' + ctrl.innerId; + $http.get(test_url).then(function(test_resp){ + var result_url = testapiApiUrl + '/results/' + test_resp.data.results[0]; + $http.get(result_url).then(function(result_resp){ + var keepGoing = true; + angular.forEach(result_resp.data.testcases_list, function(testcase, index) { + if (keepGoing == true) { + if (testcase.name == case_name) { + log_url += testcase.portal_key_file; + openFile(log_url); + keepGoing = false; + } + } + }); + if (keepGoing == true) { + alert("Log file could not be found. Please confirm this case has been executed successfully."); + } + }, function(result_error) { + alert('Error when get result record'); + }); + }, function(test_error) { + alert('Error when get test record'); + }); } } diff --git a/3rd_party/static/onap-ui/components/results/modal/applicationModal.html b/3rd_party/static/onap-ui/components/results/modal/applicationModal.html index 0ca4b84..4d6f836 100644 --- a/3rd_party/static/onap-ui/components/results/modal/applicationModal.html +++ b/3rd_party/static/onap-ui/components/results/modal/applicationModal.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="container-fluid common-main-container"> <div class="top-site-banner"> <div class="container"> diff --git a/3rd_party/static/onap-ui/components/results/modal/applicationView.html b/3rd_party/static/onap-ui/components/results/modal/applicationView.html index 79341f8..d5e3a26 100644 --- a/3rd_party/static/onap-ui/components/results/modal/applicationView.html +++ b/3rd_party/static/onap-ui/components/results/modal/applicationView.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="container-fluid common-main-container"> <div class="top-site-banner"> <div class="container"> diff --git a/3rd_party/static/onap-ui/components/results/modal/reviewsModal.html b/3rd_party/static/onap-ui/components/results/modal/reviewsModal.html index c93d1ef..e3faa5b 100644 --- a/3rd_party/static/onap-ui/components/results/modal/reviewsModal.html +++ b/3rd_party/static/onap-ui/components/results/modal/reviewsModal.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="container-fluid common-main-container"> <div class="top-site-banner"> <div class="container"> diff --git a/3rd_party/static/onap-ui/components/results/modal/sharedModal.html b/3rd_party/static/onap-ui/components/results/modal/sharedModal.html index 021a355..a029aa5 100644 --- a/3rd_party/static/onap-ui/components/results/modal/sharedModal.html +++ b/3rd_party/static/onap-ui/components/results/modal/sharedModal.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div> <h4>Enter user name or email</h4> <input type="text" ng-model="ctrl.userName"> diff --git a/3rd_party/static/onap-ui/components/results/results.html b/3rd_party/static/onap-ui/components/results/results.html index ce43036..daa9ae4 100644 --- a/3rd_party/static/onap-ui/components/results/results.html +++ b/3rd_party/static/onap-ui/components/results/results.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="container-fluid common-main-container"> <h3>{{ctrl.pageHeader}}</h3> <p>{{ctrl.pageParagraph}}</p> @@ -81,7 +90,8 @@ <a ng-class="{'hide': result.status != 'review'}" ng-click="ctrl.deleteApplication(result)">withdraw submit</a> </li> - <li role="menuitem" ng-if="auth.currentUser.openid == result.owner && ctrl.isUserResults" + <li role="menuitem" + ng-if="auth.currentUser.openid == result.owner && ctrl.isUserResults && auth.currentUser.role.indexOf('user') != -1" class="menu-item menu-item-type-post_type menu-item-object-page"> <a ng-class="{'hide': result.status != 'private'}" ng-click="ctrl.openApplicationModal(result)">submit to review</a> diff --git a/3rd_party/static/onap-ui/components/results/resultsController.js b/3rd_party/static/onap-ui/components/results/resultsController.js index d459495..e8187f3 100644 --- a/3rd_party/static/onap-ui/components/results/resultsController.js +++ b/3rd_party/static/onap-ui/components/results/resultsController.js @@ -257,21 +257,58 @@ "primary_business_email": ctrl.primary_business_email }; - $http.post(testapiApiUrl + "/onap/cvp/applications", data).then(function(resp) { - if (resp.data.code && resp.data.code != 0) { - alert(resp.data.msg); - return; + if (ctrl.company_name == null || + ctrl.company_website == null || + ctrl.primary_contact_name == null || + ctrl.primary_phone_number == null || + ctrl.primary_business_email== null || + ctrl.xnf_version == null || + ctrl.xnf_name == null || + ctrl.xnf_description == null || + ctrl.xnfd_id == null) { + + alert('There are empty required fields in the application form'); + + } else if (ctrl.lab_location == 'third') { + if (ctrl.lab_name == null || + ctrl.lab_email == null || + ctrl.lab_address == null || + ctrl.lab_phone == null) { + + alert('There are empty required fields in the application form'); + + } else { + $http.post(testapiApiUrl + "/onap/cvp/applications", data).then(function(resp) { + if (resp.data.code && resp.data.code != 0) { + alert(resp.data.msg); + return; + } + toggleCheck(result, 'status', 'review'); + }, function(error) { + /* do nothing */ + }); } - toggleCheck(result, 'status', 'review'); - }, function(error) { - /* do nothing */ - }); + } else { + $http.post(testapiApiUrl + "/onap/cvp/applications", data).then(function(resp) { + if (resp.data.code && resp.data.code != 0) { + alert(resp.data.msg); + return; + } + toggleCheck(result, 'status', 'review'); + }, function(error) { + /* do nothing */ + }); + } } }, function(error) { /* do nothing */ }); logo_name = file.name; } + + if (typeof file === 'undefined') { + alert('There are empty required fields in the application form'); + } ngDialog.close(); } @@ -515,6 +552,7 @@ var start = $filter('date')(ctrl.startDate, 'yyyy-MM-dd'); var end = $filter('date')(ctrl.endDate, 'yyyy-MM-dd'); + ctrl.PageName = null; content_url += '?page=' + ctrl.currentPage; content_url += '&per_page=' + ctrl.itemsPerPage; if (start) { @@ -525,6 +563,7 @@ } if (ctrl.isUserResults) { content_url += '&signed'; + ctrl.PageName = 'MyResults'; } else { content_url += '&status={"$ne":"private"}&review'; } @@ -535,6 +574,25 @@ ctrl.totalItems = ctrl.data.pagination.total_pages * ctrl.itemsPerPage; ctrl.currentPage = ctrl.data.pagination.current_page; ctrl.numPages = ctrl.data.pagination.total_pages; + if (ctrl.PageName === 'MyResults') { + for (var i=0; i<data.tests.length; i++) { + if (data.tests[i].owner !== ctrl.currentUser) { + var sharing = false; + if (data.tests[i].shared !== null){ + for (var j=0; j<data.tests[i].shared.length; j++) { + if (data.tests[i].shared[j] === ctrl.currentUser){ + sharing = true; + } + } + } + if (sharing == false){ + data.tests.splice(i,1); + i = i - 1; + } + } + } + ctrl.data = data; + } }).error(function (error) { ctrl.data = null; ctrl.totalItems = 0; diff --git a/3rd_party/static/onap-ui/robots.txt b/3rd_party/static/onap-ui/robots.txt index 93c4420..4f47368 100644 --- a/3rd_party/static/onap-ui/robots.txt +++ b/3rd_party/static/onap-ui/robots.txt @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + # robotstxt.org User-agent: * diff --git a/3rd_party/static/onap-ui/shared/alerts/alertModal.html b/3rd_party/static/onap-ui/shared/alerts/alertModal.html index 5d1a097..b42dac6 100644 --- a/3rd_party/static/onap-ui/shared/alerts/alertModal.html +++ b/3rd_party/static/onap-ui/shared/alerts/alertModal.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="modal-body" style="padding:0px"> <div class="alert alert-{{alert.data.mode}}" style="margin-bottom:0px"> <button type="button" class="close" data-ng-click="alert.close()" > diff --git a/3rd_party/static/onap-ui/shared/footer/footer.html b/3rd_party/static/onap-ui/shared/footer/footer.html index c0f1b70..f82de88 100644 --- a/3rd_party/static/onap-ui/shared/footer/footer.html +++ b/3rd_party/static/onap-ui/shared/footer/footer.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div> <span class="hide">version: web.cvp.0.7.0</span> </div> diff --git a/3rd_party/static/onap-ui/shared/header/header.html b/3rd_party/static/onap-ui/shared/header/header.html index 8e18026..9d394c8 100644 --- a/3rd_party/static/onap-ui/shared/header/header.html +++ b/3rd_party/static/onap-ui/shared/header/header.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="header-container-1"> <div class="row header-container-row"> <div class="col-md-3"> @@ -23,8 +32,7 @@ ng-if="auth.isAuthenticated && auth.canReview(auth.currentUser)"> <a ui-sref="communityResults">Incoming Reviews</a> </li> - <li ng-class="{ active: header.isActive('/user_results')}" - ng-if="auth.isAuthenticated && auth.currentUser.role.indexOf('user') != -1"> + <li ng-class="{ active: header.isActive('/user_results')}" ng-if="auth.isAuthenticated"> <a ui-sref="userResults">My Results</a> </li> <li ng-class="{ active: header.isActive('/profile')}" ng-if="auth.isAuthenticated"> diff --git a/3rd_party/static/swagger/css/highlight.default.css b/3rd_party/static/swagger/css/highlight.default.css index e417fc1..1728ad1 100644 --- a/3rd_party/static/swagger/css/highlight.default.css +++ b/3rd_party/static/swagger/css/highlight.default.css @@ -1,3 +1,12 @@ +/******************************************************************************* + * Copyright (c) 2019 opnfv. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Apache License, Version 2.0 + * which accompanies this distribution, and is available at + * http://www.apache.org/licenses/LICENSE-2.0 + *******************************************************************************/ + /* Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org> diff --git a/3rd_party/static/swagger/css/screen.css b/3rd_party/static/swagger/css/screen.css index 1f22ecb..e195335 100644 --- a/3rd_party/static/swagger/css/screen.css +++ b/3rd_party/static/swagger/css/screen.css @@ -1,3 +1,12 @@ +/******************************************************************************* + * Copyright (c) 2019 opnfv. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Apache License, Version 2.0 + * which accompanies this distribution, and is available at + * http://www.apache.org/licenses/LICENSE-2.0 + *******************************************************************************/ + /* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 */ html, body, diff --git a/3rd_party/static/swagger/endpoint.html b/3rd_party/static/swagger/endpoint.html index 8f3c43a..efaacaa 100644 --- a/3rd_party/static/swagger/endpoint.html +++ b/3rd_party/static/swagger/endpoint.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <!DOCTYPE html> <html lang="en"> <head> diff --git a/3rd_party/static/swagger/index.html b/3rd_party/static/swagger/index.html index 521a375..7e150dc 100644 --- a/3rd_party/static/swagger/index.html +++ b/3rd_party/static/swagger/index.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <!DOCTYPE html> <html> <head> diff --git a/3rd_party/static/swagger/o2c.html b/3rd_party/static/swagger/o2c.html index 2f8a6a5..c426f63 100644 --- a/3rd_party/static/swagger/o2c.html +++ b/3rd_party/static/swagger/o2c.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <script> var qp = null; if(window.location.hash) { diff --git a/3rd_party/static/swagger/swagger-ui.js b/3rd_party/static/swagger/swagger-ui.js index 4c99226..fd4ddca 100644 --- a/3rd_party/static/swagger/swagger-ui.js +++ b/3rd_party/static/swagger/swagger-ui.js @@ -1,3 +1,12 @@ +/******************************************************************************* + * Copyright (c) 2019 opnfv. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Apache License, Version 2.0 + * which accompanies this distribution, and is available at + * http://www.apache.org/licenses/LICENSE-2.0 + *******************************************************************************/ + $(function() { // Helper function for vertically aligning DOM elements diff --git a/3rd_party/static/swagger/swagger-ui.min.js b/3rd_party/static/swagger/swagger-ui.min.js index 28cb9e6..e68abc9 100644 --- a/3rd_party/static/swagger/swagger-ui.min.js +++ b/3rd_party/static/swagger/swagger-ui.min.js @@ -1 +1,10 @@ -$(function(){$.fn.vAlign=function(){return this.each(function(c){var a=$(this).height();var d=$(this).parent().height();var b=(d-a)/2;$(this).css("margin-top",b)})};$.fn.stretchFormtasticInputWidthToParent=function(){return this.each(function(b){var d=$(this).closest("form").innerWidth();var c=parseInt($(this).closest("form").css("padding-left"),10)+parseInt($(this).closest("form").css("padding-right"),10);var a=parseInt($(this).css("padding-left"),10)+parseInt($(this).css("padding-right"),10);$(this).css("width",d-c-a)})};$("form.formtastic li.string input, form.formtastic textarea").stretchFormtasticInputWidthToParent();$("ul.downplayed li div.content p").vAlign();$("form.sandbox").submit(function(){var a=true;$(this).find("input.required").each(function(){$(this).removeClass("error");if($(this).val()==""){$(this).addClass("error");$(this).wiggle();a=false}});return a})});function clippyCopiedCallback(b){$("#api_key_copied").fadeIn().delay(1000).fadeOut()}log=function(){log.history=log.history||[];log.history.push(arguments);if(this.console){console.log(Array.prototype.slice.call(arguments))}};if(Function.prototype.bind&&console&&typeof console.log=="object"){["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(a){console[a]=this.bind(console[a],console)},Function.prototype.call)}var Docs={shebang:function(){var b=$.param.fragment().split("/");b.shift();switch(b.length){case 1:log("shebang resource:"+b[0]);var d="resource_"+b[0];Docs.expandEndpointListForResource(b[0]);$("#"+d).slideto({highlight:false});break;case 2:log("shebang endpoint: "+b.join("_"));Docs.expandEndpointListForResource(b[0]);$("#"+d).slideto({highlight:false});var c=b.join("_");var a=c+"_content";log("li_dom_id "+c);log("li_content_dom_id "+a);Docs.expandOperation($("#"+a));$("#"+c).slideto({highlight:false});break}},toggleEndpointListForResource:function(b){var a=$("li#resource_"+Docs.escapeResourceName(b)+" ul.endpoints");if(a.is(":visible")){Docs.collapseEndpointListForResource(b)}else{Docs.expandEndpointListForResource(b)}},expandEndpointListForResource:function(b){var b=Docs.escapeResourceName(b);if(b==""){$(".resource ul.endpoints").slideDown();return}$("li#resource_"+b).addClass("active");var a=$("li#resource_"+b+" ul.endpoints");a.slideDown()},collapseEndpointListForResource:function(b){var b=Docs.escapeResourceName(b);$("li#resource_"+b).removeClass("active");var a=$("li#resource_"+b+" ul.endpoints");a.slideUp()},expandOperationsForResource:function(a){Docs.expandEndpointListForResource(a);if(a==""){$(".resource ul.endpoints li.operation div.content").slideDown();return}$("li#resource_"+Docs.escapeResourceName(a)+" li.operation div.content").each(function(){Docs.expandOperation($(this))})},collapseOperationsForResource:function(a){Docs.expandEndpointListForResource(a);$("li#resource_"+Docs.escapeResourceName(a)+" li.operation div.content").each(function(){Docs.collapseOperation($(this))})},escapeResourceName:function(a){return a.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g,"\\$&")},expandOperation:function(a){a.slideDown()},collapseOperation:function(a){a.slideUp()}};(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.content_type=b(function(g,l,f,k,j){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);j=j||{};var i="",c,h="function",m=this;function e(r,q){var o="",p;o+="\n ";p=f.each.call(r,r.produces,{hash:{},inverse:m.noop,fn:m.program(2,d,q),data:q});if(p||p===0){o+=p}o+="\n";return o}function d(r,q){var o="",p;o+='\n <option value="';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+='">';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+="</option>\n ";return o}function n(p,o){return'\n <option value="application/json">application/json</option>\n'}i+='<label for="contentType"></label>\n<select name="contentType">\n';c=f["if"].call(l,l.produces,{hash:{},inverse:m.program(4,n,j),fn:m.program(1,e,j),data:j});if(c||c===0){i+=c}i+="\n</select>\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.main=b(function(g,m,f,l,k){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);k=k||{};var i="",c,h="function",j=this.escapeExpression,p=this;function e(v,u){var r="",t,s;r+='\n <div class="info_title">'+j(((t=((t=v.info),t==null||t===false?t:t.title)),typeof t===h?t.apply(v):t))+'</div>\n <div class="info_description">';s=((t=((t=v.info),t==null||t===false?t:t.description)),typeof t===h?t.apply(v):t);if(s||s===0){r+=s}r+="</div>\n ";s=f["if"].call(v,((t=v.info),t==null||t===false?t:t.termsOfServiceUrl),{hash:{},inverse:p.noop,fn:p.program(2,d,u),data:u});if(s||s===0){r+=s}r+="\n ";s=f["if"].call(v,((t=v.info),t==null||t===false?t:t.contact),{hash:{},inverse:p.noop,fn:p.program(4,q,u),data:u});if(s||s===0){r+=s}r+="\n ";s=f["if"].call(v,((t=v.info),t==null||t===false?t:t.license),{hash:{},inverse:p.noop,fn:p.program(6,o,u),data:u});if(s||s===0){r+=s}r+="\n ";return r}function d(u,t){var r="",s;r+='<div class="info_tos"><a href="'+j(((s=((s=u.info),s==null||s===false?s:s.termsOfServiceUrl)),typeof s===h?s.apply(u):s))+'">Terms of service</a></div>';return r}function q(u,t){var r="",s;r+="<div class='info_contact'><a href=\"mailto:"+j(((s=((s=u.info),s==null||s===false?s:s.contact)),typeof s===h?s.apply(u):s))+'">Contact the developer</a></div>';return r}function o(u,t){var r="",s;r+="<div class='info_license'><a href='"+j(((s=((s=u.info),s==null||s===false?s:s.licenseUrl)),typeof s===h?s.apply(u):s))+"'>"+j(((s=((s=u.info),s==null||s===false?s:s.license)),typeof s===h?s.apply(u):s))+"</a></div>";return r}function n(u,t){var r="",s;r+='\n , <span style="font-variant: small-caps">api version</span>: ';if(s=f.apiVersion){s=s.call(u,{hash:{},data:t})}else{s=u.apiVersion;s=typeof s===h?s.apply(u):s}r+=j(s)+"\n ";return r}i+="<div class='info' id='api_info'>\n ";c=f["if"].call(m,m.info,{hash:{},inverse:p.noop,fn:p.program(1,e,k),data:k});if(c||c===0){i+=c}i+="\n</div>\n<div class='container' id='resources_container'>\n <ul id='resources'>\n </ul>\n\n <div class=\"footer\">\n <br>\n <br>\n <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\">base url</span>: ";if(c=f.basePath){c=c.call(m,{hash:{},data:k})}else{c=m.basePath;c=typeof c===h?c.apply(m):c}i+=j(c)+"\n ";c=f["if"].call(m,m.apiVersion,{hash:{},inverse:p.noop,fn:p.program(8,n,k),data:k});if(c||c===0){i+=c}i+="]</h4>\n </div>\n</div>\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.operation=b(function(g,s,q,m,y){this.compilerInfo=[4,">= 1.0.0"];q=this.merge(q,g.helpers);y=y||{};var r="",i,f,e="function",d=this.escapeExpression,p=this,c=q.blockHelperMissing;function o(C,B){var z="",A;z+="\n <h4>Implementation Notes</h4>\n <p>";if(A=q.notes){A=A.call(C,{hash:{},data:B})}else{A=C.notes;A=typeof A===e?A.apply(C):A}if(A||A===0){z+=A}z+="</p>\n ";return z}function n(A,z){return'\n <div class="auth">\n <span class="api-ic ic-error"></span>'}function l(C,B){var z="",A;z+='\n <div id="api_information_panel" style="top: 526px; left: 776px; display: none;">\n ';A=q.each.call(C,C,{hash:{},inverse:p.noop,fn:p.program(6,k,B),data:B});if(A||A===0){z+=A}z+="\n </div>\n ";return z}function k(D,C){var z="",B,A;z+="\n <div title='";A=((B=D.description),typeof B===e?B.apply(D):B);if(A||A===0){z+=A}z+="'>"+d(((B=D.scope),typeof B===e?B.apply(D):B))+"</div>\n ";return z}function h(A,z){return"</div>"}function x(A,z){return'\n <div class=\'access\'>\n <span class="api-ic ic-off" title="click to authenticate"></span>\n </div>\n '}function w(A,z){return'\n <h4>Response Class</h4>\n <p><span class="model-signature" /></p>\n <br/>\n <div class="response-content-type" />\n '}function v(A,z){return'\n <h4>Parameters</h4>\n <table class=\'fullwidth\'>\n <thead>\n <tr>\n <th style="width: 100px; max-width: 100px">Parameter</th>\n <th style="width: 310px; max-width: 310px">Value</th>\n <th style="width: 200px; max-width: 200px">Description</th>\n <th style="width: 100px; max-width: 100px">Parameter Type</th>\n <th style="width: 220px; max-width: 230px">Data Type</th>\n </tr>\n </thead>\n <tbody class="operation-params">\n\n </tbody>\n </table>\n '}function u(A,z){return"\n <div style='margin:0;padding:0;display:inline'></div>\n <h4>Error Status Codes</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th>HTTP Status Code</th>\n <th>Reason</th>\n </tr>\n </thead>\n <tbody class=\"operation-status\">\n \n </tbody>\n </table>\n "}function t(A,z){return"\n "}function j(A,z){return"\n <div class='sandbox_header'>\n <input class='submit' name='commit' type='button' value='Try it out!' />\n <a href='#' class='response_hider' style='display:none'>Hide Response</a>\n <img alt='Throbber' class='response_throbber' src='static/images/throbber.gif' style='display:none' />\n </div>\n "}r+="\n <ul class='operations' >\n <li class='";if(i=q.method){i=i.call(s,{hash:{},data:y})}else{i=s.method;i=typeof i===e?i.apply(s):i}r+=d(i)+" operation' id='";if(i=q.parentId){i=i.call(s,{hash:{},data:y})}else{i=s.parentId;i=typeof i===e?i.apply(s):i}r+=d(i)+"_";if(i=q.nickname){i=i.call(s,{hash:{},data:y})}else{i=s.nickname;i=typeof i===e?i.apply(s):i}r+=d(i)+"'>\n <div class='heading'>\n <h3>\n <span class='http_method'>\n <a href='#!/";if(i=q.parentId){i=i.call(s,{hash:{},data:y})}else{i=s.parentId;i=typeof i===e?i.apply(s):i}r+=d(i)+"/";if(i=q.nickname){i=i.call(s,{hash:{},data:y})}else{i=s.nickname;i=typeof i===e?i.apply(s):i}r+=d(i)+'\' class="toggleOperation">';if(i=q.method){i=i.call(s,{hash:{},data:y})}else{i=s.method;i=typeof i===e?i.apply(s):i}r+=d(i)+"</a>\n </span>\n <span class='path'>\n <a href='#!/";if(i=q.parentId){i=i.call(s,{hash:{},data:y})}else{i=s.parentId;i=typeof i===e?i.apply(s):i}r+=d(i)+"/";if(i=q.nickname){i=i.call(s,{hash:{},data:y})}else{i=s.nickname;i=typeof i===e?i.apply(s):i}r+=d(i)+'\' class="toggleOperation">';if(i=q.path){i=i.call(s,{hash:{},data:y})}else{i=s.path;i=typeof i===e?i.apply(s):i}r+=d(i)+"</a>\n </span>\n </h3>\n <ul class='options'>\n <li>\n <a href='#!/";if(i=q.parentId){i=i.call(s,{hash:{},data:y})}else{i=s.parentId;i=typeof i===e?i.apply(s):i}r+=d(i)+"/";if(i=q.nickname){i=i.call(s,{hash:{},data:y})}else{i=s.nickname;i=typeof i===e?i.apply(s):i}r+=d(i)+'\' class="toggleOperation">';if(i=q.summary){i=i.call(s,{hash:{},data:y})}else{i=s.summary;i=typeof i===e?i.apply(s):i}if(i||i===0){r+=i}r+="</a>\n </li>\n </ul>\n </div>\n <div class='content' id='";if(i=q.parentId){i=i.call(s,{hash:{},data:y})}else{i=s.parentId;i=typeof i===e?i.apply(s):i}r+=d(i)+"_";if(i=q.nickname){i=i.call(s,{hash:{},data:y})}else{i=s.nickname;i=typeof i===e?i.apply(s):i}r+=d(i)+"_content' style='display:none'>\n ";i=q["if"].call(s,s.notes,{hash:{},inverse:p.noop,fn:p.program(1,o,y),data:y});if(i||i===0){r+=i}r+="\n ";f={hash:{},inverse:p.noop,fn:p.program(3,n,y),data:y};if(i=q.oauth){i=i.call(s,f)}else{i=s.oauth;i=typeof i===e?i.apply(s):i}if(!q.oauth){i=c.call(s,i,f)}if(i||i===0){r+=i}r+="\n ";i=q.each.call(s,s.oauth,{hash:{},inverse:p.noop,fn:p.program(5,l,y),data:y});if(i||i===0){r+=i}r+="\n ";f={hash:{},inverse:p.noop,fn:p.program(8,h,y),data:y};if(i=q.oauth){i=i.call(s,f)}else{i=s.oauth;i=typeof i===e?i.apply(s):i}if(!q.oauth){i=c.call(s,i,f)}if(i||i===0){r+=i}r+="\n ";f={hash:{},inverse:p.noop,fn:p.program(10,x,y),data:y};if(i=q.oauth){i=i.call(s,f)}else{i=s.oauth;i=typeof i===e?i.apply(s):i}if(!q.oauth){i=c.call(s,i,f)}if(i||i===0){r+=i}r+="\n ";i=q["if"].call(s,s.type,{hash:{},inverse:p.noop,fn:p.program(12,w,y),data:y});if(i||i===0){r+=i}r+="\n <form accept-charset='UTF-8' class='sandbox'>\n <div style='margin:0;padding:0;display:inline'></div>\n ";i=q["if"].call(s,s.parameters,{hash:{},inverse:p.noop,fn:p.program(14,v,y),data:y});if(i||i===0){r+=i}r+="\n ";i=q["if"].call(s,s.responseMessages,{hash:{},inverse:p.noop,fn:p.program(16,u,y),data:y});if(i||i===0){r+=i}r+="\n ";i=q["if"].call(s,s.isReadOnly,{hash:{},inverse:p.program(20,j,y),fn:p.program(18,t,y),data:y});if(i||i===0){r+=i}r+="\n </form>\n <div class='response' style='display:none'>\n <h4>Request URL</h4>\n <div class='block request_url'></div>\n <h4>Response Body</h4>\n <div class='block response_body'></div>\n <h4>Response Code</h4>\n <div class='block response_code'></div>\n <h4>Response Headers</h4>\n <div class='block response_headers'></div>\n </div>\n </div>\n </li>\n </ul>\n";return r})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param=b(function(f,q,o,j,s){this.compilerInfo=[4,">= 1.0.0"];o=this.merge(o,f.helpers);s=s||{};var p="",g,d="function",c=this.escapeExpression,n=this;function m(x,w){var u="",v;u+="\n ";v=o["if"].call(x,x.isFile,{hash:{},inverse:n.program(4,k,w),fn:n.program(2,l,w),data:w});if(v||v===0){u+=v}u+="\n ";return u}function l(x,w){var u="",v;u+='\n <input type="file" name=\'';if(v=o.name){v=v.call(x,{hash:{},data:w})}else{v=x.name;v=typeof v===d?v.apply(x):v}u+=c(v)+'\'/>\n <div class="parameter-content-type" />\n ';return u}function k(x,w){var u="",v;u+="\n ";v=o["if"].call(x,x.defaultValue,{hash:{},inverse:n.program(7,h,w),fn:n.program(5,i,w),data:w});if(v||v===0){u+=v}u+="\n ";return u}function i(x,w){var u="",v;u+="\n <textarea class='body-textarea' name='";if(v=o.name){v=v.call(x,{hash:{},data:w})}else{v=x.name;v=typeof v===d?v.apply(x):v}u+=c(v)+"'>";if(v=o.defaultValue){v=v.call(x,{hash:{},data:w})}else{v=x.defaultValue;v=typeof v===d?v.apply(x):v}u+=c(v)+"</textarea>\n ";return u}function h(x,w){var u="",v;u+="\n <textarea class='body-textarea' name='";if(v=o.name){v=v.call(x,{hash:{},data:w})}else{v=x.name;v=typeof v===d?v.apply(x):v}u+=c(v)+'\'></textarea>\n <br />\n <div class="parameter-content-type" />\n ';return u}function e(x,w){var u="",v;u+="\n ";v=o["if"].call(x,x.defaultValue,{hash:{},inverse:n.program(12,r,w),fn:n.program(10,t,w),data:w});if(v||v===0){u+=v}u+="\n ";return u}function t(x,w){var u="",v;u+="\n <input class='parameter' minlength='0' name='";if(v=o.name){v=v.call(x,{hash:{},data:w})}else{v=x.name;v=typeof v===d?v.apply(x):v}u+=c(v)+"' placeholder='' type='text' value='";if(v=o.defaultValue){v=v.call(x,{hash:{},data:w})}else{v=x.defaultValue;v=typeof v===d?v.apply(x):v}u+=c(v)+"'/>\n ";return u}function r(x,w){var u="",v;u+="\n <input class='parameter' minlength='0' name='";if(v=o.name){v=v.call(x,{hash:{},data:w})}else{v=x.name;v=typeof v===d?v.apply(x):v}u+=c(v)+"' placeholder='' type='text' value=''/>\n ";return u}p+="<td class='code'>";if(g=o.name){g=g.call(q,{hash:{},data:s})}else{g=q.name;g=typeof g===d?g.apply(q):g}p+=c(g)+"</td>\n<td>\n\n ";g=o["if"].call(q,q.isBody,{hash:{},inverse:n.program(9,e,s),fn:n.program(1,m,s),data:s});if(g||g===0){p+=g}p+="\n\n</td>\n<td>";if(g=o.description){g=g.call(q,{hash:{},data:s})}else{g=q.description;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+="</td>\n<td>";if(g=o.paramType){g=g.call(q,{hash:{},data:s})}else{g=q.paramType;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+='</td>\n<td>\n <span class="model-signature"></span>\n</td>\n';return p})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_list=b(function(h,t,r,m,y){this.compilerInfo=[4,">= 1.0.0"];r=this.merge(r,h.helpers);y=y||{};var s="",j,g,e,p=this,q=r.helperMissing,d="function",c=this.escapeExpression;function o(A,z){return" multiple='multiple'"}function n(A,z){return"\n "}function l(C,B){var z="",A;z+="\n ";A=r["if"].call(C,C.defaultValue,{hash:{},inverse:p.program(8,i,B),fn:p.program(6,k,B),data:B});if(A||A===0){z+=A}z+="\n ";return z}function k(A,z){return"\n "}function i(E,D){var z="",C,B,A;z+="\n ";A={hash:{},inverse:p.program(11,x,D),fn:p.program(9,f,D),data:D};B=((C=r.isArray||E.isArray),C?C.call(E,E,A):q.call(E,"isArray",E,A));if(B||B===0){z+=B}z+="\n ";return z}function f(A,z){return"\n "}function x(A,z){return"\n <option selected=\"\" value=''></option>\n "}function w(C,B){var z="",A;z+="\n ";A=r["if"].call(C,C.isDefault,{hash:{},inverse:p.program(16,u,B),fn:p.program(14,v,B),data:B});if(A||A===0){z+=A}z+="\n ";return z}function v(C,B){var z="",A;z+='\n <option selected="" value=\'';if(A=r.value){A=A.call(C,{hash:{},data:B})}else{A=C.value;A=typeof A===d?A.apply(C):A}z+=c(A)+"'>";if(A=r.value){A=A.call(C,{hash:{},data:B})}else{A=C.value;A=typeof A===d?A.apply(C):A}z+=c(A)+" (default)</option>\n ";return z}function u(C,B){var z="",A;z+="\n <option value='";if(A=r.value){A=A.call(C,{hash:{},data:B})}else{A=C.value;A=typeof A===d?A.apply(C):A}z+=c(A)+"'>";if(A=r.value){A=A.call(C,{hash:{},data:B})}else{A=C.value;A=typeof A===d?A.apply(C):A}z+=c(A)+"</option>\n ";return z}s+="<td class='code'>";if(j=r.name){j=j.call(t,{hash:{},data:y})}else{j=t.name;j=typeof j===d?j.apply(t):j}s+=c(j)+"</td>\n<td>\n <select ";e={hash:{},inverse:p.noop,fn:p.program(1,o,y),data:y};g=((j=r.isArray||t.isArray),j?j.call(t,t,e):q.call(t,"isArray",t,e));if(g||g===0){s+=g}s+=" class='parameter' name='";if(g=r.name){g=g.call(t,{hash:{},data:y})}else{g=t.name;g=typeof g===d?g.apply(t):g}s+=c(g)+"'>\n ";g=r["if"].call(t,t.required,{hash:{},inverse:p.program(5,l,y),fn:p.program(3,n,y),data:y});if(g||g===0){s+=g}s+="\n ";g=r.each.call(t,((j=t.allowableValues),j==null||j===false?j:j.descriptiveValues),{hash:{},inverse:p.noop,fn:p.program(13,w,y),data:y});if(g||g===0){s+=g}s+="\n </select>\n</td>\n<td>";if(g=r.description){g=g.call(t,{hash:{},data:y})}else{g=t.description;g=typeof g===d?g.apply(t):g}if(g||g===0){s+=g}s+="</td>\n<td>";if(g=r.paramType){g=g.call(t,{hash:{},data:y})}else{g=t.paramType;g=typeof g===d?g.apply(t):g}if(g||g===0){s+=g}s+='</td>\n<td><span class="model-signature"></span></td>';return s})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_readonly=b(function(g,m,f,l,k){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);k=k||{};var i="",d,h="function",j=this.escapeExpression,o=this;function e(t,s){var q="",r;q+="\n <textarea class='body-textarea' readonly='readonly' name='";if(r=f.name){r=r.call(t,{hash:{},data:s})}else{r=t.name;r=typeof r===h?r.apply(t):r}q+=j(r)+"'>";if(r=f.defaultValue){r=r.call(t,{hash:{},data:s})}else{r=t.defaultValue;r=typeof r===h?r.apply(t):r}q+=j(r)+"</textarea>\n ";return q}function c(t,s){var q="",r;q+="\n ";r=f["if"].call(t,t.defaultValue,{hash:{},inverse:o.program(6,n,s),fn:o.program(4,p,s),data:s});if(r||r===0){q+=r}q+="\n ";return q}function p(t,s){var q="",r;q+="\n ";if(r=f.defaultValue){r=r.call(t,{hash:{},data:s})}else{r=t.defaultValue;r=typeof r===h?r.apply(t):r}q+=j(r)+"\n ";return q}function n(r,q){return"\n (empty)\n "}i+="<td class='code'>";if(d=f.name){d=d.call(m,{hash:{},data:k})}else{d=m.name;d=typeof d===h?d.apply(m):d}i+=j(d)+"</td>\n<td>\n ";d=f["if"].call(m,m.isBody,{hash:{},inverse:o.program(3,c,k),fn:o.program(1,e,k),data:k});if(d||d===0){i+=d}i+="\n</td>\n<td>";if(d=f.description){d=d.call(m,{hash:{},data:k})}else{d=m.description;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+="</td>\n<td>";if(d=f.paramType){d=d.call(m,{hash:{},data:k})}else{d=m.paramType;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+='</td>\n<td><span class="model-signature"></span></td>\n';return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_readonly_required=b(function(g,m,f,l,k){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);k=k||{};var i="",d,h="function",j=this.escapeExpression,o=this;function e(t,s){var q="",r;q+="\n <textarea class='body-textarea' readonly='readonly' placeholder='(required)' name='";if(r=f.name){r=r.call(t,{hash:{},data:s})}else{r=t.name;r=typeof r===h?r.apply(t):r}q+=j(r)+"'>";if(r=f.defaultValue){r=r.call(t,{hash:{},data:s})}else{r=t.defaultValue;r=typeof r===h?r.apply(t):r}q+=j(r)+"</textarea>\n ";return q}function c(t,s){var q="",r;q+="\n ";r=f["if"].call(t,t.defaultValue,{hash:{},inverse:o.program(6,n,s),fn:o.program(4,p,s),data:s});if(r||r===0){q+=r}q+="\n ";return q}function p(t,s){var q="",r;q+="\n ";if(r=f.defaultValue){r=r.call(t,{hash:{},data:s})}else{r=t.defaultValue;r=typeof r===h?r.apply(t):r}q+=j(r)+"\n ";return q}function n(r,q){return"\n (empty)\n "}i+="<td class='code required'>";if(d=f.name){d=d.call(m,{hash:{},data:k})}else{d=m.name;d=typeof d===h?d.apply(m):d}i+=j(d)+"</td>\n<td>\n ";d=f["if"].call(m,m.isBody,{hash:{},inverse:o.program(3,c,k),fn:o.program(1,e,k),data:k});if(d||d===0){i+=d}i+="\n</td>\n<td>";if(d=f.description){d=d.call(m,{hash:{},data:k})}else{d=m.description;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+="</td>\n<td>";if(d=f.paramType){d=d.call(m,{hash:{},data:k})}else{d=m.paramType;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+='</td>\n<td><span class="model-signature"></span></td>\n';return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_required=b(function(f,q,o,j,u){this.compilerInfo=[4,">= 1.0.0"];o=this.merge(o,f.helpers);u=u||{};var p="",g,d="function",c=this.escapeExpression,n=this;function m(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.isFile,{hash:{},inverse:n.program(4,k,y),fn:n.program(2,l,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function l(z,y){var w="",x;w+='\n <input type="file" name=\'';if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"'/>\n ";return w}function k(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.defaultValue,{hash:{},inverse:n.program(7,h,y),fn:n.program(5,i,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function i(z,y){var w="",x;w+="\n <textarea class='body-textarea' placeholder='(required)' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"'>";if(x=o.defaultValue){x=x.call(z,{hash:{},data:y})}else{x=z.defaultValue;x=typeof x===d?x.apply(z):x}w+=c(x)+"</textarea>\n ";return w}function h(z,y){var w="",x;w+="\n <textarea class='body-textarea' placeholder='(required)' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+'\'></textarea>\n <br />\n <div class="parameter-content-type" />\n ';return w}function e(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.isFile,{hash:{},inverse:n.program(12,t,y),fn:n.program(10,v,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function v(z,y){var w="",x;w+="\n <input class='parameter' class='required' type='file' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"'/>\n ";return w}function t(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.defaultValue,{hash:{},inverse:n.program(15,r,y),fn:n.program(13,s,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function s(z,y){var w="",x;w+="\n <input class='parameter required' minlength='1' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"' placeholder='(required)' type='text' value='";if(x=o.defaultValue){x=x.call(z,{hash:{},data:y})}else{x=z.defaultValue;x=typeof x===d?x.apply(z):x}w+=c(x)+"'/>\n ";return w}function r(z,y){var w="",x;w+="\n <input class='parameter required' minlength='1' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"' placeholder='(required)' type='text' value=''/>\n ";return w}p+="<td class='code required'>";if(g=o.name){g=g.call(q,{hash:{},data:u})}else{g=q.name;g=typeof g===d?g.apply(q):g}p+=c(g)+"</td>\n<td>\n ";g=o["if"].call(q,q.isBody,{hash:{},inverse:n.program(9,e,u),fn:n.program(1,m,u),data:u});if(g||g===0){p+=g}p+="\n</td>\n<td>\n <strong>";if(g=o.description){g=g.call(q,{hash:{},data:u})}else{g=q.description;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+="</strong>\n</td>\n<td>";if(g=o.paramType){g=g.call(q,{hash:{},data:u})}else{g=q.paramType;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+='</td>\n<td><span class="model-signature"></span></td>\n';return p})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.parameter_content_type=b(function(g,l,f,k,j){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);j=j||{};var i="",c,h="function",m=this;function e(r,q){var o="",p;o+="\n ";p=f.each.call(r,r.consumes,{hash:{},inverse:m.noop,fn:m.program(2,d,q),data:q});if(p||p===0){o+=p}o+="\n";return o}function d(r,q){var o="",p;o+='\n <option value="';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+='">';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+="</option>\n ";return o}function n(p,o){return'\n <option value="application/json">application/json</option>\n'}i+='<label for="parameterContentType"></label>\n<select name="parameterContentType">\n';c=f["if"].call(l,l.consumes,{hash:{},inverse:m.program(4,n,j),fn:m.program(1,e,j),data:j});if(c||c===0){i+=c}i+="\n</select>\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.resource=b(function(f,l,e,k,j){this.compilerInfo=[4,">= 1.0.0"];e=this.merge(e,f.helpers);j=j||{};var h="",c,o,g="function",i=this.escapeExpression,n=this,m=e.blockHelperMissing;function d(q,p){return" : "}h+="<div class='heading'>\n <h2>\n <a href='#!/";if(c=e.id){c=c.call(l,{hash:{},data:j})}else{c=l.id;c=typeof c===g?c.apply(l):c}h+=i(c)+"' onclick=\"Docs.toggleEndpointListForResource('";if(c=e.id){c=c.call(l,{hash:{},data:j})}else{c=l.id;c=typeof c===g?c.apply(l):c}h+=i(c)+"');\">";if(c=e.name){c=c.call(l,{hash:{},data:j})}else{c=l.name;c=typeof c===g?c.apply(l):c}h+=i(c)+"</a> ";o={hash:{},inverse:n.noop,fn:n.program(1,d,j),data:j};if(c=e.description){c=c.call(l,o)}else{c=l.description;c=typeof c===g?c.apply(l):c}if(!e.description){c=m.call(l,c,o)}if(c||c===0){h+=c}if(c=e.description){c=c.call(l,{hash:{},data:j})}else{c=l.description;c=typeof c===g?c.apply(l):c}if(c||c===0){h+=c}h+="\n </h2>\n <ul class='options'>\n <li>\n <a href='#!/";if(c=e.id){c=c.call(l,{hash:{},data:j})}else{c=l.id;c=typeof c===g?c.apply(l):c}h+=i(c)+"' id='endpointListTogger_";if(c=e.id){c=c.call(l,{hash:{},data:j})}else{c=l.id;c=typeof c===g?c.apply(l):c}h+=i(c)+"'\n onclick=\"Docs.toggleEndpointListForResource('";if(c=e.id){c=c.call(l,{hash:{},data:j})}else{c=l.id;c=typeof c===g?c.apply(l):c}h+=i(c)+"');\">Show/Hide</a>\n </li>\n <li>\n <a href='#' onclick=\"Docs.collapseOperationsForResource('";if(c=e.id){c=c.call(l,{hash:{},data:j})}else{c=l.id;c=typeof c===g?c.apply(l):c}h+=i(c)+"'); return false;\">\n List Operations\n </a>\n </li>\n <li>\n <a href='#' onclick=\"Docs.expandOperationsForResource('";if(c=e.id){c=c.call(l,{hash:{},data:j})}else{c=l.id;c=typeof c===g?c.apply(l):c}h+=i(c)+"'); return false;\">\n Expand Operations\n </a>\n </li>\n <li>\n <a href='";if(c=e.url){c=c.call(l,{hash:{},data:j})}else{c=l.url;c=typeof c===g?c.apply(l):c}h+=i(c)+"'>Raw</a>\n </li>\n </ul>\n</div>\n<ul class='endpoints' id='";if(c=e.id){c=c.call(l,{hash:{},data:j})}else{c=l.id;c=typeof c===g?c.apply(l):c}h+=i(c)+"_endpoint_list' style='display:none'>\n\n</ul>\n";return h})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.response_content_type=b(function(g,l,f,k,j){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);j=j||{};var i="",c,h="function",m=this;function e(r,q){var o="",p;o+="\n ";p=f.each.call(r,r.produces,{hash:{},inverse:m.noop,fn:m.program(2,d,q),data:q});if(p||p===0){o+=p}o+="\n";return o}function d(r,q){var o="",p;o+='\n <option value="';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+='">';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+="</option>\n ";return o}function n(p,o){return'\n <option value="application/json">application/json</option>\n'}i+='<label for="responseContentType"></label>\n<select name="responseContentType">\n';c=f["if"].call(l,l.produces,{hash:{},inverse:m.program(4,n,j),fn:m.program(1,e,j),data:j});if(c||c===0){i+=c}i+="\n</select>\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.signature=b(function(e,k,d,j,i){this.compilerInfo=[4,">= 1.0.0"];d=this.merge(d,e.helpers);i=i||{};var g="",c,f="function",h=this.escapeExpression;g+='<div>\n<ul class="signature-nav">\n <li><a class="description-link" href="#">Model</a></li>\n <li><a class="snippet-link" href="#">Model Schema</a></li>\n</ul>\n<div>\n\n<div class="signature-container">\n <div class="description">\n ';if(c=d.signature){c=c.call(k,{hash:{},data:i})}else{c=k.signature;c=typeof c===f?c.apply(k):c}if(c||c===0){g+=c}g+='\n </div>\n\n <div class="snippet">\n <pre><code>';if(c=d.sampleJSON){c=c.call(k,{hash:{},data:i})}else{c=k.sampleJSON;c=typeof c===f?c.apply(k):c}g+=h(c)+'</code></pre>\n <small class="notice"></small>\n </div>\n</div>\n\n';return g})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.status_code=b(function(e,k,d,j,i){this.compilerInfo=[4,">= 1.0.0"];d=this.merge(d,e.helpers);i=i||{};var g="",c,f="function",h=this.escapeExpression;g+="<td width='15%' class='code'>";if(c=d.code){c=c.call(k,{hash:{},data:i})}else{c=k.code;c=typeof c===f?c.apply(k):c}g+=h(c)+"</td>\n<td>";if(c=d.message){c=c.call(k,{hash:{},data:i})}else{c=k.message;c=typeof c===f?c.apply(k):c}if(c||c===0){g+=c}g+="</td>\n";return g})})();(function(){var j,r,u,o,l,k,n,m,i,p,s,q,h,c,g,f,e,d,b,a,x,w,t={}.hasOwnProperty,v=function(B,z){for(var y in z){if(t.call(z,y)){B[y]=z[y]}}function A(){this.constructor=B}A.prototype=z.prototype;B.prototype=new A();B.__super__=z.prototype;return B};s=(function(z){v(y,z);function y(){q=y.__super__.constructor.apply(this,arguments);return q}y.prototype.dom_id="swagger_ui";y.prototype.options=null;y.prototype.api=null;y.prototype.headerView=null;y.prototype.mainView=null;y.prototype.initialize=function(A){var B=this;if(A==null){A={}}if(A.dom_id!=null){this.dom_id=A.dom_id;delete A.dom_id}if($("#"+this.dom_id)==null){$("body").append('<div id="'+this.dom_id+'"></div>')}this.options=A;this.options.success=function(){return B.render()};this.options.progress=function(C){return B.showMessage(C)};this.options.failure=function(C){return B.onLoadFailure(C)};this.headerView=new r({el:$("#header")});return this.headerView.on("update-swagger-ui",function(C){return B.updateSwaggerUi(C)})};y.prototype.updateSwaggerUi=function(A){this.options.url=A.url;return this.load()};y.prototype.load=function(){var B,A;if((A=this.mainView)!=null){A.clear()}B=this.options.url;if(B.indexOf("http")!==0){B=this.buildUrl(window.location.href.toString(),B)}this.options.url=B;this.headerView.update(B);this.api=new SwaggerApi(this.options);this.api.build();return this.api};y.prototype.render=function(){var A=this;this.showMessage("Finished Loading Resource Information. Rendering Swagger UI...");this.mainView=new u({model:this.api,el:$("#"+this.dom_id)}).render();this.showMessage();switch(this.options.docExpansion){case"full":Docs.expandOperationsForResource("");break;case"list":Docs.collapseOperationsForResource("")}if(this.options.onComplete){this.options.onComplete(this.api,this)}return setTimeout(function(){return Docs.shebang()},400)};y.prototype.buildUrl=function(C,A){var B,D;log("base is "+C);if(A.indexOf("/")===0){D=C.split("/");C=D[0]+"//"+D[2];return C+A}else{B=C.length;if(C.indexOf("?")>-1){B=Math.min(B,C.indexOf("?"))}if(C.indexOf("#")>-1){B=Math.min(B,C.indexOf("#"))}C=C.substring(0,B);if(C.indexOf("/",C.length-1)!==-1){return C+A}return C+"/"+A}};y.prototype.showMessage=function(A){if(A==null){A=""}$("#message-bar").removeClass("message-fail");$("#message-bar").addClass("message-success");return $("#message-bar").html(A)};y.prototype.onLoadFailure=function(A){var B;if(A==null){A=""}$("#message-bar").removeClass("message-success");$("#message-bar").addClass("message-fail");B=$("#message-bar").html(A);if(this.options.onFailure!=null){this.options.onFailure(A)}return B};return y})(Backbone.Router);window.SwaggerUi=s;r=(function(z){v(y,z);function y(){h=y.__super__.constructor.apply(this,arguments);return h}y.prototype.events={"click #show-pet-store-icon":"showPetStore","click #show-wordnik-dev-icon":"showWordnikDev","click #explore":"showCustom","keyup #input_baseUrl":"showCustomOnKeyup","keyup #input_apiKey":"showCustomOnKeyup"};y.prototype.initialize=function(){};y.prototype.showPetStore=function(A){return this.trigger("update-swagger-ui",{url:"http://petstore.swagger.wordnik.com/api/api-docs"})};y.prototype.showWordnikDev=function(A){return this.trigger("update-swagger-ui",{url:"http://api.wordnik.com/v4/resources.json"})};y.prototype.showCustomOnKeyup=function(A){if(A.keyCode===13){return this.showCustom()}};y.prototype.showCustom=function(A){if(A!=null){A.preventDefault()}return this.trigger("update-swagger-ui",{url:$("#input_baseUrl").val(),apiKey:$("#input_apiKey").val()})};y.prototype.update=function(B,C,A){if(A==null){A=false}$("#input_baseUrl").val(B);if(A){return this.trigger("update-swagger-ui",{url:B})}};return y})(Backbone.View);u=(function(y){v(z,y);function z(){g=z.__super__.constructor.apply(this,arguments);return g}z.prototype.initialize=function(){};z.prototype.render=function(){var B,G,D,E,C,A,F;$(this.el).html(Handlebars.templates.main(this.model));E={};B=0;F=this.model.apisArray;for(C=0,A=F.length;C<A;C++){D=F[C];G=D.name;while(typeof E[G]!=="undefined"){G=G+"_"+B;B+=1}D.id=G;E[G]=D;this.addResource(D)}return this};z.prototype.addResource=function(B){var A;A=new n({model:B,tagName:"li",id:"resource_"+B.id,className:"resource"});return $("#resources").append(A.render().el)};z.prototype.clear=function(){return $(this.el).html("")};return z})(Backbone.View);n=(function(z){v(y,z);function y(){f=y.__super__.constructor.apply(this,arguments);return f}y.prototype.initialize=function(){};y.prototype.render=function(){var B,G,D,C,E,A,F;$(this.el).html(Handlebars.templates.resource(this.model));D={};F=this.model.operationsArray;for(E=0,A=F.length;E<A;E++){C=F[E];B=0;G=C.nickname;while(typeof D[G]!=="undefined"){G=G+"_"+B;B+=1}D[G]=C;C.nickname=G;C.parentId=this.model.id;this.addOperation(C)}return this};y.prototype.addOperation=function(A){var B;A.number=this.number;B=new o({model:A,tagName:"li",className:"endpoint"});$(".endpoints",$(this.el)).append(B.render().el);return this.number++};return y})(Backbone.View);o=(function(z){v(y,z);function y(){e=y.__super__.constructor.apply(this,arguments);return e}y.prototype.invocationUrl=null;y.prototype.events={"submit .sandbox":"submitOperation","click .submit":"submitOperation","click .response_hider":"hideResponse","click .toggleOperation":"toggleOperationContent","mouseenter .api-ic":"mouseEnter","mouseout .api-ic":"mouseExit"};y.prototype.initialize=function(){};y.prototype.mouseEnter=function(F){var D,E,I,B,A,J,G,C,K,H;D=$(F.currentTarget.parentNode).find("#api_information_panel");K=event.pageX;H=event.pageY;J=$(window).scrollLeft();G=$(window).scrollTop();B=J+$(window).width();A=G+$(window).height();C=D.width();E=D.height();if(K+C>B){K=B-C}if(K<J){K=J}if(H+E>A){H=A-E}if(H<G){H=G}I={};I.top=H;I.left=K;D.css(I);return $(F.currentTarget.parentNode).find("#api_information_panel").show()};y.prototype.mouseExit=function(A){return $(A.currentTarget.parentNode).find("#api_information_panel").hide()};y.prototype.render=function(){var Q,R,P,O,I,N,J,M,K,H,L,G,F,E,C,T,V,U,S,D,B,A,W;R=true;if(!R){this.model.isReadOnly=true}this.model.oauth=null;if(this.model.authorizations){D=this.model.authorizations;for(P in D){L=D[P];if(P==="oauth2"){if(this.model.oauth===null){this.model.oauth={}}if(this.model.oauth.scopes===void 0){this.model.oauth.scopes=[]}for(G=0,T=L.length;G<T;G++){O=L[G];this.model.oauth.scopes.push(O)}}}}$(this.el).html(Handlebars.templates.operation(this.model));if(this.model.responseClassSignature&&this.model.responseClassSignature!=="string"){M={sampleJSON:this.model.responseSampleJSON,isParam:false,signature:this.model.responseClassSignature};J=new i({model:M,tagName:"div"});$(".model-signature",$(this.el)).append(J.render().el)}else{$(".model-signature",$(this.el)).html(this.model.type)}Q={isParam:false};Q.consumes=this.model.consumes;Q.produces=this.model.produces;B=this.model.parameters;for(F=0,V=B.length;F<V;F++){I=B[F];H=I.type||I.dataType;if(H.toLowerCase()==="file"){if(!Q.consumes){log("set content type ");Q.consumes="multipart/form-data"}}}N=new m({model:Q});$(".response-content-type",$(this.el)).append(N.render().el);A=this.model.parameters;for(E=0,U=A.length;E<U;E++){I=A[E];this.addParameter(I,Q.consumes)}W=this.model.responseMessages;for(C=0,S=W.length;C<S;C++){K=W[C];this.addStatusCode(K)}return this};y.prototype.addParameter=function(C,A){var B;C.consumes=A;B=new k({model:C,tagName:"tr",readOnly:this.model.isReadOnly});return $(".operation-params",$(this.el)).append(B.render().el)};y.prototype.addStatusCode=function(B){var A;A=new p({model:B,tagName:"tr"});return $(".operation-status",$(this.el)).append(A.render().el)};y.prototype.submitOperation=function(O){var Q,G,N,D,I,A,J,M,L,K,P,F,C,H,E,B;if(O!=null){O.preventDefault()}G=$(".sandbox",$(this.el));Q=true;G.find("input.required").each(function(){var R=this;$(this).removeClass("error");if(jQuery.trim($(this).val())===""){$(this).addClass("error");$(this).wiggle({callback:function(){return $(R).focus()}});return Q=false}});if(Q){D={};A={parent:this};N=false;H=G.find("input");for(M=0,P=H.length;M<P;M++){I=H[M];if((I.value!=null)&&jQuery.trim(I.value).length>0){D[I.name]=I.value}if(I.type==="file"){N=true}}E=G.find("textarea");for(L=0,F=E.length;L<F;L++){I=E[L];if((I.value!=null)&&jQuery.trim(I.value).length>0){D.body=I.value}}B=G.find("select");for(K=0,C=B.length;K<C;K++){I=B[K];J=this.getSelectedValue(I);if((J!=null)&&jQuery.trim(J).length>0){D[I.name]=J}}A.responseContentType=$("div select[name=responseContentType]",$(this.el)).val();A.requestContentType=$("div select[name=parameterContentType]",$(this.el)).val();$(".response_throbber",$(this.el)).show();if(N){return this.handleFileUpload(D,G)}else{return this.model["do"](D,A,this.showCompleteStatus,this.showErrorStatus,this)}}};y.prototype.success=function(A,B){return B.showCompleteStatus(A)};y.prototype.handleFileUpload=function(Q,I){var M,H,C,N,L,K,J,G,E,D,P,T,S,R,F,B,A,U,O=this;log("it's a file upload");F=I.serializeArray();for(J=0,P=F.length;J<P;J++){N=F[J];if((N.value!=null)&&jQuery.trim(N.value).length>0){Q[N.name]=N.value}}M=new FormData();B=this.model.parameters;for(G=0,T=B.length;G<T;G++){K=B[G];if(K.paramType==="form"){if(Q[K.name]!==void 0){M.append(K.name,Q[K.name])}}}C={};A=this.model.parameters;for(E=0,S=A.length;E<S;E++){K=A[E];if(K.paramType==="header"){C[K.name]=Q[K.name]}}log(C);U=I.find('input[type~="file"]');for(D=0,R=U.length;D<R;D++){H=U[D];M.append($(H).attr("name"),H.files[0])}log(M);this.invocationUrl=this.model.supportHeaderParams()?(C=this.model.getHeaderParams(Q),this.model.urlify(Q,false)):this.model.urlify(Q,true);$(".request_url",$(this.el)).html("<pre>"+this.invocationUrl+"</pre>");L={type:this.model.method,url:this.invocationUrl,headers:C,data:M,dataType:"json",contentType:false,processData:false,error:function(W,X,V){return O.showErrorStatus(O.wrap(W),O)},success:function(V){return O.showResponse(V,O)},complete:function(V){return O.showCompleteStatus(O.wrap(V),O)}};if(window.authorizations){window.authorizations.apply(L)}jQuery.ajax(L);return false};y.prototype.wrap=function(E){var C,F,H,B,G,D,A;H={};F=E.getAllResponseHeaders().split("\r");for(D=0,A=F.length;D<A;D++){B=F[D];C=B.split(":");if(C[0]!==void 0&&C[1]!==void 0){H[C[0].trim()]=C[1].trim()}}G={};G.content={};G.content.data=E.responseText;G.headers=H;G.request={};G.request.url=this.invocationUrl;G.status=E.status;return G};y.prototype.getSelectedValue=function(A){var D,C,F,B,E;if(!A.multiple){return A.value}else{C=[];E=A.options;for(F=0,B=E.length;F<B;F++){D=E[F];if(D.selected){C.push(D.value)}}if(C.length>0){return C.join(",")}else{return null}}};y.prototype.hideResponse=function(A){if(A!=null){A.preventDefault()}$(".response",$(this.el)).slideUp();return $(".response_hider",$(this.el)).fadeOut()};y.prototype.showResponse=function(A){var B;B=JSON.stringify(A,null,"\t").replace(/\n/g,"<br>");return $(".response_body",$(this.el)).html(escape(B))};y.prototype.showErrorStatus=function(B,A){return A.showStatus(B)};y.prototype.showCompleteStatus=function(B,A){return A.showStatus(B)};y.prototype.formatXml=function(H){var D,G,B,I,N,J,C,A,L,M,F,E,K;A=/(>)(<)(\/*)/g;M=/[ ]*(.*)[ ]+\n/g;D=/(<.+>)(.+\n)/g;H=H.replace(A,"$1\n$2$3").replace(M,"$1\n").replace(D,"$1\n$2");C=0;G="";N=H.split("\n");B=0;I="other";L={"single->single":0,"single->closing":-1,"single->opening":0,"single->other":0,"closing->single":0,"closing->closing":-1,"closing->opening":0,"closing->other":0,"opening->single":1,"opening->closing":0,"opening->opening":1,"opening->other":1,"other->single":0,"other->closing":-1,"other->opening":0,"other->other":0};F=function(T){var P,O,R,V,S,Q,U;Q={single:Boolean(T.match(/<.+\/>/)),closing:Boolean(T.match(/<\/.+>/)),opening:Boolean(T.match(/<[^!?].*>/))};S=((function(){var W;W=[];for(R in Q){U=Q[R];if(U){W.push(R)}}return W})())[0];S=S===void 0?"other":S;P=I+"->"+S;I=S;V="";B+=L[P];V=((function(){var X,Y,W;W=[];for(O=X=0,Y=B;0<=Y?X<Y:X>Y;O=0<=Y?++X:--X){W.push(" ")}return W})()).join("");if(P==="opening->closing"){return G=G.substr(0,G.length-1)+T+"\n"}else{return G+=V+T+"\n"}};for(E=0,K=N.length;E<K;E++){J=N[E];F(J)}return G};y.prototype.showStatus=function(A){var E,D,H,G,F,C,B;if(A.content===void 0){D=A.data;B=A.url}else{D=A.content.data;B=A.request.url}G=A.headers;H=G&&G["Content-Type"]?G["Content-Type"].split(";")[0].trim():null;if(!D){E=$("<code />").text("no content");F=$('<pre class="json" />').append(E)}else{if(H==="application/json"||/\+json$/.test(H)){E=$("<code />").text(JSON.stringify(JSON.parse(D),null," "));F=$('<pre class="json" />').append(E)}else{if(H==="application/xml"||/\+xml$/.test(H)){E=$("<code />").text(this.formatXml(D));F=$('<pre class="xml" />').append(E)}else{if(H==="text/html"){E=$("<code />").html(D);F=$('<pre class="xml" />').append(E)}else{if(/^image\//.test(H)){F=$("<img>").attr("src",B)}else{E=$("<code />").text(D);F=$('<pre class="json" />').append(E)}}}}}C=F;$(".request_url",$(this.el)).html("<pre>"+B+"</pre>");$(".response_code",$(this.el)).html("<pre>"+A.status+"</pre>");$(".response_body",$(this.el)).html(C);$(".response_headers",$(this.el)).html("<pre>"+JSON.stringify(A.headers,null," ").replace(/\n/g,"<br>")+"</pre>");$(".response",$(this.el)).slideDown();$(".response_hider",$(this.el)).show();$(".response_throbber",$(this.el)).hide();return hljs.highlightBlock($(".response_body",$(this.el))[0])};y.prototype.toggleOperationContent=function(){var A;A=$("#"+Docs.escapeResourceName(this.model.parentId)+"_"+this.model.nickname+"_content");if(A.is(":visible")){return Docs.collapseOperation(A)}else{return Docs.expandOperation(A)}};return y})(Backbone.View);p=(function(z){v(y,z);function y(){d=y.__super__.constructor.apply(this,arguments);return d}y.prototype.initialize=function(){};y.prototype.render=function(){var A;A=this.template();$(this.el).html(A(this.model));return this};y.prototype.template=function(){return Handlebars.templates.status_code};return y})(Backbone.View);k=(function(z){v(y,z);function y(){b=y.__super__.constructor.apply(this,arguments);return b}y.prototype.initialize=function(){return Handlebars.registerHelper("isArray",function(B,A){if(B.type.toLowerCase()==="array"||B.allowMultiple){return A.fn(this)}else{return A.inverse(this)}})};y.prototype.render=function(){var G,A,C,F,B,H,E,D;D=this.model.type||this.model.dataType;if(this.model.paramType==="body"){this.model.isBody=true}if(D.toLowerCase()==="file"){this.model.isFile=true}E=this.template();$(this.el).html(E(this.model));B={sampleJSON:this.model.sampleJSON,isParam:true,signature:this.model.signature};if(this.model.sampleJSON){H=new i({model:B,tagName:"div"});$(".model-signature",$(this.el)).append(H.render().el)}else{$(".model-signature",$(this.el)).html(this.model.signature)}A=false;if(this.model.isBody){A=true}G={isParam:A};G.consumes=this.model.consumes;if(A){C=new l({model:G});$(".parameter-content-type",$(this.el)).append(C.render().el)}else{F=new m({model:G});$(".response-content-type",$(this.el)).append(F.render().el)}return this};y.prototype.template=function(){if(this.model.isList){return Handlebars.templates.param_list}else{if(this.options.readOnly){if(this.model.required){return Handlebars.templates.param_readonly_required}else{return Handlebars.templates.param_readonly}}else{if(this.model.required){return Handlebars.templates.param_required}else{return Handlebars.templates.param}}}};return y})(Backbone.View);i=(function(z){v(y,z);function y(){a=y.__super__.constructor.apply(this,arguments);return a}y.prototype.events={"click a.description-link":"switchToDescription","click a.snippet-link":"switchToSnippet","mousedown .snippet":"snippetToTextArea"};y.prototype.initialize=function(){};y.prototype.render=function(){var A;A=this.template();$(this.el).html(A(this.model));this.switchToDescription();this.isParam=this.model.isParam;if(this.isParam){$(".notice",$(this.el)).text("Click to set as parameter value")}return this};y.prototype.template=function(){return Handlebars.templates.signature};y.prototype.switchToDescription=function(A){if(A!=null){A.preventDefault()}$(".snippet",$(this.el)).hide();$(".description",$(this.el)).show();$(".description-link",$(this.el)).addClass("selected");return $(".snippet-link",$(this.el)).removeClass("selected")};y.prototype.switchToSnippet=function(A){if(A!=null){A.preventDefault()}$(".description",$(this.el)).hide();$(".snippet",$(this.el)).show();$(".snippet-link",$(this.el)).addClass("selected");return $(".description-link",$(this.el)).removeClass("selected")};y.prototype.snippetToTextArea=function(A){var B;if(this.isParam){if(A!=null){A.preventDefault()}B=$("textarea",$(this.el.parentNode.parentNode.parentNode));if($.trim(B.val())===""){return B.val(this.model.sampleJSON)}}};return y})(Backbone.View);j=(function(y){v(z,y);function z(){x=z.__super__.constructor.apply(this,arguments);return x}z.prototype.initialize=function(){};z.prototype.render=function(){var A;A=this.template();$(this.el).html(A(this.model));$("label[for=contentType]",$(this.el)).text("Response Content Type");return this};z.prototype.template=function(){return Handlebars.templates.content_type};return z})(Backbone.View);m=(function(y){v(z,y);function z(){w=z.__super__.constructor.apply(this,arguments);return w}z.prototype.initialize=function(){};z.prototype.render=function(){var A;A=this.template();$(this.el).html(A(this.model));$("label[for=responseContentType]",$(this.el)).text("Response Content Type");return this};z.prototype.template=function(){return Handlebars.templates.response_content_type};return z})(Backbone.View);l=(function(z){v(y,z);function y(){c=y.__super__.constructor.apply(this,arguments);return c}y.prototype.initialize=function(){};y.prototype.render=function(){var A;A=this.template();$(this.el).html(A(this.model));$("label[for=parameterContentType]",$(this.el)).text("Parameter content type:");return this};y.prototype.template=function(){return Handlebars.templates.parameter_content_type};return y})(Backbone.View)}).call(this);
\ No newline at end of file +/******************************************************************************* + * Copyright (c) 2019 opnfv. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Apache License, Version 2.0 + * which accompanies this distribution, and is available at + * http://www.apache.org/licenses/LICENSE-2.0 + *******************************************************************************/ + +$(function(){$.fn.vAlign=function(){return this.each(function(c){var a=$(this).height();var d=$(this).parent().height();var b=(d-a)/2;$(this).css("margin-top",b)})};$.fn.stretchFormtasticInputWidthToParent=function(){return this.each(function(b){var d=$(this).closest("form").innerWidth();var c=parseInt($(this).closest("form").css("padding-left"),10)+parseInt($(this).closest("form").css("padding-right"),10);var a=parseInt($(this).css("padding-left"),10)+parseInt($(this).css("padding-right"),10);$(this).css("width",d-c-a)})};$("form.formtastic li.string input, form.formtastic textarea").stretchFormtasticInputWidthToParent();$("ul.downplayed li div.content p").vAlign();$("form.sandbox").submit(function(){var a=true;$(this).find("input.required").each(function(){$(this).removeClass("error");if($(this).val()==""){$(this).addClass("error");$(this).wiggle();a=false}});return a})});function clippyCopiedCallback(b){$("#api_key_copied").fadeIn().delay(1000).fadeOut()}log=function(){log.history=log.history||[];log.history.push(arguments);if(this.console){console.log(Array.prototype.slice.call(arguments))}};if(Function.prototype.bind&&console&&typeof console.log=="object"){["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(a){console[a]=this.bind(console[a],console)},Function.prototype.call)}var Docs={shebang:function(){var b=$.param.fragment().split("/");b.shift();switch(b.length){case 1:log("shebang resource:"+b[0]);var d="resource_"+b[0];Docs.expandEndpointListForResource(b[0]);$("#"+d).slideto({highlight:false});break;case 2:log("shebang endpoint: "+b.join("_"));Docs.expandEndpointListForResource(b[0]);$("#"+d).slideto({highlight:false});var c=b.join("_");var a=c+"_content";log("li_dom_id "+c);log("li_content_dom_id "+a);Docs.expandOperation($("#"+a));$("#"+c).slideto({highlight:false});break}},toggleEndpointListForResource:function(b){var a=$("li#resource_"+Docs.escapeResourceName(b)+" ul.endpoints");if(a.is(":visible")){Docs.collapseEndpointListForResource(b)}else{Docs.expandEndpointListForResource(b)}},expandEndpointListForResource:function(b){var b=Docs.escapeResourceName(b);if(b==""){$(".resource ul.endpoints").slideDown();return}$("li#resource_"+b).addClass("active");var a=$("li#resource_"+b+" ul.endpoints");a.slideDown()},collapseEndpointListForResource:function(b){var b=Docs.escapeResourceName(b);$("li#resource_"+b).removeClass("active");var a=$("li#resource_"+b+" ul.endpoints");a.slideUp()},expandOperationsForResource:function(a){Docs.expandEndpointListForResource(a);if(a==""){$(".resource ul.endpoints li.operation div.content").slideDown();return}$("li#resource_"+Docs.escapeResourceName(a)+" li.operation div.content").each(function(){Docs.expandOperation($(this))})},collapseOperationsForResource:function(a){Docs.expandEndpointListForResource(a);$("li#resource_"+Docs.escapeResourceName(a)+" li.operation div.content").each(function(){Docs.collapseOperation($(this))})},escapeResourceName:function(a){return a.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g,"\\$&")},expandOperation:function(a){a.slideDown()},collapseOperation:function(a){a.slideUp()}};(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.content_type=b(function(g,l,f,k,j){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);j=j||{};var i="",c,h="function",m=this;function e(r,q){var o="",p;o+="\n ";p=f.each.call(r,r.produces,{hash:{},inverse:m.noop,fn:m.program(2,d,q),data:q});if(p||p===0){o+=p}o+="\n";return o}function d(r,q){var o="",p;o+='\n <option value="';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+='">';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+="</option>\n ";return o}function n(p,o){return'\n <option value="application/json">application/json</option>\n'}i+='<label for="contentType"></label>\n<select name="contentType">\n';c=f["if"].call(l,l.produces,{hash:{},inverse:m.program(4,n,j),fn:m.program(1,e,j),data:j});if(c||c===0){i+=c}i+="\n</select>\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.main=b(function(g,m,f,l,k){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);k=k||{};var i="",c,h="function",j=this.escapeExpression,p=this;function e(v,u){var r="",t,s;r+='\n <div class="info_title">'+j(((t=((t=v.info),t==null||t===false?t:t.title)),typeof t===h?t.apply(v):t))+'</div>\n <div class="info_description">';s=((t=((t=v.info),t==null||t===false?t:t.description)),typeof t===h?t.apply(v):t);if(s||s===0){r+=s}r+="</div>\n ";s=f["if"].call(v,((t=v.info),t==null||t===false?t:t.termsOfServiceUrl),{hash:{},inverse:p.noop,fn:p.program(2,d,u),data:u});if(s||s===0){r+=s}r+="\n ";s=f["if"].call(v,((t=v.info),t==null||t===false?t:t.contact),{hash:{},inverse:p.noop,fn:p.program(4,q,u),data:u});if(s||s===0){r+=s}r+="\n ";s=f["if"].call(v,((t=v.info),t==null||t===false?t:t.license),{hash:{},inverse:p.noop,fn:p.program(6,o,u),data:u});if(s||s===0){r+=s}r+="\n ";return r}function d(u,t){var r="",s;r+='<div class="info_tos"><a href="'+j(((s=((s=u.info),s==null||s===false?s:s.termsOfServiceUrl)),typeof s===h?s.apply(u):s))+'">Terms of service</a></div>';return r}function q(u,t){var r="",s;r+="<div class='info_contact'><a href=\"mailto:"+j(((s=((s=u.info),s==null||s===false?s:s.contact)),typeof s===h?s.apply(u):s))+'">Contact the developer</a></div>';return r}function o(u,t){var r="",s;r+="<div class='info_license'><a href='"+j(((s=((s=u.info),s==null||s===false?s:s.licenseUrl)),typeof s===h?s.apply(u):s))+"'>"+j(((s=((s=u.info),s==null||s===false?s:s.license)),typeof s===h?s.apply(u):s))+"</a></div>";return r}function n(u,t){var r="",s;r+='\n , <span style="font-variant: small-caps">api version</span>: ';if(s=f.apiVersion){s=s.call(u,{hash:{},data:t})}else{s=u.apiVersion;s=typeof s===h?s.apply(u):s}r+=j(s)+"\n ";return r}i+="<div class='info' id='api_info'>\n ";c=f["if"].call(m,m.info,{hash:{},inverse:p.noop,fn:p.program(1,e,k),data:k});if(c||c===0){i+=c}i+="\n</div>\n<div class='container' id='resources_container'>\n <ul id='resources'>\n </ul>\n\n <div class=\"footer\">\n <br>\n <br>\n <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\">base url</span>: ";if(c=f.basePath){c=c.call(m,{hash:{},data:k})}else{c=m.basePath;c=typeof c===h?c.apply(m):c}i+=j(c)+"\n ";c=f["if"].call(m,m.apiVersion,{hash:{},inverse:p.noop,fn:p.program(8,n,k),data:k});if(c||c===0){i+=c}i+="]</h4>\n </div>\n</div>\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.operation=b(function(g,s,q,m,y){this.compilerInfo=[4,">= 1.0.0"];q=this.merge(q,g.helpers);y=y||{};var r="",i,f,e="function",d=this.escapeExpression,p=this,c=q.blockHelperMissing;function o(C,B){var z="",A;z+="\n <h4>Implementation Notes</h4>\n <p>";if(A=q.notes){A=A.call(C,{hash:{},data:B})}else{A=C.notes;A=typeof A===e?A.apply(C):A}if(A||A===0){z+=A}z+="</p>\n ";return z}function n(A,z){return'\n <div class="auth">\n <span class="api-ic ic-error"></span>'}function l(C,B){var z="",A;z+='\n <div id="api_information_panel" style="top: 526px; left: 776px; display: none;">\n ';A=q.each.call(C,C,{hash:{},inverse:p.noop,fn:p.program(6,k,B),data:B});if(A||A===0){z+=A}z+="\n </div>\n ";return z}function k(D,C){var z="",B,A;z+="\n <div title='";A=((B=D.description),typeof B===e?B.apply(D):B);if(A||A===0){z+=A}z+="'>"+d(((B=D.scope),typeof B===e?B.apply(D):B))+"</div>\n ";return z}function h(A,z){return"</div>"}function x(A,z){return'\n <div class=\'access\'>\n <span class="api-ic ic-off" title="click to authenticate"></span>\n </div>\n '}function w(A,z){return'\n <h4>Response Class</h4>\n <p><span class="model-signature" /></p>\n <br/>\n <div class="response-content-type" />\n '}function v(A,z){return'\n <h4>Parameters</h4>\n <table class=\'fullwidth\'>\n <thead>\n <tr>\n <th style="width: 100px; max-width: 100px">Parameter</th>\n <th style="width: 310px; max-width: 310px">Value</th>\n <th style="width: 200px; max-width: 200px">Description</th>\n <th style="width: 100px; max-width: 100px">Parameter Type</th>\n <th style="width: 220px; max-width: 230px">Data Type</th>\n </tr>\n </thead>\n <tbody class="operation-params">\n\n </tbody>\n </table>\n '}function u(A,z){return"\n <div style='margin:0;padding:0;display:inline'></div>\n <h4>Error Status Codes</h4>\n <table class='fullwidth'>\n <thead>\n <tr>\n <th>HTTP Status Code</th>\n <th>Reason</th>\n </tr>\n </thead>\n <tbody class=\"operation-status\">\n \n </tbody>\n </table>\n "}function t(A,z){return"\n "}function j(A,z){return"\n <div class='sandbox_header'>\n <input class='submit' name='commit' type='button' value='Try it out!' />\n <a href='#' class='response_hider' style='display:none'>Hide Response</a>\n <img alt='Throbber' class='response_throbber' src='static/images/throbber.gif' style='display:none' />\n </div>\n "}r+="\n <ul class='operations' >\n <li class='";if(i=q.method){i=i.call(s,{hash:{},data:y})}else{i=s.method;i=typeof i===e?i.apply(s):i}r+=d(i)+" operation' id='";if(i=q.parentId){i=i.call(s,{hash:{},data:y})}else{i=s.parentId;i=typeof i===e?i.apply(s):i}r+=d(i)+"_";if(i=q.nickname){i=i.call(s,{hash:{},data:y})}else{i=s.nickname;i=typeof i===e?i.apply(s):i}r+=d(i)+"'>\n <div class='heading'>\n <h3>\n <span class='http_method'>\n <a href='#!/";if(i=q.parentId){i=i.call(s,{hash:{},data:y})}else{i=s.parentId;i=typeof i===e?i.apply(s):i}r+=d(i)+"/";if(i=q.nickname){i=i.call(s,{hash:{},data:y})}else{i=s.nickname;i=typeof i===e?i.apply(s):i}r+=d(i)+'\' class="toggleOperation">';if(i=q.method){i=i.call(s,{hash:{},data:y})}else{i=s.method;i=typeof i===e?i.apply(s):i}r+=d(i)+"</a>\n </span>\n <span class='path'>\n <a href='#!/";if(i=q.parentId){i=i.call(s,{hash:{},data:y})}else{i=s.parentId;i=typeof i===e?i.apply(s):i}r+=d(i)+"/";if(i=q.nickname){i=i.call(s,{hash:{},data:y})}else{i=s.nickname;i=typeof i===e?i.apply(s):i}r+=d(i)+'\' class="toggleOperation">';if(i=q.path){i=i.call(s,{hash:{},data:y})}else{i=s.path;i=typeof i===e?i.apply(s):i}r+=d(i)+"</a>\n </span>\n </h3>\n <ul class='options'>\n <li>\n <a href='#!/";if(i=q.parentId){i=i.call(s,{hash:{},data:y})}else{i=s.parentId;i=typeof i===e?i.apply(s):i}r+=d(i)+"/";if(i=q.nickname){i=i.call(s,{hash:{},data:y})}else{i=s.nickname;i=typeof i===e?i.apply(s):i}r+=d(i)+'\' class="toggleOperation">';if(i=q.summary){i=i.call(s,{hash:{},data:y})}else{i=s.summary;i=typeof i===e?i.apply(s):i}if(i||i===0){r+=i}r+="</a>\n </li>\n </ul>\n </div>\n <div class='content' id='";if(i=q.parentId){i=i.call(s,{hash:{},data:y})}else{i=s.parentId;i=typeof i===e?i.apply(s):i}r+=d(i)+"_";if(i=q.nickname){i=i.call(s,{hash:{},data:y})}else{i=s.nickname;i=typeof i===e?i.apply(s):i}r+=d(i)+"_content' style='display:none'>\n ";i=q["if"].call(s,s.notes,{hash:{},inverse:p.noop,fn:p.program(1,o,y),data:y});if(i||i===0){r+=i}r+="\n ";f={hash:{},inverse:p.noop,fn:p.program(3,n,y),data:y};if(i=q.oauth){i=i.call(s,f)}else{i=s.oauth;i=typeof i===e?i.apply(s):i}if(!q.oauth){i=c.call(s,i,f)}if(i||i===0){r+=i}r+="\n ";i=q.each.call(s,s.oauth,{hash:{},inverse:p.noop,fn:p.program(5,l,y),data:y});if(i||i===0){r+=i}r+="\n ";f={hash:{},inverse:p.noop,fn:p.program(8,h,y),data:y};if(i=q.oauth){i=i.call(s,f)}else{i=s.oauth;i=typeof i===e?i.apply(s):i}if(!q.oauth){i=c.call(s,i,f)}if(i||i===0){r+=i}r+="\n ";f={hash:{},inverse:p.noop,fn:p.program(10,x,y),data:y};if(i=q.oauth){i=i.call(s,f)}else{i=s.oauth;i=typeof i===e?i.apply(s):i}if(!q.oauth){i=c.call(s,i,f)}if(i||i===0){r+=i}r+="\n ";i=q["if"].call(s,s.type,{hash:{},inverse:p.noop,fn:p.program(12,w,y),data:y});if(i||i===0){r+=i}r+="\n <form accept-charset='UTF-8' class='sandbox'>\n <div style='margin:0;padding:0;display:inline'></div>\n ";i=q["if"].call(s,s.parameters,{hash:{},inverse:p.noop,fn:p.program(14,v,y),data:y});if(i||i===0){r+=i}r+="\n ";i=q["if"].call(s,s.responseMessages,{hash:{},inverse:p.noop,fn:p.program(16,u,y),data:y});if(i||i===0){r+=i}r+="\n ";i=q["if"].call(s,s.isReadOnly,{hash:{},inverse:p.program(20,j,y),fn:p.program(18,t,y),data:y});if(i||i===0){r+=i}r+="\n </form>\n <div class='response' style='display:none'>\n <h4>Request URL</h4>\n <div class='block request_url'></div>\n <h4>Response Body</h4>\n <div class='block response_body'></div>\n <h4>Response Code</h4>\n <div class='block response_code'></div>\n <h4>Response Headers</h4>\n <div class='block response_headers'></div>\n </div>\n </div>\n </li>\n </ul>\n";return r})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param=b(function(f,q,o,j,s){this.compilerInfo=[4,">= 1.0.0"];o=this.merge(o,f.helpers);s=s||{};var p="",g,d="function",c=this.escapeExpression,n=this;function m(x,w){var u="",v;u+="\n ";v=o["if"].call(x,x.isFile,{hash:{},inverse:n.program(4,k,w),fn:n.program(2,l,w),data:w});if(v||v===0){u+=v}u+="\n ";return u}function l(x,w){var u="",v;u+='\n <input type="file" name=\'';if(v=o.name){v=v.call(x,{hash:{},data:w})}else{v=x.name;v=typeof v===d?v.apply(x):v}u+=c(v)+'\'/>\n <div class="parameter-content-type" />\n ';return u}function k(x,w){var u="",v;u+="\n ";v=o["if"].call(x,x.defaultValue,{hash:{},inverse:n.program(7,h,w),fn:n.program(5,i,w),data:w});if(v||v===0){u+=v}u+="\n ";return u}function i(x,w){var u="",v;u+="\n <textarea class='body-textarea' name='";if(v=o.name){v=v.call(x,{hash:{},data:w})}else{v=x.name;v=typeof v===d?v.apply(x):v}u+=c(v)+"'>";if(v=o.defaultValue){v=v.call(x,{hash:{},data:w})}else{v=x.defaultValue;v=typeof v===d?v.apply(x):v}u+=c(v)+"</textarea>\n ";return u}function h(x,w){var u="",v;u+="\n <textarea class='body-textarea' name='";if(v=o.name){v=v.call(x,{hash:{},data:w})}else{v=x.name;v=typeof v===d?v.apply(x):v}u+=c(v)+'\'></textarea>\n <br />\n <div class="parameter-content-type" />\n ';return u}function e(x,w){var u="",v;u+="\n ";v=o["if"].call(x,x.defaultValue,{hash:{},inverse:n.program(12,r,w),fn:n.program(10,t,w),data:w});if(v||v===0){u+=v}u+="\n ";return u}function t(x,w){var u="",v;u+="\n <input class='parameter' minlength='0' name='";if(v=o.name){v=v.call(x,{hash:{},data:w})}else{v=x.name;v=typeof v===d?v.apply(x):v}u+=c(v)+"' placeholder='' type='text' value='";if(v=o.defaultValue){v=v.call(x,{hash:{},data:w})}else{v=x.defaultValue;v=typeof v===d?v.apply(x):v}u+=c(v)+"'/>\n ";return u}function r(x,w){var u="",v;u+="\n <input class='parameter' minlength='0' name='";if(v=o.name){v=v.call(x,{hash:{},data:w})}else{v=x.name;v=typeof v===d?v.apply(x):v}u+=c(v)+"' placeholder='' type='text' value=''/>\n ";return u}p+="<td class='code'>";if(g=o.name){g=g.call(q,{hash:{},data:s})}else{g=q.name;g=typeof g===d?g.apply(q):g}p+=c(g)+"</td>\n<td>\n\n ";g=o["if"].call(q,q.isBody,{hash:{},inverse:n.program(9,e,s),fn:n.program(1,m,s),data:s});if(g||g===0){p+=g}p+="\n\n</td>\n<td>";if(g=o.description){g=g.call(q,{hash:{},data:s})}else{g=q.description;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+="</td>\n<td>";if(g=o.paramType){g=g.call(q,{hash:{},data:s})}else{g=q.paramType;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+='</td>\n<td>\n <span class="model-signature"></span>\n</td>\n';return p})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_list=b(function(h,t,r,m,y){this.compilerInfo=[4,">= 1.0.0"];r=this.merge(r,h.helpers);y=y||{};var s="",j,g,e,p=this,q=r.helperMissing,d="function",c=this.escapeExpression;function o(A,z){return" multiple='multiple'"}function n(A,z){return"\n "}function l(C,B){var z="",A;z+="\n ";A=r["if"].call(C,C.defaultValue,{hash:{},inverse:p.program(8,i,B),fn:p.program(6,k,B),data:B});if(A||A===0){z+=A}z+="\n ";return z}function k(A,z){return"\n "}function i(E,D){var z="",C,B,A;z+="\n ";A={hash:{},inverse:p.program(11,x,D),fn:p.program(9,f,D),data:D};B=((C=r.isArray||E.isArray),C?C.call(E,E,A):q.call(E,"isArray",E,A));if(B||B===0){z+=B}z+="\n ";return z}function f(A,z){return"\n "}function x(A,z){return"\n <option selected=\"\" value=''></option>\n "}function w(C,B){var z="",A;z+="\n ";A=r["if"].call(C,C.isDefault,{hash:{},inverse:p.program(16,u,B),fn:p.program(14,v,B),data:B});if(A||A===0){z+=A}z+="\n ";return z}function v(C,B){var z="",A;z+='\n <option selected="" value=\'';if(A=r.value){A=A.call(C,{hash:{},data:B})}else{A=C.value;A=typeof A===d?A.apply(C):A}z+=c(A)+"'>";if(A=r.value){A=A.call(C,{hash:{},data:B})}else{A=C.value;A=typeof A===d?A.apply(C):A}z+=c(A)+" (default)</option>\n ";return z}function u(C,B){var z="",A;z+="\n <option value='";if(A=r.value){A=A.call(C,{hash:{},data:B})}else{A=C.value;A=typeof A===d?A.apply(C):A}z+=c(A)+"'>";if(A=r.value){A=A.call(C,{hash:{},data:B})}else{A=C.value;A=typeof A===d?A.apply(C):A}z+=c(A)+"</option>\n ";return z}s+="<td class='code'>";if(j=r.name){j=j.call(t,{hash:{},data:y})}else{j=t.name;j=typeof j===d?j.apply(t):j}s+=c(j)+"</td>\n<td>\n <select ";e={hash:{},inverse:p.noop,fn:p.program(1,o,y),data:y};g=((j=r.isArray||t.isArray),j?j.call(t,t,e):q.call(t,"isArray",t,e));if(g||g===0){s+=g}s+=" class='parameter' name='";if(g=r.name){g=g.call(t,{hash:{},data:y})}else{g=t.name;g=typeof g===d?g.apply(t):g}s+=c(g)+"'>\n ";g=r["if"].call(t,t.required,{hash:{},inverse:p.program(5,l,y),fn:p.program(3,n,y),data:y});if(g||g===0){s+=g}s+="\n ";g=r.each.call(t,((j=t.allowableValues),j==null||j===false?j:j.descriptiveValues),{hash:{},inverse:p.noop,fn:p.program(13,w,y),data:y});if(g||g===0){s+=g}s+="\n </select>\n</td>\n<td>";if(g=r.description){g=g.call(t,{hash:{},data:y})}else{g=t.description;g=typeof g===d?g.apply(t):g}if(g||g===0){s+=g}s+="</td>\n<td>";if(g=r.paramType){g=g.call(t,{hash:{},data:y})}else{g=t.paramType;g=typeof g===d?g.apply(t):g}if(g||g===0){s+=g}s+='</td>\n<td><span class="model-signature"></span></td>';return s})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_readonly=b(function(g,m,f,l,k){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);k=k||{};var i="",d,h="function",j=this.escapeExpression,o=this;function e(t,s){var q="",r;q+="\n <textarea class='body-textarea' readonly='readonly' name='";if(r=f.name){r=r.call(t,{hash:{},data:s})}else{r=t.name;r=typeof r===h?r.apply(t):r}q+=j(r)+"'>";if(r=f.defaultValue){r=r.call(t,{hash:{},data:s})}else{r=t.defaultValue;r=typeof r===h?r.apply(t):r}q+=j(r)+"</textarea>\n ";return q}function c(t,s){var q="",r;q+="\n ";r=f["if"].call(t,t.defaultValue,{hash:{},inverse:o.program(6,n,s),fn:o.program(4,p,s),data:s});if(r||r===0){q+=r}q+="\n ";return q}function p(t,s){var q="",r;q+="\n ";if(r=f.defaultValue){r=r.call(t,{hash:{},data:s})}else{r=t.defaultValue;r=typeof r===h?r.apply(t):r}q+=j(r)+"\n ";return q}function n(r,q){return"\n (empty)\n "}i+="<td class='code'>";if(d=f.name){d=d.call(m,{hash:{},data:k})}else{d=m.name;d=typeof d===h?d.apply(m):d}i+=j(d)+"</td>\n<td>\n ";d=f["if"].call(m,m.isBody,{hash:{},inverse:o.program(3,c,k),fn:o.program(1,e,k),data:k});if(d||d===0){i+=d}i+="\n</td>\n<td>";if(d=f.description){d=d.call(m,{hash:{},data:k})}else{d=m.description;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+="</td>\n<td>";if(d=f.paramType){d=d.call(m,{hash:{},data:k})}else{d=m.paramType;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+='</td>\n<td><span class="model-signature"></span></td>\n';return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_readonly_required=b(function(g,m,f,l,k){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);k=k||{};var i="",d,h="function",j=this.escapeExpression,o=this;function e(t,s){var q="",r;q+="\n <textarea class='body-textarea' readonly='readonly' placeholder='(required)' name='";if(r=f.name){r=r.call(t,{hash:{},data:s})}else{r=t.name;r=typeof r===h?r.apply(t):r}q+=j(r)+"'>";if(r=f.defaultValue){r=r.call(t,{hash:{},data:s})}else{r=t.defaultValue;r=typeof r===h?r.apply(t):r}q+=j(r)+"</textarea>\n ";return q}function c(t,s){var q="",r;q+="\n ";r=f["if"].call(t,t.defaultValue,{hash:{},inverse:o.program(6,n,s),fn:o.program(4,p,s),data:s});if(r||r===0){q+=r}q+="\n ";return q}function p(t,s){var q="",r;q+="\n ";if(r=f.defaultValue){r=r.call(t,{hash:{},data:s})}else{r=t.defaultValue;r=typeof r===h?r.apply(t):r}q+=j(r)+"\n ";return q}function n(r,q){return"\n (empty)\n "}i+="<td class='code required'>";if(d=f.name){d=d.call(m,{hash:{},data:k})}else{d=m.name;d=typeof d===h?d.apply(m):d}i+=j(d)+"</td>\n<td>\n ";d=f["if"].call(m,m.isBody,{hash:{},inverse:o.program(3,c,k),fn:o.program(1,e,k),data:k});if(d||d===0){i+=d}i+="\n</td>\n<td>";if(d=f.description){d=d.call(m,{hash:{},data:k})}else{d=m.description;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+="</td>\n<td>";if(d=f.paramType){d=d.call(m,{hash:{},data:k})}else{d=m.paramType;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+='</td>\n<td><span class="model-signature"></span></td>\n';return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_required=b(function(f,q,o,j,u){this.compilerInfo=[4,">= 1.0.0"];o=this.merge(o,f.helpers);u=u||{};var p="",g,d="function",c=this.escapeExpression,n=this;function m(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.isFile,{hash:{},inverse:n.program(4,k,y),fn:n.program(2,l,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function l(z,y){var w="",x;w+='\n <input type="file" name=\'';if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"'/>\n ";return w}function k(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.defaultValue,{hash:{},inverse:n.program(7,h,y),fn:n.program(5,i,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function i(z,y){var w="",x;w+="\n <textarea class='body-textarea' placeholder='(required)' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"'>";if(x=o.defaultValue){x=x.call(z,{hash:{},data:y})}else{x=z.defaultValue;x=typeof x===d?x.apply(z):x}w+=c(x)+"</textarea>\n ";return w}function h(z,y){var w="",x;w+="\n <textarea class='body-textarea' placeholder='(required)' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+'\'></textarea>\n <br />\n <div class="parameter-content-type" />\n ';return w}function e(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.isFile,{hash:{},inverse:n.program(12,t,y),fn:n.program(10,v,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function v(z,y){var w="",x;w+="\n <input class='parameter' class='required' type='file' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"'/>\n ";return w}function t(z,y){var w="",x;w+="\n ";x=o["if"].call(z,z.defaultValue,{hash:{},inverse:n.program(15,r,y),fn:n.program(13,s,y),data:y});if(x||x===0){w+=x}w+="\n ";return w}function s(z,y){var w="",x;w+="\n <input class='parameter required' minlength='1' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"' placeholder='(required)' type='text' value='";if(x=o.defaultValue){x=x.call(z,{hash:{},data:y})}else{x=z.defaultValue;x=typeof x===d?x.apply(z):x}w+=c(x)+"'/>\n ";return w}function r(z,y){var w="",x;w+="\n <input class='parameter required' minlength='1' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"' placeholder='(required)' type='text' value=''/>\n ";return w}p+="<td class='code required'>";if(g=o.name){g=g.call(q,{hash:{},data:u})}else{g=q.name;g=typeof g===d?g.apply(q):g}p+=c(g)+"</td>\n<td>\n ";g=o["if"].call(q,q.isBody,{hash:{},inverse:n.program(9,e,u),fn:n.program(1,m,u),data:u});if(g||g===0){p+=g}p+="\n</td>\n<td>\n <strong>";if(g=o.description){g=g.call(q,{hash:{},data:u})}else{g=q.description;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+="</strong>\n</td>\n<td>";if(g=o.paramType){g=g.call(q,{hash:{},data:u})}else{g=q.paramType;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+='</td>\n<td><span class="model-signature"></span></td>\n';return p})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.parameter_content_type=b(function(g,l,f,k,j){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);j=j||{};var i="",c,h="function",m=this;function e(r,q){var o="",p;o+="\n ";p=f.each.call(r,r.consumes,{hash:{},inverse:m.noop,fn:m.program(2,d,q),data:q});if(p||p===0){o+=p}o+="\n";return o}function d(r,q){var o="",p;o+='\n <option value="';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+='">';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+="</option>\n ";return o}function n(p,o){return'\n <option value="application/json">application/json</option>\n'}i+='<label for="parameterContentType"></label>\n<select name="parameterContentType">\n';c=f["if"].call(l,l.consumes,{hash:{},inverse:m.program(4,n,j),fn:m.program(1,e,j),data:j});if(c||c===0){i+=c}i+="\n</select>\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.resource=b(function(f,l,e,k,j){this.compilerInfo=[4,">= 1.0.0"];e=this.merge(e,f.helpers);j=j||{};var h="",c,o,g="function",i=this.escapeExpression,n=this,m=e.blockHelperMissing;function d(q,p){return" : "}h+="<div class='heading'>\n <h2>\n <a href='#!/";if(c=e.id){c=c.call(l,{hash:{},data:j})}else{c=l.id;c=typeof c===g?c.apply(l):c}h+=i(c)+"' onclick=\"Docs.toggleEndpointListForResource('";if(c=e.id){c=c.call(l,{hash:{},data:j})}else{c=l.id;c=typeof c===g?c.apply(l):c}h+=i(c)+"');\">";if(c=e.name){c=c.call(l,{hash:{},data:j})}else{c=l.name;c=typeof c===g?c.apply(l):c}h+=i(c)+"</a> ";o={hash:{},inverse:n.noop,fn:n.program(1,d,j),data:j};if(c=e.description){c=c.call(l,o)}else{c=l.description;c=typeof c===g?c.apply(l):c}if(!e.description){c=m.call(l,c,o)}if(c||c===0){h+=c}if(c=e.description){c=c.call(l,{hash:{},data:j})}else{c=l.description;c=typeof c===g?c.apply(l):c}if(c||c===0){h+=c}h+="\n </h2>\n <ul class='options'>\n <li>\n <a href='#!/";if(c=e.id){c=c.call(l,{hash:{},data:j})}else{c=l.id;c=typeof c===g?c.apply(l):c}h+=i(c)+"' id='endpointListTogger_";if(c=e.id){c=c.call(l,{hash:{},data:j})}else{c=l.id;c=typeof c===g?c.apply(l):c}h+=i(c)+"'\n onclick=\"Docs.toggleEndpointListForResource('";if(c=e.id){c=c.call(l,{hash:{},data:j})}else{c=l.id;c=typeof c===g?c.apply(l):c}h+=i(c)+"');\">Show/Hide</a>\n </li>\n <li>\n <a href='#' onclick=\"Docs.collapseOperationsForResource('";if(c=e.id){c=c.call(l,{hash:{},data:j})}else{c=l.id;c=typeof c===g?c.apply(l):c}h+=i(c)+"'); return false;\">\n List Operations\n </a>\n </li>\n <li>\n <a href='#' onclick=\"Docs.expandOperationsForResource('";if(c=e.id){c=c.call(l,{hash:{},data:j})}else{c=l.id;c=typeof c===g?c.apply(l):c}h+=i(c)+"'); return false;\">\n Expand Operations\n </a>\n </li>\n <li>\n <a href='";if(c=e.url){c=c.call(l,{hash:{},data:j})}else{c=l.url;c=typeof c===g?c.apply(l):c}h+=i(c)+"'>Raw</a>\n </li>\n </ul>\n</div>\n<ul class='endpoints' id='";if(c=e.id){c=c.call(l,{hash:{},data:j})}else{c=l.id;c=typeof c===g?c.apply(l):c}h+=i(c)+"_endpoint_list' style='display:none'>\n\n</ul>\n";return h})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.response_content_type=b(function(g,l,f,k,j){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);j=j||{};var i="",c,h="function",m=this;function e(r,q){var o="",p;o+="\n ";p=f.each.call(r,r.produces,{hash:{},inverse:m.noop,fn:m.program(2,d,q),data:q});if(p||p===0){o+=p}o+="\n";return o}function d(r,q){var o="",p;o+='\n <option value="';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+='">';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+="</option>\n ";return o}function n(p,o){return'\n <option value="application/json">application/json</option>\n'}i+='<label for="responseContentType"></label>\n<select name="responseContentType">\n';c=f["if"].call(l,l.produces,{hash:{},inverse:m.program(4,n,j),fn:m.program(1,e,j),data:j});if(c||c===0){i+=c}i+="\n</select>\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.signature=b(function(e,k,d,j,i){this.compilerInfo=[4,">= 1.0.0"];d=this.merge(d,e.helpers);i=i||{};var g="",c,f="function",h=this.escapeExpression;g+='<div>\n<ul class="signature-nav">\n <li><a class="description-link" href="#">Model</a></li>\n <li><a class="snippet-link" href="#">Model Schema</a></li>\n</ul>\n<div>\n\n<div class="signature-container">\n <div class="description">\n ';if(c=d.signature){c=c.call(k,{hash:{},data:i})}else{c=k.signature;c=typeof c===f?c.apply(k):c}if(c||c===0){g+=c}g+='\n </div>\n\n <div class="snippet">\n <pre><code>';if(c=d.sampleJSON){c=c.call(k,{hash:{},data:i})}else{c=k.sampleJSON;c=typeof c===f?c.apply(k):c}g+=h(c)+'</code></pre>\n <small class="notice"></small>\n </div>\n</div>\n\n';return g})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.status_code=b(function(e,k,d,j,i){this.compilerInfo=[4,">= 1.0.0"];d=this.merge(d,e.helpers);i=i||{};var g="",c,f="function",h=this.escapeExpression;g+="<td width='15%' class='code'>";if(c=d.code){c=c.call(k,{hash:{},data:i})}else{c=k.code;c=typeof c===f?c.apply(k):c}g+=h(c)+"</td>\n<td>";if(c=d.message){c=c.call(k,{hash:{},data:i})}else{c=k.message;c=typeof c===f?c.apply(k):c}if(c||c===0){g+=c}g+="</td>\n";return g})})();(function(){var j,r,u,o,l,k,n,m,i,p,s,q,h,c,g,f,e,d,b,a,x,w,t={}.hasOwnProperty,v=function(B,z){for(var y in z){if(t.call(z,y)){B[y]=z[y]}}function A(){this.constructor=B}A.prototype=z.prototype;B.prototype=new A();B.__super__=z.prototype;return B};s=(function(z){v(y,z);function y(){q=y.__super__.constructor.apply(this,arguments);return q}y.prototype.dom_id="swagger_ui";y.prototype.options=null;y.prototype.api=null;y.prototype.headerView=null;y.prototype.mainView=null;y.prototype.initialize=function(A){var B=this;if(A==null){A={}}if(A.dom_id!=null){this.dom_id=A.dom_id;delete A.dom_id}if($("#"+this.dom_id)==null){$("body").append('<div id="'+this.dom_id+'"></div>')}this.options=A;this.options.success=function(){return B.render()};this.options.progress=function(C){return B.showMessage(C)};this.options.failure=function(C){return B.onLoadFailure(C)};this.headerView=new r({el:$("#header")});return this.headerView.on("update-swagger-ui",function(C){return B.updateSwaggerUi(C)})};y.prototype.updateSwaggerUi=function(A){this.options.url=A.url;return this.load()};y.prototype.load=function(){var B,A;if((A=this.mainView)!=null){A.clear()}B=this.options.url;if(B.indexOf("http")!==0){B=this.buildUrl(window.location.href.toString(),B)}this.options.url=B;this.headerView.update(B);this.api=new SwaggerApi(this.options);this.api.build();return this.api};y.prototype.render=function(){var A=this;this.showMessage("Finished Loading Resource Information. Rendering Swagger UI...");this.mainView=new u({model:this.api,el:$("#"+this.dom_id)}).render();this.showMessage();switch(this.options.docExpansion){case"full":Docs.expandOperationsForResource("");break;case"list":Docs.collapseOperationsForResource("")}if(this.options.onComplete){this.options.onComplete(this.api,this)}return setTimeout(function(){return Docs.shebang()},400)};y.prototype.buildUrl=function(C,A){var B,D;log("base is "+C);if(A.indexOf("/")===0){D=C.split("/");C=D[0]+"//"+D[2];return C+A}else{B=C.length;if(C.indexOf("?")>-1){B=Math.min(B,C.indexOf("?"))}if(C.indexOf("#")>-1){B=Math.min(B,C.indexOf("#"))}C=C.substring(0,B);if(C.indexOf("/",C.length-1)!==-1){return C+A}return C+"/"+A}};y.prototype.showMessage=function(A){if(A==null){A=""}$("#message-bar").removeClass("message-fail");$("#message-bar").addClass("message-success");return $("#message-bar").html(A)};y.prototype.onLoadFailure=function(A){var B;if(A==null){A=""}$("#message-bar").removeClass("message-success");$("#message-bar").addClass("message-fail");B=$("#message-bar").html(A);if(this.options.onFailure!=null){this.options.onFailure(A)}return B};return y})(Backbone.Router);window.SwaggerUi=s;r=(function(z){v(y,z);function y(){h=y.__super__.constructor.apply(this,arguments);return h}y.prototype.events={"click #show-pet-store-icon":"showPetStore","click #show-wordnik-dev-icon":"showWordnikDev","click #explore":"showCustom","keyup #input_baseUrl":"showCustomOnKeyup","keyup #input_apiKey":"showCustomOnKeyup"};y.prototype.initialize=function(){};y.prototype.showPetStore=function(A){return this.trigger("update-swagger-ui",{url:"http://petstore.swagger.wordnik.com/api/api-docs"})};y.prototype.showWordnikDev=function(A){return this.trigger("update-swagger-ui",{url:"http://api.wordnik.com/v4/resources.json"})};y.prototype.showCustomOnKeyup=function(A){if(A.keyCode===13){return this.showCustom()}};y.prototype.showCustom=function(A){if(A!=null){A.preventDefault()}return this.trigger("update-swagger-ui",{url:$("#input_baseUrl").val(),apiKey:$("#input_apiKey").val()})};y.prototype.update=function(B,C,A){if(A==null){A=false}$("#input_baseUrl").val(B);if(A){return this.trigger("update-swagger-ui",{url:B})}};return y})(Backbone.View);u=(function(y){v(z,y);function z(){g=z.__super__.constructor.apply(this,arguments);return g}z.prototype.initialize=function(){};z.prototype.render=function(){var B,G,D,E,C,A,F;$(this.el).html(Handlebars.templates.main(this.model));E={};B=0;F=this.model.apisArray;for(C=0,A=F.length;C<A;C++){D=F[C];G=D.name;while(typeof E[G]!=="undefined"){G=G+"_"+B;B+=1}D.id=G;E[G]=D;this.addResource(D)}return this};z.prototype.addResource=function(B){var A;A=new n({model:B,tagName:"li",id:"resource_"+B.id,className:"resource"});return $("#resources").append(A.render().el)};z.prototype.clear=function(){return $(this.el).html("")};return z})(Backbone.View);n=(function(z){v(y,z);function y(){f=y.__super__.constructor.apply(this,arguments);return f}y.prototype.initialize=function(){};y.prototype.render=function(){var B,G,D,C,E,A,F;$(this.el).html(Handlebars.templates.resource(this.model));D={};F=this.model.operationsArray;for(E=0,A=F.length;E<A;E++){C=F[E];B=0;G=C.nickname;while(typeof D[G]!=="undefined"){G=G+"_"+B;B+=1}D[G]=C;C.nickname=G;C.parentId=this.model.id;this.addOperation(C)}return this};y.prototype.addOperation=function(A){var B;A.number=this.number;B=new o({model:A,tagName:"li",className:"endpoint"});$(".endpoints",$(this.el)).append(B.render().el);return this.number++};return y})(Backbone.View);o=(function(z){v(y,z);function y(){e=y.__super__.constructor.apply(this,arguments);return e}y.prototype.invocationUrl=null;y.prototype.events={"submit .sandbox":"submitOperation","click .submit":"submitOperation","click .response_hider":"hideResponse","click .toggleOperation":"toggleOperationContent","mouseenter .api-ic":"mouseEnter","mouseout .api-ic":"mouseExit"};y.prototype.initialize=function(){};y.prototype.mouseEnter=function(F){var D,E,I,B,A,J,G,C,K,H;D=$(F.currentTarget.parentNode).find("#api_information_panel");K=event.pageX;H=event.pageY;J=$(window).scrollLeft();G=$(window).scrollTop();B=J+$(window).width();A=G+$(window).height();C=D.width();E=D.height();if(K+C>B){K=B-C}if(K<J){K=J}if(H+E>A){H=A-E}if(H<G){H=G}I={};I.top=H;I.left=K;D.css(I);return $(F.currentTarget.parentNode).find("#api_information_panel").show()};y.prototype.mouseExit=function(A){return $(A.currentTarget.parentNode).find("#api_information_panel").hide()};y.prototype.render=function(){var Q,R,P,O,I,N,J,M,K,H,L,G,F,E,C,T,V,U,S,D,B,A,W;R=true;if(!R){this.model.isReadOnly=true}this.model.oauth=null;if(this.model.authorizations){D=this.model.authorizations;for(P in D){L=D[P];if(P==="oauth2"){if(this.model.oauth===null){this.model.oauth={}}if(this.model.oauth.scopes===void 0){this.model.oauth.scopes=[]}for(G=0,T=L.length;G<T;G++){O=L[G];this.model.oauth.scopes.push(O)}}}}$(this.el).html(Handlebars.templates.operation(this.model));if(this.model.responseClassSignature&&this.model.responseClassSignature!=="string"){M={sampleJSON:this.model.responseSampleJSON,isParam:false,signature:this.model.responseClassSignature};J=new i({model:M,tagName:"div"});$(".model-signature",$(this.el)).append(J.render().el)}else{$(".model-signature",$(this.el)).html(this.model.type)}Q={isParam:false};Q.consumes=this.model.consumes;Q.produces=this.model.produces;B=this.model.parameters;for(F=0,V=B.length;F<V;F++){I=B[F];H=I.type||I.dataType;if(H.toLowerCase()==="file"){if(!Q.consumes){log("set content type ");Q.consumes="multipart/form-data"}}}N=new m({model:Q});$(".response-content-type",$(this.el)).append(N.render().el);A=this.model.parameters;for(E=0,U=A.length;E<U;E++){I=A[E];this.addParameter(I,Q.consumes)}W=this.model.responseMessages;for(C=0,S=W.length;C<S;C++){K=W[C];this.addStatusCode(K)}return this};y.prototype.addParameter=function(C,A){var B;C.consumes=A;B=new k({model:C,tagName:"tr",readOnly:this.model.isReadOnly});return $(".operation-params",$(this.el)).append(B.render().el)};y.prototype.addStatusCode=function(B){var A;A=new p({model:B,tagName:"tr"});return $(".operation-status",$(this.el)).append(A.render().el)};y.prototype.submitOperation=function(O){var Q,G,N,D,I,A,J,M,L,K,P,F,C,H,E,B;if(O!=null){O.preventDefault()}G=$(".sandbox",$(this.el));Q=true;G.find("input.required").each(function(){var R=this;$(this).removeClass("error");if(jQuery.trim($(this).val())===""){$(this).addClass("error");$(this).wiggle({callback:function(){return $(R).focus()}});return Q=false}});if(Q){D={};A={parent:this};N=false;H=G.find("input");for(M=0,P=H.length;M<P;M++){I=H[M];if((I.value!=null)&&jQuery.trim(I.value).length>0){D[I.name]=I.value}if(I.type==="file"){N=true}}E=G.find("textarea");for(L=0,F=E.length;L<F;L++){I=E[L];if((I.value!=null)&&jQuery.trim(I.value).length>0){D.body=I.value}}B=G.find("select");for(K=0,C=B.length;K<C;K++){I=B[K];J=this.getSelectedValue(I);if((J!=null)&&jQuery.trim(J).length>0){D[I.name]=J}}A.responseContentType=$("div select[name=responseContentType]",$(this.el)).val();A.requestContentType=$("div select[name=parameterContentType]",$(this.el)).val();$(".response_throbber",$(this.el)).show();if(N){return this.handleFileUpload(D,G)}else{return this.model["do"](D,A,this.showCompleteStatus,this.showErrorStatus,this)}}};y.prototype.success=function(A,B){return B.showCompleteStatus(A)};y.prototype.handleFileUpload=function(Q,I){var M,H,C,N,L,K,J,G,E,D,P,T,S,R,F,B,A,U,O=this;log("it's a file upload");F=I.serializeArray();for(J=0,P=F.length;J<P;J++){N=F[J];if((N.value!=null)&&jQuery.trim(N.value).length>0){Q[N.name]=N.value}}M=new FormData();B=this.model.parameters;for(G=0,T=B.length;G<T;G++){K=B[G];if(K.paramType==="form"){if(Q[K.name]!==void 0){M.append(K.name,Q[K.name])}}}C={};A=this.model.parameters;for(E=0,S=A.length;E<S;E++){K=A[E];if(K.paramType==="header"){C[K.name]=Q[K.name]}}log(C);U=I.find('input[type~="file"]');for(D=0,R=U.length;D<R;D++){H=U[D];M.append($(H).attr("name"),H.files[0])}log(M);this.invocationUrl=this.model.supportHeaderParams()?(C=this.model.getHeaderParams(Q),this.model.urlify(Q,false)):this.model.urlify(Q,true);$(".request_url",$(this.el)).html("<pre>"+this.invocationUrl+"</pre>");L={type:this.model.method,url:this.invocationUrl,headers:C,data:M,dataType:"json",contentType:false,processData:false,error:function(W,X,V){return O.showErrorStatus(O.wrap(W),O)},success:function(V){return O.showResponse(V,O)},complete:function(V){return O.showCompleteStatus(O.wrap(V),O)}};if(window.authorizations){window.authorizations.apply(L)}jQuery.ajax(L);return false};y.prototype.wrap=function(E){var C,F,H,B,G,D,A;H={};F=E.getAllResponseHeaders().split("\r");for(D=0,A=F.length;D<A;D++){B=F[D];C=B.split(":");if(C[0]!==void 0&&C[1]!==void 0){H[C[0].trim()]=C[1].trim()}}G={};G.content={};G.content.data=E.responseText;G.headers=H;G.request={};G.request.url=this.invocationUrl;G.status=E.status;return G};y.prototype.getSelectedValue=function(A){var D,C,F,B,E;if(!A.multiple){return A.value}else{C=[];E=A.options;for(F=0,B=E.length;F<B;F++){D=E[F];if(D.selected){C.push(D.value)}}if(C.length>0){return C.join(",")}else{return null}}};y.prototype.hideResponse=function(A){if(A!=null){A.preventDefault()}$(".response",$(this.el)).slideUp();return $(".response_hider",$(this.el)).fadeOut()};y.prototype.showResponse=function(A){var B;B=JSON.stringify(A,null,"\t").replace(/\n/g,"<br>");return $(".response_body",$(this.el)).html(escape(B))};y.prototype.showErrorStatus=function(B,A){return A.showStatus(B)};y.prototype.showCompleteStatus=function(B,A){return A.showStatus(B)};y.prototype.formatXml=function(H){var D,G,B,I,N,J,C,A,L,M,F,E,K;A=/(>)(<)(\/*)/g;M=/[ ]*(.*)[ ]+\n/g;D=/(<.+>)(.+\n)/g;H=H.replace(A,"$1\n$2$3").replace(M,"$1\n").replace(D,"$1\n$2");C=0;G="";N=H.split("\n");B=0;I="other";L={"single->single":0,"single->closing":-1,"single->opening":0,"single->other":0,"closing->single":0,"closing->closing":-1,"closing->opening":0,"closing->other":0,"opening->single":1,"opening->closing":0,"opening->opening":1,"opening->other":1,"other->single":0,"other->closing":-1,"other->opening":0,"other->other":0};F=function(T){var P,O,R,V,S,Q,U;Q={single:Boolean(T.match(/<.+\/>/)),closing:Boolean(T.match(/<\/.+>/)),opening:Boolean(T.match(/<[^!?].*>/))};S=((function(){var W;W=[];for(R in Q){U=Q[R];if(U){W.push(R)}}return W})())[0];S=S===void 0?"other":S;P=I+"->"+S;I=S;V="";B+=L[P];V=((function(){var X,Y,W;W=[];for(O=X=0,Y=B;0<=Y?X<Y:X>Y;O=0<=Y?++X:--X){W.push(" ")}return W})()).join("");if(P==="opening->closing"){return G=G.substr(0,G.length-1)+T+"\n"}else{return G+=V+T+"\n"}};for(E=0,K=N.length;E<K;E++){J=N[E];F(J)}return G};y.prototype.showStatus=function(A){var E,D,H,G,F,C,B;if(A.content===void 0){D=A.data;B=A.url}else{D=A.content.data;B=A.request.url}G=A.headers;H=G&&G["Content-Type"]?G["Content-Type"].split(";")[0].trim():null;if(!D){E=$("<code />").text("no content");F=$('<pre class="json" />').append(E)}else{if(H==="application/json"||/\+json$/.test(H)){E=$("<code />").text(JSON.stringify(JSON.parse(D),null," "));F=$('<pre class="json" />').append(E)}else{if(H==="application/xml"||/\+xml$/.test(H)){E=$("<code />").text(this.formatXml(D));F=$('<pre class="xml" />').append(E)}else{if(H==="text/html"){E=$("<code />").html(D);F=$('<pre class="xml" />').append(E)}else{if(/^image\//.test(H)){F=$("<img>").attr("src",B)}else{E=$("<code />").text(D);F=$('<pre class="json" />').append(E)}}}}}C=F;$(".request_url",$(this.el)).html("<pre>"+B+"</pre>");$(".response_code",$(this.el)).html("<pre>"+A.status+"</pre>");$(".response_body",$(this.el)).html(C);$(".response_headers",$(this.el)).html("<pre>"+JSON.stringify(A.headers,null," ").replace(/\n/g,"<br>")+"</pre>");$(".response",$(this.el)).slideDown();$(".response_hider",$(this.el)).show();$(".response_throbber",$(this.el)).hide();return hljs.highlightBlock($(".response_body",$(this.el))[0])};y.prototype.toggleOperationContent=function(){var A;A=$("#"+Docs.escapeResourceName(this.model.parentId)+"_"+this.model.nickname+"_content");if(A.is(":visible")){return Docs.collapseOperation(A)}else{return Docs.expandOperation(A)}};return y})(Backbone.View);p=(function(z){v(y,z);function y(){d=y.__super__.constructor.apply(this,arguments);return d}y.prototype.initialize=function(){};y.prototype.render=function(){var A;A=this.template();$(this.el).html(A(this.model));return this};y.prototype.template=function(){return Handlebars.templates.status_code};return y})(Backbone.View);k=(function(z){v(y,z);function y(){b=y.__super__.constructor.apply(this,arguments);return b}y.prototype.initialize=function(){return Handlebars.registerHelper("isArray",function(B,A){if(B.type.toLowerCase()==="array"||B.allowMultiple){return A.fn(this)}else{return A.inverse(this)}})};y.prototype.render=function(){var G,A,C,F,B,H,E,D;D=this.model.type||this.model.dataType;if(this.model.paramType==="body"){this.model.isBody=true}if(D.toLowerCase()==="file"){this.model.isFile=true}E=this.template();$(this.el).html(E(this.model));B={sampleJSON:this.model.sampleJSON,isParam:true,signature:this.model.signature};if(this.model.sampleJSON){H=new i({model:B,tagName:"div"});$(".model-signature",$(this.el)).append(H.render().el)}else{$(".model-signature",$(this.el)).html(this.model.signature)}A=false;if(this.model.isBody){A=true}G={isParam:A};G.consumes=this.model.consumes;if(A){C=new l({model:G});$(".parameter-content-type",$(this.el)).append(C.render().el)}else{F=new m({model:G});$(".response-content-type",$(this.el)).append(F.render().el)}return this};y.prototype.template=function(){if(this.model.isList){return Handlebars.templates.param_list}else{if(this.options.readOnly){if(this.model.required){return Handlebars.templates.param_readonly_required}else{return Handlebars.templates.param_readonly}}else{if(this.model.required){return Handlebars.templates.param_required}else{return Handlebars.templates.param}}}};return y})(Backbone.View);i=(function(z){v(y,z);function y(){a=y.__super__.constructor.apply(this,arguments);return a}y.prototype.events={"click a.description-link":"switchToDescription","click a.snippet-link":"switchToSnippet","mousedown .snippet":"snippetToTextArea"};y.prototype.initialize=function(){};y.prototype.render=function(){var A;A=this.template();$(this.el).html(A(this.model));this.switchToDescription();this.isParam=this.model.isParam;if(this.isParam){$(".notice",$(this.el)).text("Click to set as parameter value")}return this};y.prototype.template=function(){return Handlebars.templates.signature};y.prototype.switchToDescription=function(A){if(A!=null){A.preventDefault()}$(".snippet",$(this.el)).hide();$(".description",$(this.el)).show();$(".description-link",$(this.el)).addClass("selected");return $(".snippet-link",$(this.el)).removeClass("selected")};y.prototype.switchToSnippet=function(A){if(A!=null){A.preventDefault()}$(".description",$(this.el)).hide();$(".snippet",$(this.el)).show();$(".snippet-link",$(this.el)).addClass("selected");return $(".description-link",$(this.el)).removeClass("selected")};y.prototype.snippetToTextArea=function(A){var B;if(this.isParam){if(A!=null){A.preventDefault()}B=$("textarea",$(this.el.parentNode.parentNode.parentNode));if($.trim(B.val())===""){return B.val(this.model.sampleJSON)}}};return y})(Backbone.View);j=(function(y){v(z,y);function z(){x=z.__super__.constructor.apply(this,arguments);return x}z.prototype.initialize=function(){};z.prototype.render=function(){var A;A=this.template();$(this.el).html(A(this.model));$("label[for=contentType]",$(this.el)).text("Response Content Type");return this};z.prototype.template=function(){return Handlebars.templates.content_type};return z})(Backbone.View);m=(function(y){v(z,y);function z(){w=z.__super__.constructor.apply(this,arguments);return w}z.prototype.initialize=function(){};z.prototype.render=function(){var A;A=this.template();$(this.el).html(A(this.model));$("label[for=responseContentType]",$(this.el)).text("Response Content Type");return this};z.prototype.template=function(){return Handlebars.templates.response_content_type};return z})(Backbone.View);l=(function(z){v(y,z);function y(){c=y.__super__.constructor.apply(this,arguments);return c}y.prototype.initialize=function(){};y.prototype.render=function(){var A;A=this.template();$(this.el).html(A(this.model));$("label[for=parameterContentType]",$(this.el)).text("Parameter content type:");return this};y.prototype.template=function(){return Handlebars.templates.parameter_content_type};return y})(Backbone.View)}).call(this); diff --git a/3rd_party/static/testapi-ui/app.js b/3rd_party/static/testapi-ui/app.js index edf7663..635c0ac 100644 --- a/3rd_party/static/testapi-ui/app.js +++ b/3rd_party/static/testapi-ui/app.js @@ -55,11 +55,11 @@ templateUrl: 'testapi-ui/components/guidelines/guidelines.html', controller: 'GuidelinesController as ctrl' }). - // state('communityResults', { - // url: '/community_results', - // templateUrl: 'testapi-ui/components/results/results.html', - // controller: 'ResultsController as ctrl' - // }). + state('communityResults', { + url: '/community_results', + templateUrl: 'testapi-ui/components/results/results.html', + controller: 'ResultsController as ctrl' + }). state('userResults', { url: '/user_results', templateUrl: 'testapi-ui/components/results/results.html', @@ -173,12 +173,22 @@ $rootScope.auth.doSignIn = doSignIn; $rootScope.auth.doSignOut = doSignOut; $rootScope.auth.doSignCheck = doSignCheck; + $rootScope.auth.canReview = canReview; var sign_in_url = testapiApiUrl + '/auth/signin'; var sign_out_url = testapiApiUrl + '/auth/signout'; var profile_url = testapiApiUrl + '/profile'; + function canReview(user) { + if (user.role.indexOf('reviewer') != -1) { + return true; + } else { + return false; + } + } + + /** This function initiates a sign in. */ function doSignIn(type) { $rootScope.auth.type = type; diff --git a/3rd_party/static/testapi-ui/assets/css/ascend.css b/3rd_party/static/testapi-ui/assets/css/ascend.css index 0c1bbe6..5e0d7bb 100644 --- a/3rd_party/static/testapi-ui/assets/css/ascend.css +++ b/3rd_party/static/testapi-ui/assets/css/ascend.css @@ -1,3 +1,12 @@ +/*******************************************************************************
+ * Copyright (c) 2019 opnfv.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Apache License, Version 2.0
+ * which accompanies this distribution, and is available at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *******************************************************************************/
+
.ascend .container-wrap,
.ascend .project-title,
body .vc_text_separator div,
@@ -1166,5 +1175,5 @@ body.rtl .carousel-wrap[data-full-width="false"] .control-wrap { }
body a {
- color: #27CCC0;
+ color: #1080A7;
}
diff --git a/3rd_party/static/testapi-ui/assets/css/combine.css b/3rd_party/static/testapi-ui/assets/css/combine.css index 5b3ed96..90b9fb2 100644 --- a/3rd_party/static/testapi-ui/assets/css/combine.css +++ b/3rd_party/static/testapi-ui/assets/css/combine.css @@ -1,3 +1,12 @@ +/******************************************************************************* + * Copyright (c) 2019 opnfv. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Apache License, Version 2.0 + * which accompanies this distribution, and is available at + * http://www.apache.org/licenses/LICENSE-2.0 + *******************************************************************************/ + html { overflow-y: scroll; } @@ -1000,7 +1009,7 @@ h5 { a, a:visited { - color: #27CCC0; + color: #1080A7; } .lead { @@ -3132,7 +3141,7 @@ ul.resource-links li a:hover { /* site banner */ .top-site-banner { - background-color: #27CCC0; + background-color: #1080A7; color: #fff; padding-top: 10px; } diff --git a/3rd_party/static/testapi-ui/assets/css/cvp-style.css b/3rd_party/static/testapi-ui/assets/css/cvp-style.css index ed1d938..cb6d024 100644 --- a/3rd_party/static/testapi-ui/assets/css/cvp-style.css +++ b/3rd_party/static/testapi-ui/assets/css/cvp-style.css @@ -1,7 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2019 opnfv. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Apache License, Version 2.0 + * which accompanies this distribution, and is available at + * http://www.apache.org/licenses/LICENSE-2.0 + *******************************************************************************/ + .nav>li>a { font-size: 18px; } +.nav>li>a:hover, +.nav>li>a:focus, +.nav>li.active, +.nav>li.active>a { + background-color: #27CFC3; + color: #1C1C1C; +} + + table { font-size: 15px; } @@ -29,7 +47,7 @@ th { .dropdown-menu>li>a:focus, .dropdown-menu>li>a:hover { font-size: 15px; - color: #27CFC3; + color: #1080A7; text-decoration: none; background-color: #1C1C1C; } @@ -41,8 +59,8 @@ th { .pagination>.active>span:focus, .pagination>.active>span:hover { color: #fff; - background-color: #27CFC3; - border-color: #27CFC3; + background-color: #1080A7; + border-color: #1080A7; } @@ -66,12 +84,12 @@ th { .badge-info { color: #fff; - background-color: #27CFC3; - border-color: #27CFC3; + background-color: #1080A7; + border-color: #1080A7; } .opnfv-blue { - color: #27CFC3; + color: #1080A7; } .field { @@ -83,7 +101,7 @@ table .btn.medium { } .cvp-btn { - background-color: #27CFC3; + background-color: #1080A7; font-weight: 700; font-size: 12px; } @@ -96,3 +114,22 @@ table .btn.medium { a { cursor: pointer; } + +.btn-success-cust { +color: #fff; +background-color: #27CFC3; +border-color: #27CFC3; +} + +.btn-success-cust:focus, .btn-success-cust:hover { +border-color: #1FA79C; +background-color: #1FA79C; +} + +input:invalid { + border: 2px dashed red; +} + +input:valid { + border: 2px solid black; +} diff --git a/3rd_party/static/testapi-ui/assets/css/header.css b/3rd_party/static/testapi-ui/assets/css/header.css index 9eb03c1..23c9668 100644 --- a/3rd_party/static/testapi-ui/assets/css/header.css +++ b/3rd_party/static/testapi-ui/assets/css/header.css @@ -1,3 +1,12 @@ +/******************************************************************************* + * Copyright (c) 2019 opnfv. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Apache License, Version 2.0 + * which accompanies this distribution, and is available at + * http://www.apache.org/licenses/LICENSE-2.0 + *******************************************************************************/ + .header-container-1 { height: 80px; background-color: #383A35; @@ -33,5 +42,5 @@ .header-splitline { height: 5px; - background-color: #27CFC3; + background-color: #1080A7; } diff --git a/3rd_party/static/testapi-ui/assets/css/home/home.css b/3rd_party/static/testapi-ui/assets/css/home/home.css index ed0e3f4..79c10c7 100644 --- a/3rd_party/static/testapi-ui/assets/css/home/home.css +++ b/3rd_party/static/testapi-ui/assets/css/home/home.css @@ -1,3 +1,12 @@ +/******************************************************************************* + * Copyright (c) 2019 opnfv. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Apache License, Version 2.0 + * which accompanies this distribution, and is available at + * http://www.apache.org/licenses/LICENSE-2.0 + *******************************************************************************/ + .home-container { padding-left: 0px; padding-right: 0px; diff --git a/3rd_party/static/testapi-ui/assets/css/index.css b/3rd_party/static/testapi-ui/assets/css/index.css index 3140fce..9906291 100644 --- a/3rd_party/static/testapi-ui/assets/css/index.css +++ b/3rd_party/static/testapi-ui/assets/css/index.css @@ -1,3 +1,12 @@ +/******************************************************************************* + * Copyright (c) 2019 opnfv. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Apache License, Version 2.0 + * which accompanies this distribution, and is available at + * http://www.apache.org/licenses/LICENSE-2.0 + *******************************************************************************/ + .index-header { padding-left: 0px; padding-right: 0px; diff --git a/3rd_party/static/testapi-ui/assets/img/icon.png b/3rd_party/static/testapi-ui/assets/img/icon.png Binary files differindex 9c3417b..8484cad 100644 --- a/3rd_party/static/testapi-ui/assets/img/icon.png +++ b/3rd_party/static/testapi-ui/assets/img/icon.png diff --git a/3rd_party/static/testapi-ui/components/about/about.html b/3rd_party/static/testapi-ui/components/about/about.html index b8d152d..708d35d 100644 --- a/3rd_party/static/testapi-ui/components/about/about.html +++ b/3rd_party/static/testapi-ui/components/about/about.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <hr> <div class="about-sidebar"> <a> diff --git a/3rd_party/static/testapi-ui/components/about/templates/README.html b/3rd_party/static/testapi-ui/components/about/templates/README.html index 4be7c8d..5f128aa 100644 --- a/3rd_party/static/testapi-ui/components/about/templates/README.html +++ b/3rd_party/static/testapi-ui/components/about/templates/README.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <h2>Executive Summary</h2> <p>OPNFV® is offering OPNFV compliance verification through its Compliance Verification Program (CVP). The CVP verifies products (“Offerings”) that claim compliance to OPNFV.</p> diff --git a/3rd_party/static/testapi-ui/components/application/application.html b/3rd_party/static/testapi-ui/components/application/application.html index 0b45ab3..f9f05cd 100644 --- a/3rd_party/static/testapi-ui/components/application/application.html +++ b/3rd_party/static/testapi-ui/components/application/application.html @@ -1,207 +1,13 @@ -<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> +<!-- + Copyright (c) 2019 opnfv. - <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> + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + +<div class="container-fluid common-main-container"> <div class="results-table" style="margin-top: 30px; overflow: scroll;"> <table class="table table-striped table-hover"> <thead> @@ -217,7 +23,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 +31,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> @@ -264,7 +69,8 @@ </div> </script> <tbody style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"> - <tr ng-repeat="app in ctrl.applications"> + <tr ng-if="auth.currentUser.role.indexOf('administrator') != -1" + ng-repeat="app in ctrl.applications"> <td>{{ app.creation_date | limitTo: 10 }}</td> <td>{{ app.organization_name }}</td> <td><a href="{{app.organization_web}}">{{ app.organization_web }}</a></td> @@ -284,7 +90,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 +98,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', app.owner)" 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 +126,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..366863c 100644 --- a/3rd_party/static/testapi-ui/components/application/applicationController.js +++ b/3rd_party/static/testapi-ui/components/application/applicationController.js @@ -20,43 +20,28 @@ .controller('ApplicationController', ApplicationController); ApplicationController.$inject = [ - '$http', '$stateParams', '$window', '$sce', + '$http', '$state', '$stateParams', '$window', '$sce', '$uibModal', 'testapiApiUrl', 'raiseAlert', 'ngDialog', '$scope' ]; - function ApplicationController ($http, $stateParams, $window, $sce, + function ApplicationController ($http, $state, $stateParams, $window, $sce, $uibModal, testapiApiUrl, raiseAlert, ngDialog, $scope) { var ctrl = this; - ctrl.uploadLogo = uploadLogo; + + /** Check to see if this page should display community results. */ + ctrl.isAdministrator = $scope.auth.currentUser.role.indexOf('administrator') != -1; + // Should only be on user-results-page if authenticated. + if (!$scope.auth.isAuthenticated) { + $state.go('home'); + } + // Should only be on applications if administrator + if (!ctrl.isAdministrator) { + $state.go('home'); + } 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.totalItems = null; ctrl.currentPage = 1; @@ -64,59 +49,10 @@ ctrl.numPages = null; ctrl.lab_tpl = "lab.tpl.html"; ctrl.product_tpl = "product.tpl.html"; - //ctrl.lab_html=$sce.trustAsHtml('<div>{{app.lab_email}}</div><div>{{app.lab_address}}</div><div>{{app.lab_phone}}</div>'); getApplication(); } - - 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,26 +72,38 @@ }); } - function uploadLogo() { - var file = $scope.logoFile; - var fd = new FormData(); - fd.append('file', file); + ctrl.toggleApproveApp = function(id, approved, owner) { + 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; + + var updateUrl = testapiApiUrl + "/cvp/applications/" + id; + var data = {}; + data['item'] = 'approved'; + data['approved'] = approved; + data['owner'] = owner; - $http.post(testapiApiUrl + "/cvp/applications/uploadlogo", fd, { + $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 getApplication() { - $http.get(testapiApiUrl + "/cvp/applications?page=" + ctrl.currentPage + "&signed&per_page=" + ctrl.itemsPerPage).then(function(response) { + $http.get(testapiApiUrl + "/cvp/applications?page=" + ctrl.currentPage + "&signed&per_page=" + ctrl.itemsPerPage + "&applications").then(function(response) { ctrl.applications = response.data.applications; ctrl.totalItems = response.data.pagination.total_pages * ctrl.itemsPerPage; ctrl.currentPage = response.data.pagination.current_page; diff --git a/3rd_party/static/testapi-ui/components/application/modal/confirmModal.html b/3rd_party/static/testapi-ui/components/application/modal/confirmModal.html index fddb7fb..b8f8fb3 100644 --- a/3rd_party/static/testapi-ui/components/application/modal/confirmModal.html +++ b/3rd_party/static/testapi-ui/components/application/modal/confirmModal.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div> <div class="row" style="margin-top:20px"> <div class="col-sm-offset-1 col-sm-11"> diff --git a/3rd_party/static/testapi-ui/components/auth/authPortal.html b/3rd_party/static/testapi-ui/components/auth/authPortal.html index f3aab41..1a8a26a 100644 --- a/3rd_party/static/testapi-ui/components/auth/authPortal.html +++ b/3rd_party/static/testapi-ui/components/auth/authPortal.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <h3>Sign In</h3> <strong>Please choose your account provider:</strong> <div class="row"> diff --git a/3rd_party/static/testapi-ui/components/directory/directory.html b/3rd_party/static/testapi-ui/components/directory/directory.html index b48e90d..e274af8 100644 --- a/3rd_party/static/testapi-ui/components/directory/directory.html +++ b/3rd_party/static/testapi-ui/components/directory/directory.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="container-fluid common-main-container"> <h3>OPNFV Verified Product Directory</h3> <div> diff --git a/3rd_party/static/testapi-ui/components/guidelines/data/gen.py b/3rd_party/static/testapi-ui/components/guidelines/data/gen.py index 34fb694..3ecceb9 100644 --- a/3rd_party/static/testapi-ui/components/guidelines/data/gen.py +++ b/3rd_party/static/testapi-ui/components/guidelines/data/gen.py @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + import json with open('danube.json') as f: diff --git a/3rd_party/static/testapi-ui/components/guidelines/guidelines.html b/3rd_party/static/testapi-ui/components/guidelines/guidelines.html index 1cd2b51..b23811c 100644 --- a/3rd_party/static/testapi-ui/components/guidelines/guidelines.html +++ b/3rd_party/static/testapi-ui/components/guidelines/guidelines.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <h3>OPNFV Ready™ Guidelines</h3> <!-- Guideline Filters --> diff --git a/3rd_party/static/testapi-ui/components/guidelines/partials/guidelineDetails.html b/3rd_party/static/testapi-ui/components/guidelines/partials/guidelineDetails.html index 385fafe..21d1742 100644 --- a/3rd_party/static/testapi-ui/components/guidelines/partials/guidelineDetails.html +++ b/3rd_party/static/testapi-ui/components/guidelines/partials/guidelineDetails.html @@ -1,4 +1,13 @@ <!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + +<!-- HTML for guidelines page for all OpenStack Powered (TM) guideline schemas This expects the JSON data of the guidelines file to be stored in scope variable 'guidelines'. diff --git a/3rd_party/static/testapi-ui/components/guidelines/partials/testListModal.html b/3rd_party/static/testapi-ui/components/guidelines/partials/testListModal.html index c8dae33..03c21a0 100644 --- a/3rd_party/static/testapi-ui/components/guidelines/partials/testListModal.html +++ b/3rd_party/static/testapi-ui/components/guidelines/partials/testListModal.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" aria-hidden="true" ng-click="modal.close()">×</button> diff --git a/3rd_party/static/testapi-ui/components/home/home.html b/3rd_party/static/testapi-ui/components/home/home.html index c482b9c..11eb1a6 100644 --- a/3rd_party/static/testapi-ui/components/home/home.html +++ b/3rd_party/static/testapi-ui/components/home/home.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="container-fluid"> <div class="row"> <div class="col-md-2 home-category" ng-style="{'height': ctrl.height}"> @@ -140,18 +149,20 @@ <a target="_blank" rel="noopener" href="https://www.lfnetworking.org/OVP">OPNFV Verification Program (OVP) page</a> for more information</p></li> <li><p class="home-content-text"> - From the home page, Submit the Participation Form</p></li> + From the home page, submit the + <a target="_blank" rel="noopener" href="https://na3.docusign.net/Member/PowerFormSigning.aspx?PowerFormId=034ffa32-3c2d-4a78-b2ed-af63c3acf192&env=na3-eu1&v=2"> + Participation Form</a></p></li> <li><p class="home-content-text"> Follow the step-by-step instructions in the doc: - <a href="https://opnfv-dovetail.readthedocs.io/en/latest/testing/user/certificationworkflow/index.html">OVP + <a target="_blank" rel="noopener" href="https://opnfv-dovetail.readthedocs.io/en/latest/testing/user/certificationworkflow/index.html">OVP Workflow</a></p></li> <li><p class="home-content-text"> Use this portal to upload your NFVI test results when ready</p></li> </ul> <p class="home-content-text" style="padding-bottom: 40px;"> - Please send any questions to <a href="mailto:verified@opnfv.org">verified@opnfv.org</a>. + Please send any questions to <a href="mailto:ovp-support@lfnetworking.org">ovp-support@lfnetworking.org</a>. </p> </div> </div> diff --git a/3rd_party/static/testapi-ui/components/logout/logout.html b/3rd_party/static/testapi-ui/components/logout/logout.html index 38a5c36..135784e 100644 --- a/3rd_party/static/testapi-ui/components/logout/logout.html +++ b/3rd_party/static/testapi-ui/components/logout/logout.html @@ -1 +1,10 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div cg-busy="{promise:ctrl.redirectWait,message:'Logging you out...'}"></div> diff --git a/3rd_party/static/testapi-ui/components/profile/importPubKeyModal.html b/3rd_party/static/testapi-ui/components/profile/importPubKeyModal.html index 3a5be54..35c1e8d 100644 --- a/3rd_party/static/testapi-ui/components/profile/importPubKeyModal.html +++ b/3rd_party/static/testapi-ui/components/profile/importPubKeyModal.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="modal-header"> <h4>Import Public Key</h4> <p>Instructions for adding a public key and signature can be found diff --git a/3rd_party/static/testapi-ui/components/profile/profile.html b/3rd_party/static/testapi-ui/components/profile/profile.html index 563adbf..bece01f 100644 --- a/3rd_party/static/testapi-ui/components/profile/profile.html +++ b/3rd_party/static/testapi-ui/components/profile/profile.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="container-fluid common-main-container"> <h3>User profile</h3> <div cg-busy="{promise:ctrl.authRequest,message:'Loading'}"></div> @@ -23,6 +32,67 @@ </tbody> </table> </div> + <br> + <br> + <h3>Organization Details</h3> + <table class="table table-striped table-hover"> + <tbody> + <tr> + <td>Company Name</td> + <td> + <div class="popover-wrapper"> + <a editable-theme="bs3" onbeforesave="ctrl.changeProfileDetails(ctrl.profile, 'companyName', $data)" + editable-text="ctrl.profile.companyName">{{ ctrl.profile.companyName || "None" }}</a> + </div> + </td> + </tr> + <tr> + <td>Company website</td> + <td> + <div class="popover-wrapper"> + <a editable-theme="bs3" onbeforesave="ctrl.changeProfileDetails(ctrl.profile, 'companyWebsite', $data)" + editable-url="ctrl.profile.companyWebsite">{{ ctrl.profile.companyWebsite || "None" }}</a> + </div> + </td> + </tr> + <tr> + <td>Primary Contact Name</td> + <td> + <div class="popover-wrapper"> + <a editable-theme="bs3" onbeforesave="ctrl.changeProfileDetails(ctrl.profile, 'primaryContactName', $data)" + editable-text="ctrl.profile.primaryContactName">{{ ctrl.profile.primaryContactName || "None" }}</a> + </div> + </td> + </tr> + <tr> + <td>Primary Contact Business email</td> + <td> + <div class="popover-wrapper"> + <a editable-theme="bs3" onbeforesave="ctrl.changeProfileDetails(ctrl.profile, 'primaryBusinessEmail', $data)" + editable-email="ctrl.profile.primaryBusinessEmail">{{ ctrl.profile.primaryBusinessEmail || "None" }}</a> + </div> + </td> + </tr> + <tr> + <td>Primary Contact Postal Address</td> + <td> + <div class="popover-wrapper"> + <a editable-theme="bs3" onbeforesave="ctrl.changeProfileDetails(ctrl.profile, 'primaryPostalAddress', $data)" + editable-text="ctrl.profile.primaryPostalAddress">{{ ctrl.profile.primaryPostalAddress || "None" }}</a> + </div> + </td> + </tr> + <tr> + <td>Primary Contact Phone Number</td> + <td> + <div class="popover-wrapper"> + <a editable-theme="bs3" onbeforesave="ctrl.changeProfileDetails(ctrl.profile, 'primaryPhoneNumber', $data)" + editable-tel="ctrl.profile.primaryPhoneNumber">{{ ctrl.profile.primaryPhoneNumber || "None" }}</a> + </div> + </td> + </tr> + </tbody> + </table> <div ng-show="ctrl.pubkeys"> <div class="container-fluid"> <div class="row"> diff --git a/3rd_party/static/testapi-ui/components/profile/profileController.js b/3rd_party/static/testapi-ui/components/profile/profileController.js index 0660e19..506771d 100644 --- a/3rd_party/static/testapi-ui/components/profile/profileController.js +++ b/3rd_party/static/testapi-ui/components/profile/profileController.js @@ -51,12 +51,38 @@ ctrl.updatePubKeys = updatePubKeys; ctrl.openImportPubKeyModal = openImportPubKeyModal; ctrl.openShowPubKeyModal = openShowPubKeyModal; + ctrl.changeProfileDetails = changeProfileDetails; // Must be authenticated to view this page. if (!$scope.auth.isAuthenticated) { $state.go('home'); } + ctrl.authRequest = $scope.auth.doSignCheck(); + ctrl.profile = $scope.auth.currentUser; + + function changeProfileDetails(profile, key, newValue){ + if (profile[key] === newValue) { + return; + } + var updateUrl = testapiApiUrl + "/profile"; + + var data = {}; + data[key] = newValue; + + $http.put(updateUrl, JSON.stringify(data), { + transformRequest: angular.identity, + headers: {'Content-Type': 'application/json'}}).then(function(ret) { + if (ret.data.code && ret.data.code != 0) { + alert(ret.data.msg); + } else { + profile[key] = newValue; + } + }, function(error) { + alert("Error when update data"); + }); + } + /** * This function will fetch all the user's public keys from the * server and store them in an array. diff --git a/3rd_party/static/testapi-ui/components/profile/showPubKeyModal.html b/3rd_party/static/testapi-ui/components/profile/showPubKeyModal.html index d397091..ed2e31d 100644 --- a/3rd_party/static/testapi-ui/components/profile/showPubKeyModal.html +++ b/3rd_party/static/testapi-ui/components/profile/showPubKeyModal.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="modal-header"> <h4>Public Key</h4> </div> diff --git a/3rd_party/static/testapi-ui/components/results-report/partials/editTestModal.html b/3rd_party/static/testapi-ui/components/results-report/partials/editTestModal.html index d9758fe..2212dac 100644 --- a/3rd_party/static/testapi-ui/components/results-report/partials/editTestModal.html +++ b/3rd_party/static/testapi-ui/components/results-report/partials/editTestModal.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" aria-hidden="true" ng-click="modal.close()">×</button> diff --git a/3rd_party/static/testapi-ui/components/results-report/partials/fullTestListModal.html b/3rd_party/static/testapi-ui/components/results-report/partials/fullTestListModal.html index e2d2909..61483ab 100644 --- a/3rd_party/static/testapi-ui/components/results-report/partials/fullTestListModal.html +++ b/3rd_party/static/testapi-ui/components/results-report/partials/fullTestListModal.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="modal-content"> <div class="modal-header"> <h4>All Passed Tests ({{modal.tests.length}})</h4> diff --git a/3rd_party/static/testapi-ui/components/results-report/partials/reportDetails.html b/3rd_party/static/testapi-ui/components/results-report/partials/reportDetails.html index dee4624..2edc77d 100644 --- a/3rd_party/static/testapi-ui/components/results-report/partials/reportDetails.html +++ b/3rd_party/static/testapi-ui/components/results-report/partials/reportDetails.html @@ -1,4 +1,13 @@ <!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + +<!-- HTML for each accordion group that separates the status types on the results report page. --> diff --git a/3rd_party/static/testapi-ui/components/results-report/resultsReport.html b/3rd_party/static/testapi-ui/components/results-report/resultsReport.html index 0d85875..453e191 100644 --- a/3rd_party/static/testapi-ui/components/results-report/resultsReport.html +++ b/3rd_party/static/testapi-ui/components/results-report/resultsReport.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="container-fluid common-main-container"> <h3>Test Run Results</h3> diff --git a/3rd_party/static/testapi-ui/components/results-report/resultsReportController.js b/3rd_party/static/testapi-ui/components/results-report/resultsReportController.js index 0c99962..3a20227 100644 --- a/3rd_party/static/testapi-ui/components/results-report/resultsReportController.js +++ b/3rd_party/static/testapi-ui/components/results-report/resultsReportController.js @@ -90,8 +90,27 @@ } function gotoResultLog(case_name) { - var case_area = case_name.split(".")[1]; + function openFile(log_url) { + var is_reachable = false; + + $.ajax({ + url: log_url, + async: false, + success: function (response) { + is_reachable = true; + }, + error: function (response){ + alert("Log file could not be found. Please confirm this case has been executed successfully."); + } + }); + + if(is_reachable == true){ + window.open(log_url); + } + } + var log_url = "/logs/"+ctrl.testId+"/results/"; + var case_area = case_name.split(".")[1]; if (ctrl.version == '2018.01') { if (case_area == "vping") { log_url += "functest.log"; @@ -100,29 +119,39 @@ } else { log_url += case_area+"_logs/"+case_name+".log"; } - } else { + openFile(log_url); + } else if (ctrl.version == '2018.09') { log_url += case_area + "_logs/"; if (case_area == "tempest" || case_area == "security") { log_url += case_name + ".html"; } else { log_url += case_name + ".log"; } - } - var is_reachable = false; - - $.ajax({ - url: log_url, - async: false, - success: function (response) { - is_reachable = true; - }, - error: function (response){ - alert("Log file could not be found. Please confirm this case has been executed successfully."); - } - }); - - if(is_reachable == true){ - window.open(log_url); + openFile(log_url); + } else { + var test_url = testapiApiUrl + '/tests/' + ctrl.innerId; + $http.get(test_url).then(function(test_resp){ + var result_url = testapiApiUrl + '/results/' + test_resp.data.results[0]; + $http.get(result_url).then(function(result_resp){ + var keepGoing = true; + angular.forEach(result_resp.data.testcases_list, function(testcase, index) { + if (keepGoing == true) { + if (testcase.name == case_name) { + log_url += testcase.portal_key_file; + openFile(log_url); + keepGoing = false; + } + } + }); + if (keepGoing == true) { + alert("Log file could not be found. Please confirm this case has been executed successfully."); + } + }, function(result_error) { + alert('Error when get result record'); + }); + }, function(test_error) { + alert('Error when get test record'); + }); } } @@ -148,7 +177,7 @@ ctrl.data.mandatory[name].skip += 1; ctrl.statistics.mandatory.skip += 1; ctrl.statistics.skip += 1; - }else if(ctrl.case_list_fail.indexOf(sub_case) > -1){ + }else { ctrl.data.mandatory[name].fail += 1; ctrl.statistics.mandatory.fail += 1; ctrl.statistics.fail += 1; @@ -173,7 +202,7 @@ ctrl.data.optional[name].skip += 1; ctrl.statistics.optional.skip += 1; ctrl.statistics.skip += 1; - }else if(ctrl.case_list_fail.indexOf(sub_case) > -1){ + }else { ctrl.data.optional[name].fail += 1; ctrl.statistics.optional.fail += 1; ctrl.statistics.fail += 1; @@ -262,7 +291,7 @@ case_list.push(result.case_name); } else if(ele.benchmark.data.sla_skip == 1){ case_list_skip.push(result.case_name); - } else if(ele.benchmark.data.sla_fail == 1){ + } else { case_list_fail.push(result.case_name); } } @@ -291,7 +320,7 @@ case_list.push(result.case_name); } else if(result.criteria == 'SKIP'){ case_list_skip.push(result.case_name); - } else if(result.criteria == 'FAIL') { + } else { case_list_fail.push(result.case_name); } } @@ -308,7 +337,7 @@ else if(result.sub_testcase.length == 0 && result.result == "SKIP") { case_list_skip.push(result.name); } - else if(result.sub_testcase.length == 0 && result.result == "FAIL") { + else if(result.sub_testcase.length == 0) { case_list_fail.push(result.name); } else { @@ -317,7 +346,7 @@ case_list.push(subtest.name); } else if(subtest.result == "SKIP") { case_list_skip.push(subtest.name); - } else if(subtest.result == "FAIL") { + } else { case_list_fail.push(subtest.name); } }); diff --git a/3rd_party/static/testapi-ui/components/results/modal/applicationModal.html b/3rd_party/static/testapi-ui/components/results/modal/applicationModal.html new file mode 100644 index 0000000..e7c4609 --- /dev/null +++ b/3rd_party/static/testapi-ui/components/results/modal/applicationModal.html @@ -0,0 +1,191 @@ +<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"> + <p 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" + ng-init="ctrl.organization_name=auth.currentUser.companyName" required + aria-required="true"> + </div> + </div> + <div class="field text col-md-4"> + <label class="left">Company Logo</label> + <i uib-tooltip="Required dimensions (Max Values): {width: 165pixels, height: 40pixels}" class="glyphicon glyphicon-question-sign opnfv-blue"></i> + <div class="middleColumn"> + <input class="form-control btn btn-success-cust cvp-btn medium accent-color regular-button" + modal-file-model="logoFile" type="file" style="padding: 0;" required> + </div> + </div> + <div class="field text col-md-4"> + <label class="left">Organization website</label> + <i uib-tooltip="Organization website if it is public" + class="glyphicon glyphicon-question-sign opnfv-blue"></i> + <div class="middleColumn"> + <input type="url" class="text form-control" ng-model="ctrl.organization_web" + ng-init="ctrl.organization_web=auth.currentUser.companyWebsite" required + aria-required="true"> + </div> + </div> + <div class="field 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 + 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 + 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 + 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" ng-init="ctrl.product_categories='soft&hard'"> + <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" + ng-init="ctrl.prim_name=auth.currentUser.primaryContactName" 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="email" class="text form-control" ng-model="ctrl.prim_email" + ng-init="ctrl.prim_email=auth.currentUser.primaryBusinessEmail" 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" + ng-init="ctrl.prim_address=auth.currentUser.primaryPostalAddress" 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" + ng-init="ctrl.prim_phone=auth.currentUser.primaryPhoneNumber" 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" required> + </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" required> + </div> + </div> + <div class="field text col-md-4"> + <label class="left">SUT Label</label> + <i uib-tooltip="SUT Label" class="glyphicon glyphicon-question-sign opnfv-blue"></i> + <div class="middleColumn"> + <input type="text" class="text form-control" ng-model="ctrl.sut_label" required> + </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" required> + </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" required> + </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" ng-init="ctrl.lab_location='internal'"> + <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" required> + </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" required> + </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" required> + </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" required> + </div> + </div> + </fieldset> + </div> + </div> + <button class="btn btn-default" + ng-click="ctrl.openConfirmModal(ctrl.tempResult)">Submit</button> +</div> + +<style type="text/css"> + .ngdialog.custom-background .ngdialog-content { + background: #ffffff; + } +</style> diff --git a/3rd_party/static/testapi-ui/components/results/modal/applicationView.html b/3rd_party/static/testapi-ui/components/results/modal/applicationView.html new file mode 100644 index 0000000..3cbbcb5 --- /dev/null +++ b/3rd_party/static/testapi-ui/components/results/modal/applicationView.html @@ -0,0 +1,107 @@ +<div class="container-fluid common-main-container"> + <div class="top-site-banner"> + <div class="container"> + <p class="p1">Application Details</p> + </div> + </div> + + <div class="row" style="margin-top: 20px;"> + <div class="col-lg-12 container"> + <p class="message" style="display: none;"></p> + <fieldset> + <div class="field text col-md-4"> + <label class="left">Organization name</label> + <div class="middleColumn">{{ ctrl.application.organization_name }}</div> + </div> + <div class="field text col-md-4"> + <label class="left">Company Logo</label> + <div class="middleColumn">{{ ctrl.application.company_logo }}</div> + </div> + <div class="field text col-md-4"> + <label class="left">Organization website</label> + <div class="middleColumn">{{ ctrl.application.organization_web }}</div> + </div> + <div class="field text col-md-4"> + <label class="left">Product name and/or identifier</label> + <div class="middleColumn">{{ ctrl.application.product_name }}</div> + </div> + <div class="field text col-md-4"> + <label class="left">Product specifications</label> + <div class="middleColumn">{{ ctrl.application.product_spec }}</div> + </div> + <div class="field text col-md-4"> + <label class="left">Product public documentation</label> + <div class="middleColumn">{{ ctrl.application.product_documentation }}</div> + </div> + <div class="field text col-md-4"> + <label class="left">Product categories</label> + <div class="middleColumn">{{ ctrl.application.product_categories }}</div> + </div> + <div class="field text col-md-4"> + <label class="left">Primary contact name</label> + <div class="middleColumn">{{ ctrl.application.prim_name }}</div> + </div> + <div class="field text col-md-4"> + <label class="left">Primary business email</label> + <div class="middleColumn">{{ ctrl.application.prim_email }}</div> + </div> + <div class="field text col-md-4"> + <label class="left">Primary postal address</label> + <div class="middleColumn">{{ ctrl.application.prim_address }}</div> + </div> + <div class="field text col-md-4"> + <label class="left">Primary phone number</label> + <div class="middleColumn">{{ ctrl.application.prim_phone }}</div> + </div> + <div class="field text col-md-4"> + <label class="left">Description</label> + <div class="middleColumn">{{ ctrl.application.description }}</div> + </div> + <div class="field text col-md-4"> + <label class="left">SUT Version</label> + <div class="middleColumn">{{ ctrl.application.sut_version }}</div> + </div> + <div class="field text col-md-4"> + <label class="left">SUT Label</label> + <div class="middleColumn">{{ ctrl.application.sut_label }}</div> + </div> + <div class="field text col-md-4"> + <label class="left">SUT HW Version</label> + <div class="middleColumn">{{ ctrl.application.sut_hw_version }}</div> + </div> + <div class="field text col-md-4"> + <label class="left">OVP Category</label> + <div class="middleColumn">{{ ctrl.application.ovp_category }}</div> + </div> + <div class="field text col-md-4"> + <label class="left">Location</label> + <div class="middleColumn">{{ ctrl.application.lab_location }}</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> + <div>{{ ctrl.application.lab_name }}</div> + </div> + <div class="field text col-md-4"> + <label class="left">Lab Email</label> + <div>{{ ctrl.application.lab_email }}</div> + </div> + <div class="field text col-md-4"> + <label class="left">Lab Address</label> + <div>{{ ctrl.application.lab_address }}</div> + </div> + <div class="field text col-md-4"> + <label class="left">Lab Phone Number</label> + <div>{{ ctrl.application.lab_phone }}</div> + </div> + </div> + </fieldset> + </div> + </div> +</div> + +<style type="text/css"> + .ngdialog.custom-background .ngdialog-content { + background: #ffffff; + } +</style> diff --git a/3rd_party/static/testapi-ui/components/results/modal/reviewsModal.html b/3rd_party/static/testapi-ui/components/results/modal/reviewsModal.html new file mode 100644 index 0000000..c93d1ef --- /dev/null +++ b/3rd_party/static/testapi-ui/components/results/modal/reviewsModal.html @@ -0,0 +1,41 @@ +<div class="container-fluid common-main-container"> + <div class="top-site-banner"> + <div class="container"> + <p class="p1">Community Reviews</p> + </div> + </div> + + <div class="row" style="margin-top: 20px;"> + <div class="col-lg-12 container"> + <div cg-busy="{promise:ctrl.reviewsRequest,message:'Loading'}"></div> + <div ng-show="ctrl.reviews" class="results-table" style="width: 100%; overflow-x: scroll;"> + <table ng-data="ctrl.reviews" ng-show="ctrl.reviews" class="table table-striped table-hover"> + <thead> + <tr> + <th>Reviewer</th> + <th>Linux Foundation OpenId</th> + <th>Email</th> + <th>Review Date</th> + <th>Outcome</th> + </tr> + </thead> + <tbody style="white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"> + <tr ng-repeat="(index, review) in ctrl.reviews"> + <td>{{ review.reviewer_name }}</td> + <td>{{ review.reviewer_openid }}</td> + <td>{{ review.reviewer_email }}</td> + <td>{{ review.creation_date | limitTo:19}}</td> + <td>{{ review.outcome }}</td> + </tr> + </tbody> + </table> + </div> + </div> + </div> +</div> + +<style type="text/css"> + .ngdialog.custom-background .ngdialog-content { + background: #ffffff; + } +</style> diff --git a/3rd_party/static/testapi-ui/components/results/modal/sharedModal.html b/3rd_party/static/testapi-ui/components/results/modal/sharedModal.html index 021a355..a029aa5 100644 --- a/3rd_party/static/testapi-ui/components/results/modal/sharedModal.html +++ b/3rd_party/static/testapi-ui/components/results/modal/sharedModal.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div> <h4>Enter user name or email</h4> <input type="text" ng-model="ctrl.userName"> diff --git a/3rd_party/static/testapi-ui/components/results/results.html b/3rd_party/static/testapi-ui/components/results/results.html index bc15169..77d16ec 100644 --- a/3rd_party/static/testapi-ui/components/results/results.html +++ b/3rd_party/static/testapi-ui/components/results/results.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="container-fluid common-main-container"> <h3>{{ctrl.pageHeader}}</h3> <p>{{ctrl.pageParagraph}}</p> @@ -7,11 +16,11 @@ uib-tooltip="results file is logs.xxx.tar.gz under your dovetail installation path"></i> </h4> <div class="form-group col-m-3"> - <input class="form-contrl btn btn-success cvp-btn medium accent-color regular-button" type="file" + <input class="form-contrl btn btn-success-cust cvp-btn medium accent-color regular-button" type="file" file-model="resultFile"> </div> <div class="form-group col-m-3"> - <a class="btn btn-success cvp-btn medium accent-color regular-button" ng-click="ctrl.uploadFile()"> + <a class="btn btn-success-cust cvp-btn medium accent-color regular-button" ng-click="ctrl.uploadFile()"> <span>upload result</span> </a> </div> @@ -36,7 +45,8 @@ <th>Status</th> <th>Log</th> <th>SUT</th> - <th>SUT Version</th> + <th>Application</th> + <th>Review Status</th> <th class="col-md-2">Operation</th> <th class="col-md-2">Share List</th> </tr> @@ -62,43 +72,53 @@ <td><a ng-click="ctrl.downloadLogs(result.id)">logs</a></td> <td><a ng-click="ctrl.gotoSUT(result.id)">info</a></td> <td> - <div class="popover-wrapper"> - <a editable-theme="bs3" onbeforesave="ctrl.changeLabel(result, 'sut_label', $data)" - editable-text="result.sut_label">{{ result.sut_label || "None" }}</a> - </div> + <a ng-if="result.status !='private'" ng-click="ctrl.openApplicationView(result)">View Application</a> + <div ng-if="result.status == 'private'">Not created</div> + </td> + <td><a ng-if="result.status !='private'" ng-click="ctrl.openReviewsModal(result.id)">View Reviews</a> + <div ng-if="result.status == 'private'"></div> </td> <td> <div class="btn-group" uib-dropdown> - <a id="single-button" type="button" class="btn btn-success cvp-btn medium accent-color regular-button" + <a id="single-button" type="button" class="btn btn-success-cust cvp-btn medium accent-color regular-button" uib-dropdown-toggle> Operation<span class="caret"></span> </a> <ul class="dropdown-menu" uib-dropdown-menu role="menu" aria-labelledby="single-button"> - <li role="menuitem" ng-if="auth.currentUser.openid == result.owner" + <li role="menuitem" ng-if="auth.currentUser.openid == result.owner && ctrl.isUserResults" class="menu-item menu-item-type-post_type menu-item-object-page"> - <a ng-class="{'hide': result.status == 'private'}" - ng-click="ctrl.toPrivate(result, 'private')">withdraw submit</a> + <a ng-class="{'hide': result.status != 'review'}" + ng-click="ctrl.deleteApplication(result)">withdraw submit</a> </li> - <li role="menuitem" ng-if="auth.currentUser.openid == result.owner" + <li role="menuitem" + ng-if="auth.currentUser.openid == result.owner && ctrl.isUserResults && auth.currentUser.role.indexOf('user') != -1" class="menu-item menu-item-type-post_type menu-item-object-page"> <a ng-class="{'hide': result.status != 'private'}" - ng-click="ctrl.toReview(result, 'review')">submit to review</a> + ng-click="ctrl.openApplicationModal(result)">submit to review</a> + </li> + <li role="menuitem" + ng-if="auth.currentUser.role.indexOf('reviewer') != -1 && !ctrl.isUserResults" + class="menu-item menu-item-type-post_type menu-item-object-page"> + <a ng-class="{'hide': (result.voted == 'true') || (result.status != 'review')}" + ng-click="ctrl.toApprove(result)">approve</a> </li> - <li role="menuitem" ng-if="auth.currentUser.role.indexOf('administrator') != -1" + <li role="menuitem" + ng-if="auth.currentUser.role.indexOf('reviewer') != -1 && !ctrl.isUserResults" class="menu-item menu-item-type-post_type menu-item-object-page"> - <a ng-class="{'hide': result.status == 'approved' || result.status == 'private'}" - ng-click="ctrl.toggleCheck(result, 'status', 'approved')">approve</a> + <a ng-class="{'hide': (result.voted == 'true') || (result.status != 'review')}" + ng-click="ctrl.toDisapprove(result)">not approve</a> </li> - <li role="menuitem" ng-if="auth.currentUser.role.indexOf('administrator') != -1" + <li role="menuitem" + ng-if="auth.currentUser.role.indexOf('reviewer') != -1 && !ctrl.isUserResults" class="menu-item menu-item-type-post_type menu-item-object-page"> - <a ng-class="{'hide': result.status == 'not approved' || result.status == 'private'}" - ng-click="ctrl.toggleCheck(result, 'status', 'not approved')">not approve</a> + <a ng-class="{'hide': (result.voted == 'false') || (result.status != 'review')}" + ng-click="ctrl.toUndo(result)">undo</a> </li> - <li role="menuitem" ng-if="auth.currentUser.openid == result.owner" + <li role="menuitem" ng-if="auth.currentUser.openid == result.owner && ctrl.isUserResults" class="menu-item menu-item-type-post_type menu-item-object-page"> <a ng-click="ctrl.openSharedModal(result)">share with</a> </li> - <li role="menuitem" ng-if="auth.currentUser.openid == result.owner" + <li role="menuitem" ng-if="auth.currentUser.openid == result.owner && ctrl.isUserResults" class="menu-item menu-item-type-post_type menu-item-object-page"> <a ng-click="ctrl.deleteTest(result._id)">delete</a> </li> @@ -108,7 +128,7 @@ <td> <div class="btn-group" uib-dropdown> <a id="single-button-two" type="button" - class="btn btn-success cvp-btn medium accent-color regular-button" style="width: 130px;" + class="btn btn-success-cust cvp-btn medium accent-color regular-button" style="width: 130px;" uib-dropdown-toggle> Share List<span class="caret"></span> </a> diff --git a/3rd_party/static/testapi-ui/components/results/resultsController.js b/3rd_party/static/testapi-ui/components/results/resultsController.js index 6e4e0ac..482d3a9 100644 --- a/3rd_party/static/testapi-ui/components/results/resultsController.js +++ b/3rd_party/static/testapi-ui/components/results/resultsController.js @@ -37,6 +37,24 @@ }; }]); + angular + .module('testapiApp') + .directive('modalFileModel', ['$parse', function ($parse) { + return { + restrict: 'A', + link: function(scope, element, attrs) { + var model = $parse(attrs.modalFileModel); + var modelSetter = model.assign; + + element.bind('change', function(){ + scope.$apply(function(){ + modelSetter(scope.$parent, element[0].files[0]); + }); + }); + } + }; + }]); + ResultsController.$inject = [ '$scope', '$http', '$filter', '$state', 'testapiApiUrl','raiseAlert', 'ngDialog', '$resource' ]; @@ -62,7 +80,6 @@ ctrl.gotoSUT = gotoSUT; ctrl.gotoResultDetail = gotoResultDetail; ctrl.toggleCheck = toggleCheck; - ctrl.changeLabel = changeLabel; ctrl.toReview = toReview; ctrl.toPrivate = toPrivate; ctrl.removeSharedUser = removeSharedUser; @@ -70,6 +87,16 @@ ctrl.openSharedModal = openSharedModal; ctrl.downloadLogs = downloadLogs; ctrl.deleteTest = deleteTest; + ctrl.deleteApplication = deleteApplication; + ctrl.openApplicationModal = openApplicationModal; + ctrl.toApprove = toApprove; + ctrl.toDisapprove = toDisapprove; + ctrl.toUndo = toUndo; + ctrl.openConfirmModal = openConfirmModal; + ctrl.openApplicationView = openApplicationView; + ctrl.submitApplication = submitApplication; + ctrl.openReviewsModal = openReviewsModal; + ctrl.doReview = doReview; /** Mappings of Interop WG components to marketing program names. */ ctrl.targetMappings = { @@ -110,11 +137,18 @@ // ctrl.isUserResults = $state.current.name === 'userResults'; // need auth to browse ctrl.isUserResults = $state.current.name === 'userResults'; + ctrl.isReviewer = $scope.auth.currentUser.role.indexOf('reviewer') != -1; + ctrl.isAdministrator = $scope.auth.currentUser.role.indexOf('administrator') != -1; ctrl.currentUser = $scope.auth.currentUser ? $scope.auth.currentUser.openid : null; // Should only be on user-results-page if authenticated. - if (ctrl.isUserResults && !$scope.auth.isAuthenticated) { + if (!$scope.auth.isAuthenticated) { + $state.go('home'); + } + + // Should only be on user-results-page if authenticated. + if (!ctrl.isUserResults && !ctrl.isReviewer) { $state.go('home'); } @@ -167,6 +201,261 @@ }); } + function deleteApplication (result) { + var resp = confirm('Are you sure you want to delete this application?'); + if (!resp) + return; + + $http.get(testapiApiUrl + "/cvp/applications?test_id=" + result.id).then(function(response) { + ctrl.application = response.data.applications[0]; + var app_id = ctrl.application._id; + var delUrl = testapiApiUrl + "/cvp/applications/" + app_id; + $http.delete(delUrl) + .then(function(ret) { + if (ret.data.code && ret.data.code != 0) { + alert(ret.data.msg); + return; + } + result['status'] = 'private'; + }); + + }, function(error) { + /* do nothing */ + }); + + } + + function submitApplication(result) { + var file = $scope.logoFile; + var logo_name = null; + if (typeof file !== 'undefined') { + var fd = new FormData(); + fd.append('file', file); + fd.append('company_name', ctrl.organization_name) + + $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; + } else { + logo_name = resp.data.filename; + 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_label": ctrl.sut_label, + "sut_hw_version": ctrl.sut_hw_version, + "ovp_version": result.version, + "ovp_category": ctrl.ovp_category, + "company_logo": logo_name, + "approve_date": "", + "approved": "false", + "test_id": result.id, + "lab_location": ctrl.lab_location, + "lab_email": ctrl.lab_email, + "lab_address": ctrl.lab_address, + "lab_phone": ctrl.lab_phone + }; + + if(ctrl.organization_name == null || + ctrl.organization_web == null || + ctrl.product_name == null || + ctrl.product_spec == null || + ctrl.product_documentation == null || + 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_label == null || + ctrl.sut_hw_version == null || + ctrl.ovp_category == null) { + + alert('There are empty required fields in the application form'); + + } else if (ctrl.lab_location == 'third') { + if (ctrl.lab_name == null || + ctrl.lab_email == null || + ctrl.lab_address == null || + ctrl.lab_phone == null) { + alert('There are empty required fields in the application form'); + } else { + + $http.post(testapiApiUrl + "/cvp/applications", data).then(function(resp) { + if (resp.data.code && resp.data.code != 0) { + alert(resp.data.msg); + return; + } + toggleCheck(result, 'status', 'review'); + }, function(error) { + /* do nothing */ + }); + + } + + } else { + + $http.post(testapiApiUrl + "/cvp/applications", data).then(function(resp) { + if (resp.data.code && resp.data.code != 0) { + alert(resp.data.msg); + return; + } + toggleCheck(result, 'status', 'review'); + }, function(error) { + /* do nothing */ + }); + + } + } + }, function(error) { + /* do nothing */ + }); + logo_name = file.name; + } + + if (typeof file === 'undefined') { + alert('There are empty required fields in the application form'); + } + ngDialog.close(); + } + + function openConfirmModal(result) { + var resp = confirm("Are you sure to submit?"); + if (resp) { + ctrl.submitApplication(result); + } + } + + function openApplicationModal(result) { + ctrl.tempResult = result; + ngDialog.open({ + preCloseCallback: function(value) { + }, + template: 'testapi-ui/components/results/modal/applicationModal.html', + scope: $scope, + className: 'ngdialog-theme-default custom-background', + width: 950, + showClose: true, + closeByDocument: true + }); + } + + function openApplicationView(result) { + $http.get(testapiApiUrl + "/cvp/applications?test_id=" + result.id).then(function(response) { + ctrl.application = response.data.applications[0]; + }, function(error) { + /* do nothing */ + }); + + ctrl.tempResult = result; + ngDialog.open({ + preCloseCallback: function(value) { + }, + template: 'testapi-ui/components/results/modal/applicationView.html', + scope: $scope, + className: 'ngdialog-theme-default custom-background', + width: 950, + showClose: true, + closeByDocument: true + }); + } + + function getReviews(test) { + var reviews_url = testapiApiUrl + '/reviews?test_id=' + test; + ctrl.reviewsRequest = + $http.get(reviews_url).success(function (data) { + ctrl.reviews = data.reviews; + }).error(function (error) { + ctrl.reviews = null; + }); + } + + function openReviewsModal(test) { + getReviews(test); + ngDialog.open({ + preCloseCallback: function(value) { + }, + template: 'testapi-ui/components/results/modal/reviewsModal.html', + scope: $scope, + className: 'ngdialog-theme-default custom-background', + width: 950, + showClose: true, + closeByDocument: true + }); + } + + function doReview(test, outcome) { + var createUrl = testapiApiUrl + "/reviews"; + var data = { + 'test_id': test.id, + 'outcome': outcome + }; + + $http.post(createUrl, JSON.stringify(data), { + transformRequest: angular.identity, + headers: {'Content-Type': 'application/json'}}).then(function(ret) { + if (ret.data.code && ret.data.code != 0) { + alert(ret.data.msg); + } else { + if (outcome === null) { + test.voted = 'false'; + } else { + test.voted = 'true'; + } + } + }, function(error) { + alert('Error when creating review'); + }); + } + + function toApprove(test) { + var resp = confirm('Once you approve a test result, your action will become visible. Do you want to proceed?'); + if (resp) { + doReview(test, 'positive'); + } + } + + function toDisapprove(test) { + var resp = confirm('Once you disapprove a test result, your action will become visible. Do you want to proceed?'); + if (resp) { + doReview(test, 'negative'); + } + } + + function toUndo(test) { + var resp = confirm('Once you undo your previous vote, your action will become visible. Do you want to proceed?'); + if (resp) { + doReview(test, null); + } + } + + function toReview(result, value){ + var resp = confirm('Once you submit a test result for review, it will become readable to all OVP reviewers. Do you want to proceed?'); + if(resp){ + toggleCheck(result, 'status', value); + } + } + + function toPrivate(result, value){ + var resp = confirm('Do you want to proceed?'); + if(resp){ + toggleCheck(result, 'status', value); + } + } + function toggleCheck(result, item, newValue) { var id = result._id; var updateUrl = testapiApiUrl + "/tests/"+ id; @@ -189,10 +478,6 @@ }); } - function changeLabel(result, key, data){ - toggleCheck(result, key, data); - } - function toReview(result, value){ var resp = confirm('Once you submit a test result for review, it will become readable to all OVP reviewers. Do you want to proceed?'); if(resp){ @@ -291,26 +576,51 @@ function update() { ctrl.showError = false; // Construct the API URL based on user-specified filters. - var content_url = testapiApiUrl + '/tests' + - '?page=' + ctrl.currentPage; + var content_url = testapiApiUrl + '/tests'; var start = $filter('date')(ctrl.startDate, 'yyyy-MM-dd'); + var end = $filter('date')(ctrl.endDate, 'yyyy-MM-dd'); + ctrl.PageName = null; + content_url += '?page=' + ctrl.currentPage; + content_url += '&per_page=' + ctrl.itemsPerPage; if (start) { content_url = content_url + '&from=' + start + ' 00:00:00'; } - var end = $filter('date')(ctrl.endDate, 'yyyy-MM-dd'); if (end) { content_url = content_url + '&to=' + end + ' 23:59:59'; } if (ctrl.isUserResults) { - content_url = content_url + '&signed'+'&per_page='+ ctrl.itemsPerPage; + content_url += '&signed'; + ctrl.PageName = 'MyResults'; + } else { + content_url += '&status={"$ne":"private"}&review'; } + ctrl.resultsRequest = $http.get(content_url).success(function (data) { ctrl.data = data; ctrl.totalItems = ctrl.data.pagination.total_pages * ctrl.itemsPerPage; ctrl.currentPage = ctrl.data.pagination.current_page; ctrl.numPages = ctrl.data.pagination.total_pages; + if (ctrl.PageName === 'MyResults') { + for (var i=0; i<data.tests.length; i++) { + if (data.tests[i].owner !== ctrl.currentUser) { + var sharing = false; + if (data.tests[i].shared !== null){ + for (var j=0; j<data.tests[i].shared.length; j++) { + if (data.tests[i].shared[j] === ctrl.currentUser){ + sharing = true; + } + } + } + if (sharing == false){ + data.tests.splice(i,1); + i = i - 1; + } + } + } + ctrl.data = data; + } }).error(function (error) { ctrl.data = null; ctrl.totalItems = 0; diff --git a/3rd_party/static/testapi-ui/components/sut/sut.html b/3rd_party/static/testapi-ui/components/sut/sut.html index 9b5e278..eaa6862 100644 --- a/3rd_party/static/testapi-ui/components/sut/sut.html +++ b/3rd_party/static/testapi-ui/components/sut/sut.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="container-fluid common-main-container"> <h2>Endpoints</h2> <div class="results-table" style="margin-top: 30px;"> diff --git a/3rd_party/static/testapi-ui/index.html b/3rd_party/static/testapi-ui/index.html index 59d2ae7..f016a7c 100644 --- a/3rd_party/static/testapi-ui/index.html +++ b/3rd_party/static/testapi-ui/index.html @@ -30,6 +30,7 @@ <link rel="stylesheet" href="testapi-ui/node_modules/ng-dialog/css/ngDialog.min.css"> <link rel="stylesheet" href="testapi-ui/node_modules/ng-dialog/css/ngDialog-theme-default.min.css"> <link rel="stylesheet" href="testapi-ui/node_modules/angular-xeditable/dist/css/xeditable.min.css"> + <link rel="stylesheet" href="testapi-ui/assets/css/combine.css"> <!-- CSS Internal Code --> <link rel="stylesheet" href="testapi-ui/assets/css/cvp-style.css"> @@ -75,7 +76,8 @@ </head> <body class="container-fluid home page-template-default page page-id-6 do-etfw tribe-no-js ascend wpb-js-composer - js-comp-ver-5.2.1 vc_responsive index-header"> + js-comp-ver-5.2.1 vc_responsive index-header" + ng-controller="HeaderController as header"> <header ng-include src="'testapi-ui/shared/header/header.html'"></header> <div ui-view></div> <footer ng-include src="'testapi-ui/shared/footer/footer.html'"></footer> diff --git a/3rd_party/static/testapi-ui/robots.txt b/3rd_party/static/testapi-ui/robots.txt index 93c4420..4f47368 100644 --- a/3rd_party/static/testapi-ui/robots.txt +++ b/3rd_party/static/testapi-ui/robots.txt @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + # robotstxt.org User-agent: * diff --git a/3rd_party/static/testapi-ui/shared/alerts/alertModal.html b/3rd_party/static/testapi-ui/shared/alerts/alertModal.html index 5d1a097..b42dac6 100644 --- a/3rd_party/static/testapi-ui/shared/alerts/alertModal.html +++ b/3rd_party/static/testapi-ui/shared/alerts/alertModal.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="modal-body" style="padding:0px"> <div class="alert alert-{{alert.data.mode}}" style="margin-bottom:0px"> <button type="button" class="close" data-ng-click="alert.close()" > diff --git a/3rd_party/static/testapi-ui/shared/alerts/confirmModal.html b/3rd_party/static/testapi-ui/shared/alerts/confirmModal.html index bf5640c..b93a8a3 100644 --- a/3rd_party/static/testapi-ui/shared/alerts/confirmModal.html +++ b/3rd_party/static/testapi-ui/shared/alerts/confirmModal.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="modal-header"> <h3 class="modal-title">Confirm</h3> </div> diff --git a/3rd_party/static/testapi-ui/shared/alerts/confirmModalFactory.js b/3rd_party/static/testapi-ui/shared/alerts/confirmModalFactory.js index 76c74df..2ee3640 100644 --- a/3rd_party/static/testapi-ui/shared/alerts/confirmModalFactory.js +++ b/3rd_party/static/testapi-ui/shared/alerts/confirmModalFactory.js @@ -1,3 +1,12 @@ +/******************************************************************************* + * Copyright (c) 2019 opnfv. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Apache License, Version 2.0 + * which accompanies this distribution, and is available at + * http://www.apache.org/licenses/LICENSE-2.0 + *******************************************************************************/ + (function () { 'use strict'; diff --git a/3rd_party/static/testapi-ui/shared/footer/footer.html b/3rd_party/static/testapi-ui/shared/footer/footer.html index c0f1b70..f82de88 100644 --- a/3rd_party/static/testapi-ui/shared/footer/footer.html +++ b/3rd_party/static/testapi-ui/shared/footer/footer.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div> <span class="hide">version: web.cvp.0.7.0</span> </div> diff --git a/3rd_party/static/testapi-ui/shared/header/header.html b/3rd_party/static/testapi-ui/shared/header/header.html index 54470e7..002f632 100644 --- a/3rd_party/static/testapi-ui/shared/header/header.html +++ b/3rd_party/static/testapi-ui/shared/header/header.html @@ -1,3 +1,12 @@ +<!-- + Copyright (c) 2019 opnfv. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Apache License, Version 2.0 + which accompanies this distribution, and is available at + http://www.apache.org/licenses/LICENSE-2.0 +--> + <div class="header-container-1"> <div class="row header-container-row"> <div class="col-md-3"> @@ -19,6 +28,10 @@ ng-if="auth.isAuthenticated && auth.currentUser.role.indexOf('administrator') != -1"> <a ui-sref="application">Applications</a> </li> + <li ng-class="{ active: header.isActive('/community_results')}" + ng-if="auth.isAuthenticated && auth.canReview(auth.currentUser)"> + <a ui-sref="communityResults">Incoming Reviews</a> + </li> <li ng-class="{ active: header.isActive('/user_results')}" ng-if="auth.isAuthenticated"> <a ui-sref="userResults">My Results</a> </li> @@ -1,3 +1,7 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. (c) OPNFV + ============= opnfv-testapi ============= diff --git a/deployment/deploy.py b/deployment/deploy.py index 6433fa6..b3e0f3e 100644 --- a/deployment/deploy.py +++ b/deployment/deploy.py @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + import argparse import os diff --git a/deployment/docker-compose.yml.template b/deployment/docker-compose.yml.template index cd68404..873854d 100644 --- a/deployment/docker-compose.yml.template +++ b/deployment/docker-compose.yml.template @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + version: '2' services: mongo: diff --git a/docker/README.rst b/docker/README.rst index a58df33..3a32eb2 100644 --- a/docker/README.rst +++ b/docker/README.rst @@ -1,3 +1,7 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. (c) OPNFV + Docker Deployment ================= diff --git a/docker/config.env.sample b/docker/config.env.sample index f824c22..0feb308 100644 --- a/docker/config.env.sample +++ b/docker/config.env.sample @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + mongodb_url=mongodb://mongodb:27017/ base_url=http://ovp.localhost testapi_url=lfnapi:8010 diff --git a/docker/db/pods.json b/docker/db/pods.json index 3cd1dad..d317888 100644 --- a/docker/db/pods.json +++ b/docker/db/pods.json @@ -379,4 +379,4 @@ "_id": "592d7d7878a2ad000ae6ac49", "details": "" } -]
\ No newline at end of file +] diff --git a/docker/db/projects.json b/docker/db/projects.json index d034b80..d5101cb 100644 --- a/docker/db/projects.json +++ b/docker/db/projects.json @@ -215,4 +215,4 @@ "name": "vina", "creation_date": "2017-05-29 08:58:21.248835" } -]
\ No newline at end of file +] diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 15e28f7..8456bbf 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + --- version: '3' services: diff --git a/docker/nginx-proxy/custom_proxy_settings.conf b/docker/nginx-proxy/custom_proxy_settings.conf index ae0cc76..8d51017 100644 --- a/docker/nginx-proxy/custom_proxy_settings.conf +++ b/docker/nginx-proxy/custom_proxy_settings.conf @@ -1 +1,10 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + client_max_body_size 20m; diff --git a/docker/nginx/nginx.conf b/docker/nginx/nginx.conf index f7d5055..97d9b1c 100644 --- a/docker/nginx/nginx.conf +++ b/docker/nginx/nginx.conf @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + user www-data; worker_processes 4; pid /run/nginx.pid; diff --git a/docker/nginx/sites-available/default-onap b/docker/nginx/sites-available/default-onap index e6aecb1..2fa3f2d 100644 --- a/docker/nginx/sites-available/default-onap +++ b/docker/nginx/sites-available/default-onap @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + upstream lfnapi { server lfnapi:8010; } diff --git a/docker/nginx/sites-available/default-opnfv b/docker/nginx/sites-available/default-opnfv index f271fb4..a1a3d7c 100644 --- a/docker/nginx/sites-available/default-opnfv +++ b/docker/nginx/sites-available/default-opnfv @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + upstream lfnapi { server lfnapi:8010; } diff --git a/docker/prepare-env.sh b/docker/prepare-env.sh index 762e741..52dbd1b 100755 --- a/docker/prepare-env.sh +++ b/docker/prepare-env.sh @@ -1,4 +1,13 @@ #!/bin/bash +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + FILE=/etc/opnfv_testapi/config.ini diff --git a/docker/start-nginx.sh b/docker/start-nginx.sh index 5f33847..8e43016 100755 --- a/docker/start-nginx.sh +++ b/docker/start-nginx.sh @@ -1,4 +1,13 @@ #!/bin/bash +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + NGINX_CONF=/etc/nginx/sites-enabled/default if [ "$testapi_url" != "" ]; then diff --git a/docker/start-server.sh b/docker/start-server.sh index 8bf6084..d088c24 100755 --- a/docker/start-server.sh +++ b/docker/start-server.sh @@ -1,4 +1,12 @@ #!/bin/bash +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## bash docker/prepare-env.sh opnfv-testapi diff --git a/docker/supervisor/conf.d/nginx.conf b/docker/supervisor/conf.d/nginx.conf index 72231ab..77f4c01 100644 --- a/docker/supervisor/conf.d/nginx.conf +++ b/docker/supervisor/conf.d/nginx.conf @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + [program:nginx] command = /usr/sbin/nginx process_name=%(program_name)s diff --git a/docker/vhost.env.sample b/docker/vhost.env.sample index 1c4c87f..1de171c 100644 --- a/docker/vhost.env.sample +++ b/docker/vhost.env.sample @@ -1 +1,10 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + VIRTUAL_HOST=ovp.localhost diff --git a/etc/config.ini b/etc/config.ini index 0bcae0c..b19454c 100644 --- a/etc/config.ini +++ b/etc/config.ini @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + # to add a new parameter in the config file, # the CONF object in config.ini must be updated [mongo] diff --git a/htmlize/doc-build.sh b/htmlize/doc-build.sh index 33560ce..2b703c6 100644 --- a/htmlize/doc-build.sh +++ b/htmlize/doc-build.sh @@ -1,4 +1,12 @@ #!/bin/bash +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## set -o errexit diff --git a/htmlize/push-doc-artifact.sh b/htmlize/push-doc-artifact.sh index 4cf1988..5e8e10e 100644 --- a/htmlize/push-doc-artifact.sh +++ b/htmlize/push-doc-artifact.sh @@ -1,4 +1,12 @@ #!/bin/bash +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## set -e set -o pipefail @@ -1,4 +1,12 @@ #!/bin/bash +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## usage=" Script to install opnfv_tesgtapi automatically. diff --git a/opnfv_testapi/common/utils.py b/opnfv_testapi/common/utils.py index 107c709..b432212 100644 --- a/opnfv_testapi/common/utils.py +++ b/opnfv_testapi/common/utils.py @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + import logging import smtplib from email.mime.text import MIMEText diff --git a/opnfv_testapi/db/api.py b/opnfv_testapi/db/api.py index c057480..a51e7fc 100644 --- a/opnfv_testapi/db/api.py +++ b/opnfv_testapi/db/api.py @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + import motor from opnfv_testapi.common.config import CONF diff --git a/opnfv_testapi/resources/application_handlers.py b/opnfv_testapi/resources/application_handlers.py index 7d823b8..653e6b5 100644 --- a/opnfv_testapi/resources/application_handlers.py +++ b/opnfv_testapi/resources/application_handlers.py @@ -236,19 +236,19 @@ class ApplicationsGURHandler(GenericApplicationHandler): data = json.loads(self.request.body) item = data.get('item') value = data.get(item) + owner = data.get('owner') logging.debug('%s:%s', item, value) try: - self.update(application_id, item, value) + self.update(application_id, item, value, owner) except Exception as e: logging.error('except:%s', e) return @gen.coroutine - def update(self, application_id, item, value): + def update(self, application_id, item, value, owner): self.json_args = {} self.json_args[item] = value - query = {'_id': objectid.ObjectId(application_id), 'owner': - self.get_secure_cookie(auth_const.OPENID)} + query = {'_id': objectid.ObjectId(application_id), 'owner': owner} db_keys = ['_id', 'owner'] if item == 'approved': if value == 'true': diff --git a/opnfv_testapi/resources/handlers.py b/opnfv_testapi/resources/handlers.py index 559e689..df0cae5 100644 --- a/opnfv_testapi/resources/handlers.py +++ b/opnfv_testapi/resources/handlers.py @@ -79,6 +79,30 @@ class GenericApiHandler(web.RequestHandler): date_range.update({'$gte': str(v)}) elif k == 'to': date_range.update({'$lt': str(v)}) + elif k == 'applications': + role = self.get_secure_cookie(auth_const.ROLE) + logging.info('role:%s', role) + if role: + if role.find("administrator") != -1: + query['$or'] = [ + { + "status": { + "$ne": "private" + } + } + ] + elif k == 'review': + role = self.get_secure_cookie(auth_const.ROLE) + logging.info('role:%s', role) + if role: + if role.find("reviewer") != -1: + query['$or'] = [ + { + "status": { + "$ne": "private" + } + } + ] elif k == 'signed': openid = self.get_secure_cookie(auth_const.OPENID) user = yield dbapi.db_find_one("users", {'openid': openid}) @@ -98,9 +122,6 @@ class GenericApiHandler(web.RequestHandler): } } ] - - if role.find("reviewer") != -1: - query['$or'].append({"status": {"$ne": "private"}}) elif k == 'status': if v.startswith('{'): query[k] = json.loads(v) diff --git a/opnfv_testapi/resources/scenario_handlers.py b/opnfv_testapi/resources/scenario_handlers.py index 0aa6063..4f9c32c 100644 --- a/opnfv_testapi/resources/scenario_handlers.py +++ b/opnfv_testapi/resources/scenario_handlers.py @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + import functools from opnfv_testapi.common import message diff --git a/opnfv_testapi/resources/scenario_models.py b/opnfv_testapi/resources/scenario_models.py index ca820cd..68862c8 100644 --- a/opnfv_testapi/resources/scenario_models.py +++ b/opnfv_testapi/resources/scenario_models.py @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + from opnfv_testapi.resources import models from opnfv_testapi.tornado_swagger import swagger diff --git a/opnfv_testapi/resources/test_handlers.py b/opnfv_testapi/resources/test_handlers.py index 7ab20dc..babce7d 100644 --- a/opnfv_testapi/resources/test_handlers.py +++ b/opnfv_testapi/resources/test_handlers.py @@ -23,6 +23,7 @@ from opnfv_testapi.tornado_swagger import swagger from opnfv_testapi.ui.auth import constants as auth_const from opnfv_testapi.db import api as dbapi +DOVETAIL_RESULTS_PATH = '/home/testapi/logs/{}/results/results.json' DOVETAIL_LOG_PATH = '/home/testapi/logs/{}/results/dovetail.log' @@ -147,26 +148,46 @@ class TestsGURHandler(GenericTestHandler): if not data: raises.NotFound(message.not_found(self.table, query)) - validation = yield self._check_api_response_validation(data['id']) - - data.update({'validation': validation}) + # only do this when it's nfvi not vnf + if 'is_onap' not in data.keys() or data['is_onap'] != 'true': + validation = yield self._check_api_response_validation(data['id']) + data.update({'validation': validation}) self.finish_request(self.format_data(data)) @gen.coroutine def _check_api_response_validation(self, test_id): + results_path = DOVETAIL_RESULTS_PATH.format(test_id) log_path = DOVETAIL_LOG_PATH.format(test_id) - if not os.path.exists(log_path): - raises.Forbidden('dovetail.log not found, please check') - - with open(log_path) as f: - log_content = f.read() - - warning_keyword = 'Strict API response validation DISABLED' - if warning_keyword in log_content: - raise gen.Return('API response validation disabled') - else: - raise gen.Return('API response validation enabled') + res = None + + # For release after 2018.09 + # Dovetail adds 'validation' directly into results.json + if os.path.exists(results_path): + with open(results_path) as f: + try: + data = json.load(f) + if data['validation'] == 'enabled': + res = 'API response validation enabled' + else: + res = 'API response validation disabled' + except Exception: + pass + if res: + raise gen.Return(res) + + # For 2018.01 and 2018.09 + # Need to check dovetail.log for this info + if os.path.exists(log_path): + with open(log_path) as f: + log_content = f.read() + warning_keyword = 'Strict API response validation DISABLED' + if warning_keyword in log_content: + raise gen.Return('API response validation disabled') + else: + raise gen.Return('API response validation enabled') + + raises.Forbidden('neither results.json nor dovetail.log are found') @swagger.operation(nickname="deleteTestById") @gen.coroutine @@ -294,11 +315,6 @@ class TestsGURHandler(GenericTestHandler): self.finish_request({'code': 403, 'msg': msg}) return - if not self.is_onap and not test['sut_label']: - msg = 'Please fill out SUT version before submission' - self.finish_request({'code': 403, 'msg': msg}) - return - query['owner'] = curr_user db_keys.append('owner') diff --git a/opnfv_testapi/router/url_mappings.py b/opnfv_testapi/router/url_mappings.py index 65c8480..4dc4893 100644 --- a/opnfv_testapi/router/url_mappings.py +++ b/opnfv_testapi/router/url_mappings.py @@ -56,6 +56,7 @@ mappings = [ (r'/api/v1/auth/signin_return_cas', sign.SigninReturnCasHandler), (r'/api/v1/auth/signout', sign.SignoutHandler), (r'/api/v1/profile', user.ProfileHandler), + (r'/api/v1/reviews', review_handlers.ReviewsCLHandler) ] diff --git a/opnfv_testapi/tests/__init__.py b/opnfv_testapi/tests/__init__.py index 9f28b0b..3eee7ac 100644 --- a/opnfv_testapi/tests/__init__.py +++ b/opnfv_testapi/tests/__init__.py @@ -1 +1,10 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + __author__ = 'serena' diff --git a/opnfv_testapi/tests/unit/common/noparam.ini b/opnfv_testapi/tests/unit/common/noparam.ini index fda2a09..7a00a17 100644 --- a/opnfv_testapi/tests/unit/common/noparam.ini +++ b/opnfv_testapi/tests/unit/common/noparam.ini @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + # to add a new parameter in the config file, # the CONF object in config.ini must be updated [mongo] diff --git a/opnfv_testapi/tests/unit/common/normal.ini b/opnfv_testapi/tests/unit/common/normal.ini index 678cb68..f6626c6 100644 --- a/opnfv_testapi/tests/unit/common/normal.ini +++ b/opnfv_testapi/tests/unit/common/normal.ini @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + # to add a new parameter in the config file, # the CONF object in config.ini must be updated [mongo] diff --git a/opnfv_testapi/tests/unit/common/nosection.ini b/opnfv_testapi/tests/unit/common/nosection.ini index 9988fc0..cfe587a 100644 --- a/opnfv_testapi/tests/unit/common/nosection.ini +++ b/opnfv_testapi/tests/unit/common/nosection.ini @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + # to add a new parameter in the config file, # the CONF object in config.ini must be updated [api] diff --git a/opnfv_testapi/tests/unit/common/notboolean.ini b/opnfv_testapi/tests/unit/common/notboolean.ini index b3f3276..b717579 100644 --- a/opnfv_testapi/tests/unit/common/notboolean.ini +++ b/opnfv_testapi/tests/unit/common/notboolean.ini @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + # to add a new parameter in the config file, # the CONF object in config.ini must be updated [mongo] diff --git a/opnfv_testapi/tests/unit/common/notint.ini b/opnfv_testapi/tests/unit/common/notint.ini index d1b752a..c915c81 100644 --- a/opnfv_testapi/tests/unit/common/notint.ini +++ b/opnfv_testapi/tests/unit/common/notint.ini @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + # to add a new parameter in the config file, # the CONF object in config.ini must be updated [mongo] diff --git a/opnfv_testapi/tests/unit/common/test_config.py b/opnfv_testapi/tests/unit/common/test_config.py index cc8743c..d8f2262 100644 --- a/opnfv_testapi/tests/unit/common/test_config.py +++ b/opnfv_testapi/tests/unit/common/test_config.py @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + import argparse diff --git a/opnfv_testapi/tests/unit/conftest.py b/opnfv_testapi/tests/unit/conftest.py index feff1da..7adb179 100644 --- a/opnfv_testapi/tests/unit/conftest.py +++ b/opnfv_testapi/tests/unit/conftest.py @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + from os import path import pytest diff --git a/opnfv_testapi/tests/unit/resources/test_project.py b/opnfv_testapi/tests/unit/resources/test_project.py index 0622ba8..e15520b 100644 --- a/opnfv_testapi/tests/unit/resources/test_project.py +++ b/opnfv_testapi/tests/unit/resources/test_project.py @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + import httplib import unittest diff --git a/opnfv_testapi/tests/unit/resources/test_scenario.py b/opnfv_testapi/tests/unit/resources/test_scenario.py index b2bfb86..e878cdd 100644 --- a/opnfv_testapi/tests/unit/resources/test_scenario.py +++ b/opnfv_testapi/tests/unit/resources/test_scenario.py @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + import functools import httplib import json diff --git a/opnfv_testapi/ui/auth/base.py b/opnfv_testapi/ui/auth/base.py index bea87c4..0412fa2 100644 --- a/opnfv_testapi/ui/auth/base.py +++ b/opnfv_testapi/ui/auth/base.py @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + import random import string diff --git a/opnfv_testapi/ui/auth/constants.py b/opnfv_testapi/ui/auth/constants.py index 44ccb46..502b9d0 100644 --- a/opnfv_testapi/ui/auth/constants.py +++ b/opnfv_testapi/ui/auth/constants.py @@ -1,6 +1,15 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + OPENID = 'openid' ROLE = 'role' -DEFAULT_ROLE = 'user' +DEFAULT_ROLE = '' # OpenID parameters OPENID_MODE = 'openid.mode' diff --git a/requirements.txt b/requirements.txt index 07a4fe6..e924f0b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + import setuptools @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + # Tox (http://tox.testrun.org/) is a tool for running tests # in multiple virtualenvs. This configuration file will run the # test suite on all supported python versions. To use it, "pip install tox" diff --git a/update/templates/rm_images.sh b/update/templates/rm_images.sh index 6722573..c166072 100755 --- a/update/templates/rm_images.sh +++ b/update/templates/rm_images.sh @@ -1,4 +1,12 @@ #!/bin/bash +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## number=`docker images | awk 'NR != 1' | grep testapi | wc -l` if [ $number -gt 0 ]; then diff --git a/update/templates/rm_olds.sh b/update/templates/rm_olds.sh index c6bca18..6724c33 100644 --- a/update/templates/rm_olds.sh +++ b/update/templates/rm_olds.sh @@ -1,4 +1,12 @@ #!/bin/bash +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## proc_number=`ps -ef | grep opnfv-testapi | grep -v grep | wc -l` if [ $proc_number -gt 0 ]; then diff --git a/update/test.yml b/update/test.yml index 943105c..24cb7be 100644 --- a/update/test.yml +++ b/update/test.yml @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + --- - hosts: "{{ host }}" remote_user: "{{ user }}" diff --git a/update/update.yml b/update/update.yml index 18b75b6..3a2ce91 100644 --- a/update/update.yml +++ b/update/update.yml @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2019 opnfv. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + --- - hosts: "{{ host }}" remote_user: "{{ user }}" |