From 17f2ea5a1e2ddf6eb0d4221eed314270ac2bd34f Mon Sep 17 00:00:00 2001 From: thuva4 Date: Sat, 31 Mar 2018 11:04:27 +0530 Subject: Remove duplicate code in result page Change-Id: I07d818e56aa393d4bddabb232d090bc911dd1996 Signed-off-by: thuva4 --- .../ui/components/results/result/result.html | 46 ++-------------------- .../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 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - + 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; -- cgit 1.2.3-korg
Id :{{ctrl.data._id}}
Pod Name:{{ctrl.data.pod_name}}
Project Name:{{ctrl.data.project_name}}
Case Name :{{ctrl.data.case_name}}
Installer :{{ctrl.data.installer}}
Version :{{ctrl.data.version}}
Scenario :{{ctrl.data.scenario}}
Build tag :{{ctrl.data['build_tag']}}
{{detail | capitalize}} :{{ctrl.data[index]}}
Criteria :{{ctrl.data.criteria}}
Start Date:{{ctrl.data.start_date}}
Stop Date :{{ctrl.data.stop_date}}
Details :