diff options
author | Serena Feng <feng.xiaowei@zte.com.cn> | 2018-04-04 06:59:51 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-04-04 06:59:51 +0000 |
commit | 3c6a30724cfa535404a00028307ee2dc708b528e (patch) | |
tree | dd39ffcaeb4c53250d9322d3e471130c797b67ab | |
parent | 383d4b9e465766b3cfbc1b00fdd62f7980212d6e (diff) | |
parent | a07bc7aba255248f46008fead55f0d295f80ec7d (diff) |
Merge "Remove dplicate code in testcase page"
2 files changed, 8 insertions, 68 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 index f4bae41..509f39a 100644 --- a/testapi/opnfv_testapi/ui/components/projects/project/testCases/testCase/testCase.html +++ b/testapi/opnfv_testapi/ui/components/projects/project/testCases/testCase/testCase.html @@ -3,73 +3,11 @@ <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 ng-repeat-start="(index, detail) in ctrl.data_field" style="padding:9px"> + <td class="podsTableTd" >{{detail | capitalize}} :</td> + <td width="86%" class="podsTableLeftTd">{{ctrl.data[index]}}</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">Creator :</td> - <td width="90%" class="podsTableLeftTd">{{ctrl.data.creator}}</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 ng-repeat-end=> </tr> </tbody> </table> 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 index a38b633..6f93fc1 100644 --- a/testapi/opnfv_testapi/ui/components/projects/project/testCases/testCase/testCaseController.js +++ b/testapi/opnfv_testapi/ui/components/projects/project/testCases/testCase/testCaseController.js @@ -21,7 +21,7 @@ TestCaseController.$inject = [ '$scope', '$http', '$filter', '$state', '$window', '$uibModal', 'testapiApiUrl','raiseAlert', - 'confirmModal' + 'confirmModal', 'dataFieldService' ]; /** @@ -30,13 +30,14 @@ * through projects declared in TestAPI. */ function TestCaseController($scope, $http, $filter, $state, $window, $uibModal, testapiApiUrl, - raiseAlert, confirmModal) { + raiseAlert, confirmModal, dataFieldService) { 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; + ctrl.data_field = {} /** * This will contact the TestAPI to get a listing of declared projects. @@ -46,6 +47,7 @@ ctrl.projectsRequest = $http.get(ctrl.url).success(function (data) { ctrl.data = data; + ctrl.data_field = dataFieldService.dataFunction(ctrl.data, ctrl.data_field) }).catch(function (error) { ctrl.data = null; ctrl.showError = true; |