diff options
Diffstat (limited to 'testapi/opnfv_testapi/ui/components')
4 files changed, 18 insertions, 34 deletions
diff --git a/testapi/opnfv_testapi/ui/components/results/result/result.html b/testapi/opnfv_testapi/ui/components/results/result/result.html index b435dce..52d794e 100644 --- a/testapi/opnfv_testapi/ui/components/results/result/result.html +++ b/testapi/opnfv_testapi/ui/components/results/result/result.html @@ -48,28 +48,6 @@ <td width="90%" class="podsTableLeftTd">{{ctrl.data.stop_date}}</td> </tr> <tr style="padding:9px"> - <td class="podsTableTd">Trust Indicator :</td> - <td width="90%" class="podsTableLeftTd"> - <a ng-click="ctrl.showTrustIndicator()"> - <p ng-if="ctrl.trust_indicator">Hide</p> - <p ng-if="!ctrl.trust_indicator">Show</p> - </a> - <table class="table" ng-class="{'hidden' : !ctrl.trust_indicator}" style="margin:10px"> - <tbody> - <tr style="padding:9px"></tr> - <tr style="padding:9px" > - <td class="podsTableTd">Current :</td> - <td width="90%" class="podsTableLeftTd">{{ctrl.data.trust_indicator.current}}</td> - </tr> - <tr style="padding:9px" > - <td class="podsTableTd">Histories :</td> - <td width="90%" class="podsTableLeftTd">{{ctrl.data.trust_indicator.histories}}</td> - </tr> - </tbody> - </table> - </td> - </tr> - <tr style="padding:9px"> <td class="podsTableTd">Details :</td> <td width="90%" class="podsTableLeftTd"> <a ng-click="ctrl.showDetails()"> diff --git a/testapi/opnfv_testapi/ui/components/results/result/resultController.js b/testapi/opnfv_testapi/ui/components/results/result/resultController.js index 028e5d8..cb5dd28 100644 --- a/testapi/opnfv_testapi/ui/components/results/result/resultController.js +++ b/testapi/opnfv_testapi/ui/components/results/result/resultController.js @@ -54,14 +54,6 @@ }); } - function showTrustIndicator(){ - if(ctrl.trust_indicator){ - ctrl.trust_indicator = false - }else{ - ctrl.trust_indicator = true - } - } - function showDetails(){ if(ctrl.details){ ctrl.details = false diff --git a/testapi/opnfv_testapi/ui/components/scenarios/scenarios.html b/testapi/opnfv_testapi/ui/components/scenarios/scenarios.html index 9057b0f..bde946c 100644 --- a/testapi/opnfv_testapi/ui/components/scenarios/scenarios.html +++ b/testapi/opnfv_testapi/ui/components/scenarios/scenarios.html @@ -27,7 +27,14 @@ <tr style=" text-align: center;"> <th style="width: 1%;">Bulk Select</th> - <th style="width: 80%;">Name</th> + <th style="width: 80%;">Name + <a class="text-danger" ng-click="ctrl.sortBy()" ng-class="{ 'hidden': ctrl.sortName }" > + <span class="glyphicon glyphicon-sort-by-alphabet pull-right" aria-hidden="true"></span> + </a> + <a class="text-danger" ng-click="ctrl.sortBy()" ng-class="{ 'hidden': !ctrl.sortName}" > + <span class="glyphicon glyphicon-sort-by-alphabet-alt pull-right" aria-hidden="true"></span> + </a> + </th> <th style="width: 19%;" ng-class="{'hidden': !auth.isAuthenticated}">Operations</th> </tr> </thead> diff --git a/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js b/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js index 98e4089..240287c 100644 --- a/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js +++ b/testapi/opnfv_testapi/ui/components/scenarios/scenariosController.js @@ -21,7 +21,7 @@ ScenariosController.$inject = [ '$scope', '$http', '$filter', '$state', '$window', '$uibModal', 'testapiApiUrl', - 'raiseAlert', 'confirmModal' + 'raiseAlert', 'confirmModal', 'sortService' ]; /** @@ -30,7 +30,7 @@ * through projects declared in TestAPI. */ function ScenariosController($scope, $http, $filter, $state, $window, $uibModal, testapiApiUrl, - raiseAlert, confirmModal) { + raiseAlert, confirmModal, sortService) { var ctrl = this; ctrl.url = testapiApiUrl + '/scenarios'; @@ -44,8 +44,9 @@ ctrl.deleteScenario = deleteScenario; ctrl.openBatchDeleteModal = openBatchDeleteModal; ctrl.deleteBatchScenario = deleteBatchScenario - + ctrl.sortBy = sortBy ctrl.checkBox = []; + ctrl.sortName = false function openUpdateModal(name){ $uibModal.open({ @@ -68,6 +69,11 @@ confirmModal("Delete", 'scenarios', ctrl.deleteScenario,name); } + function sortBy(){ + ctrl.data.scenarios = sortService.sortFunction(ctrl.data.scenarios, 'name' , ctrl.sortName) + ctrl.sortName=!ctrl.sortName + } + function deleteScenario(name){ var scenarioURL = ctrl.url+"/"+name; ctrl.scenarioRequest = @@ -142,6 +148,7 @@ ctrl.resultsRequest = $http.get(ctrl.url).success(function (data) { ctrl.data = data; + ctrl.sortBy() }).catch(function (data) { ctrl.data = null; ctrl.showError = true; |