From a07bc7aba255248f46008fead55f0d295f80ec7d Mon Sep 17 00:00:00 2001 From: thuva4 Date: Sat, 31 Mar 2018 11:03:13 +0530 Subject: Remove dplicate code in testcase page Change-Id: I6269fc1b18a9912819c2c936d2e5c040edb2603f Signed-off-by: thuva4 --- .../project/testCases/testCase/testCase.html | 70 ++-------------------- .../testCases/testCase/testCaseController.js | 6 +- 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 @@
- - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
Id :{{ctrl.data._id}}
{{detail | capitalize}} :{{ctrl.data[index]}}
Name :{{ctrl.data.name}}
Project :{{ctrl.data.project_name}}
Creator :{{ctrl.data.creator}}
Tier :{{ctrl.data.tier}}
Blocking :{{ctrl.data.blocking}}
CI Loop :{{ctrl.data.ci_loop}}
Tags :{{ctrl.data.tags}}
Version :{{ctrl.data.version}}
Created at :{{ctrl.data['creation_date']}}
Dependencies :{{ctrl.data.dependencies}}
Trust :{{ctrl.data.trust}}
Criteria :{{ctrl.data.criteria}}
Catalog Description :{{ctrl.data.catalog_description}}
URL :{{ctrl.data.url}}
Run :{{ctrl.data.run}}
Description :{{ctrl.data.description}}
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; -- cgit 1.2.3-korg