diff options
author | thuva4 <tharma.thuva@gmail.com> | 2018-03-31 11:03:13 +0530 |
---|---|---|
committer | thuva4 <tharma.thuva@gmail.com> | 2018-03-31 11:03:13 +0530 |
commit | a07bc7aba255248f46008fead55f0d295f80ec7d (patch) | |
tree | 47d7846425b843917a93700c02267def8be9b8e8 /testapi/opnfv_testapi/ui/components | |
parent | 8d6380265299c36f6356c746460baa0cfd2ad4e1 (diff) |
Remove dplicate code in testcase page
Change-Id: I6269fc1b18a9912819c2c936d2e5c040edb2603f
Signed-off-by: thuva4 <tharma.thuva@gmail.com>
Diffstat (limited to 'testapi/opnfv_testapi/ui/components')
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; |