diff options
author | Serena Feng <feng.xiaowei@zte.com.cn> | 2018-04-04 07:01:43 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-04-04 07:01:43 +0000 |
commit | ee78e8f964d7929af27f09449e7aee16a1150648 (patch) | |
tree | b189aad5f2fc1b3ece3bb5cce9593e1e9383f251 /testapi/opnfv_testapi | |
parent | 3c6a30724cfa535404a00028307ee2dc708b528e (diff) | |
parent | 17f2ea5a1e2ddf6eb0d4221eed314270ac2bd34f (diff) |
Merge "Remove duplicate code in result page"
Diffstat (limited to 'testapi/opnfv_testapi')
-rw-r--r-- | testapi/opnfv_testapi/ui/components/results/result/result.html | 46 | ||||
-rw-r--r-- | testapi/opnfv_testapi/ui/components/results/result/resultController.js | 7 |
2 files changed, 9 insertions, 44 deletions
diff --git a/testapi/opnfv_testapi/ui/components/results/result/result.html b/testapi/opnfv_testapi/ui/components/results/result/result.html index e6b30a9..041f244 100644 --- a/testapi/opnfv_testapi/ui/components/results/result/result.html +++ b/testapi/opnfv_testapi/ui/components/results/result/result.html @@ -3,49 +3,11 @@ <div class="table-responsive"> <table class="table" ng-data="ctrl.data.pods"> <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">Pod Name:</td> - <td width="90%" class="podsTableLeftTd">{{ctrl.data.pod_name}}</td> - </tr> - <tr style="padding:9px"> - <td class="podsTableTd">Project Name:</td> - <td width="90%" class="podsTableLeftTd">{{ctrl.data.project_name}}</td> - </tr> - <tr style="padding:9px"> - <td class="podsTableTd">Case Name :</td> - <td width="90%" class="podsTableLeftTd">{{ctrl.data.case_name}}</td> - </tr> - <tr style="padding:9px"> - <td class="podsTableTd">Installer :</td> - <td width="90%" class="podsTableLeftTd">{{ctrl.data.installer}}</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">Scenario :</td> - <td width="90%" class="podsTableLeftTd">{{ctrl.data.scenario}}</td> - </tr> - <tr style="padding:9px"> - <td class="podsTableTd">Build tag :</td> - <td width="90%" class="podsTableLeftTd">{{ctrl.data['build_tag']}}</td> + <tr ng-repeat-start="(index, detail) in ctrl.data_field" style="padding:9px"> + <td class="podsTableTd">{{detail | capitalize}} :</td> + <td width="90%" class="podsTableLeftTd">{{ctrl.data[index]}}</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">Start Date:</td> - <td width="90%" class="podsTableLeftTd">{{ctrl.data.start_date}}</td> - </tr> - <tr style="padding:9px"> - <td class="podsTableTd">Stop Date :</td> - <td width="90%" class="podsTableLeftTd">{{ctrl.data.stop_date}}</td> + <tr ng-repeat-end=> </tr> <tr style="padding:9px"> <td class="podsTableTd">Details :</td> diff --git a/testapi/opnfv_testapi/ui/components/results/result/resultController.js b/testapi/opnfv_testapi/ui/components/results/result/resultController.js index d297b43..2726704 100644 --- a/testapi/opnfv_testapi/ui/components/results/result/resultController.js +++ b/testapi/opnfv_testapi/ui/components/results/result/resultController.js @@ -21,7 +21,7 @@ ResultController.$inject = [ '$scope', '$http', '$filter', '$state', '$window', '$uibModal', 'testapiApiUrl','raiseAlert', - 'confirmModal' + 'confirmModal', 'dataFieldService' ]; /** @@ -30,11 +30,12 @@ * through result declared in TestAPI. */ function ResultController($scope, $http, $filter, $state, $window, $uibModal, testapiApiUrl, - raiseAlert, confirmModal) { + raiseAlert, confirmModal, dataFieldService) { var ctrl = this; ctrl.url = testapiApiUrl + '/results'; ctrl._id = $state.params['_id']; ctrl.loadDetails = loadDetails + ctrl.data_field = {} ctrl.json = {}; ctrl.json.string = '{"id": ""}'; @@ -51,6 +52,8 @@ ctrl.data = data; ctrl.object=JSON.stringify(ctrl.data.details) ctrl.json.object = JSON.parse(ctrl.object) + delete ctrl.data.details; + ctrl.data_field = dataFieldService.dataFunction(ctrl.data, ctrl.data_field) }).catch(function (error) { ctrl.data = null; ctrl.showError = true; |