diff options
Diffstat (limited to 'testapi/opnfv_testapi/ui/components/projects/project/testCases/testCase')
2 files changed, 137 insertions, 0 deletions
diff --git a/testapi/opnfv_testapi/ui/components/projects/project/testCases/testCase/testCase.html b/testapi/opnfv_testapi/ui/components/projects/project/testCases/testCase/testCase.html new file mode 100644 index 0000000..70c026a --- /dev/null +++ b/testapi/opnfv_testapi/ui/components/projects/project/testCases/testCase/testCase.html @@ -0,0 +1,80 @@ +<legend>Test Case</legend> +<div style="padding-right:0px"> + <div class="table-responsive"> + <table class="table" ng-data="ctrl.data"> + <tbody> + <tr style="padding:9px"> + <td class="podsTableTd">Id :</td> + <td class="podsTableLeftTd">{{ctrl.data._id}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Name :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.name}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Project :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.project_name}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Tier :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.tier}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Blocking :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.blocking}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">CI Loop :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.ci_loop}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Tags :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.tags}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Version :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.version}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Created at :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data['creation_date']}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Dependencies :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.dependencies}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Trust :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.trust}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Criteria :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.criteria}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Catalog Description :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.catalog_description}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">URL :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.url}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Run :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.run}}</td> + </tr> + <tr style="padding:9px"> + <td class="podsTableTd">Description :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data.description}}</td> + </tr> + </tbody> + </table> + </div> +</div> +<div class="row" style="margin-bottom:24px;"></div> +<div ng-show="ctrl.showError" class="alert alert-danger col-md-8" role="alert" style="margin-top:0px"> + <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> + <span class="sr-only">Error:</span> + {{ctrl.error}} +</div> +<div class="row" style="margin-bottom:24px;"></div>
\ No newline at end of file diff --git a/testapi/opnfv_testapi/ui/components/projects/project/testCases/testCase/testCaseController.js b/testapi/opnfv_testapi/ui/components/projects/project/testCases/testCase/testCaseController.js new file mode 100644 index 0000000..a38b633 --- /dev/null +++ b/testapi/opnfv_testapi/ui/components/projects/project/testCases/testCase/testCaseController.js @@ -0,0 +1,57 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +(function () { + 'use strict'; + + angular + .module('testapiApp') + .controller('TestCaseController', TestCaseController); + + TestCaseController.$inject = [ + '$scope', '$http', '$filter', '$state', '$window', '$uibModal', 'testapiApiUrl','raiseAlert', + 'confirmModal' + ]; + + /** + * TestAPI Project Controller + * This controller is for the '/projects' page where a user can browse + * through projects declared in TestAPI. + */ + function TestCaseController($scope, $http, $filter, $state, $window, $uibModal, testapiApiUrl, + raiseAlert, confirmModal) { + var ctrl = this; + ctrl.name = $state.params['name']; + ctrl.projectName = $state.params['project_name']; + ctrl.url = testapiApiUrl + '/projects/' + ctrl.projectName + "/cases/" + ctrl.name; + + ctrl.loadDetails = loadDetails; + + /** + * This will contact the TestAPI to get a listing of declared projects. + */ + function loadDetails() { + ctrl.showError = false; + ctrl.projectsRequest = + $http.get(ctrl.url).success(function (data) { + ctrl.data = data; + }).catch(function (error) { + ctrl.data = null; + ctrl.showError = true; + ctrl.error = error.statusText + }); + } + ctrl.loadDetails(); + } +})(); |