summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/ui/components/results/result/resultController.js
diff options
context:
space:
mode:
Diffstat (limited to 'testapi/opnfv_testapi/ui/components/results/result/resultController.js')
-rw-r--r--testapi/opnfv_testapi/ui/components/results/result/resultController.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/testapi/opnfv_testapi/ui/components/results/result/resultController.js b/testapi/opnfv_testapi/ui/components/results/result/resultController.js
index cb5dd28..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,13 +30,16 @@
* 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.showTrustIndicator = showTrustIndicator
- ctrl.showDetails = showDetails
+ ctrl.data_field = {}
+
+ ctrl.json = {};
+ ctrl.json.string = '{"id": ""}';
+ ctrl.json.object = JSON.parse(ctrl.json.string);
/**
*Contact the testapi and retrevie the result details
@@ -47,6 +50,10 @@
ctrl.podsRequest =
$http.get(resultUrl).success(function (data) {
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;
@@ -54,13 +61,6 @@
});
}
- function showDetails(){
- if(ctrl.details){
- ctrl.details = false
- }else{
- ctrl.details = true
- }
- }
ctrl.loadDetails();
}
})(); \ No newline at end of file