Merge "Change to 'catalog_description' in Catalogue page"
authorMorgan Richomme <morgan.richomme@orange.com>
Tue, 6 Jun 2017 13:16:02 +0000 (13:16 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Tue, 6 Jun 2017 13:16:02 +0000 (13:16 +0000)
utils/test/reporting/api/api/handlers/testcases.py
utils/test/reporting/pages/app/images/overview.png
utils/test/reporting/pages/app/scripts/controllers/testvisual.controller.js
utils/test/reporting/pages/app/styles/custome.css
utils/test/reporting/pages/app/views/commons/testCaseVisual.html
utils/test/reporting/pages/app/views/modal/testcasedetail.html

index 110ac4c..2b91186 100644 (file)
@@ -20,7 +20,7 @@ class TestCases(BaseHandler):
 
         url = '{}/projects/{}/cases'.format(conf.base_url, project)
         cases = requests.get(url).json().get('testcases', [])
-        data = [t['name'] for t in cases]
+        data = [{t['name']: t['catalog_description']} for t in cases]
         self.write(json_encode(data))
 
 
index 14dbbff..f1688cf 100644 (file)
Binary files a/utils/test/reporting/pages/app/images/overview.png and b/utils/test/reporting/pages/app/images/overview.png differ
index 7082aed..def8e72 100644 (file)
 angular.module('opnfvApp')
     .controller('testVisualController', ['$scope', '$state', '$stateParams', 'TableFactory', 'ngDialog', '$http', '$loading',
         function($scope, $state, $stateParams, TableFactory, ngDialog, $http, $loading) {
-            $scope.dovet = "59,222,156,317";
-            $scope.functest = "203,163,334,365";
-            $scope.yardstick = "398,161,513,384";
-            $scope.vsperf = "567,163,673,350";
-            $scope.stor = "686,165,789,341";
-            $scope.qtip = "802,164,905,341";
-            $scope.bootleneck = "917,161,1022,338";
-            $scope.noPopArea1 = "30,11,1243,146";
-            $scope.noPopArea2 = "1041,157,1250,561";
-            $scope.noPopArea3 = "15,392,1027,561";
+            $scope.dovet = "50,168,177,443";
+            $scope.functest = "194,173,356,442";
+            $scope.yardstick = "377,183,521,412";
+            $scope.vsperf = "542,185,640,414";
+            $scope.stor = "658,187,750,410";
+            $scope.qtip = "769,190,852,416";
+            $scope.bootleneck = "870,192,983,419";
+            $scope.noPopArea1 = "26,8,1190,180";
+            $scope.noPopArea2 = "1018,193,1190,590";
+            $scope.noPopArea3 = "37,455,1003,584";
 
             init();
             $scope.showSelectValue = 0;
@@ -51,20 +51,41 @@ angular.module('opnfvApp')
                 $http.get(url, config).then(function(response) {
                     if (response.status == 200) {
                         $scope.tableData = response.data;
+
+                        $scope.tableData = constructObjectArray($scope.tableData);
+                        console.log($scope.tableData);
                         $loading.finish('Key');
 
 
+
                     }
                 })
             }
 
+            //construct key value for tableData
+            function constructObjectArray(array) {
+                var templateArray = [];
+                for (var i = 0; i < array.length; i++) {
+                    var key = Object.keys(array[i])[0];
+                    var value = array[i][key];
+                    var temp = {
+                        'key': key,
+                        'value': value
+                    };
+                    templateArray.push(temp);
+
+                }
+
+                return templateArray;
+            }
+
             function getDetail(casename) {
                 TableFactory.getProjectTestCaseDetail().get({
                     'project': $scope.modalName,
                     'testcase': casename
                 }).$promise.then(function(response) {
                     if (response != null) {
-                        $scope.project_name_modal = response.project_name;
+                        $scope.name_modal = response.name;
                         $scope.description_modal = response.description;
                         openTestDetail();
                     }
@@ -108,4 +129,4 @@ angular.module('opnfvApp')
 
 
         }
-    ]);
\ No newline at end of file
+    ]);
index 7ab869b..8e567ca 100644 (file)
@@ -71,6 +71,7 @@ html {
     border-radius: 5px 5px 5px 5px;
     background-color: #f3f3f4;
     opacity: 0.9;
+    width: 200px;
 }
 
 .ngdialog.ngdialog.ngdialog-theme-default .ngdialog-content {
index 9d146ba..74eb56e 100644 (file)
@@ -4,7 +4,7 @@
 <div class="row">
 
 
-    <div class="row  border-bottom white-bg dashboard-header" style="border-radius: 5px 5px 5px 5px ">
+    <div class="row  border-bottom white-bg dashboard-header" style="border-radius: 5px 5px 5px 5px;width:90%;margin-left:30px; ">
 
         <h3>OPNFV Test ecosystem
             <small> *mouse over display test case list</small>
@@ -70,7 +70,7 @@
     </div>
 
 
-    <div id="popup" class="popup" style="width: 20%;height: 35%" dw-loading="Key">
+    <div id="popup" class="popup" style="width: 40%;height: 35%" dw-loading="Key">
 
         <div ng-show="tableData.length==0">
             <center>
@@ -90,7 +90,8 @@
 
                 <tbody>
                     <tr dir-paginate="data in tableData | itemsPerPage: 8  track by $index ">
-                        <td><a ng-click="getDetail(data)"> {{data}}</a></td>
+                        <td ng-if="data.value!=null"><a ng-click="getDetail(data.key)"> {{data.value}}</a></td>
+                        <td ng-if="data.value==null"><a ng-click="getDetail(data.key)"> null</a></td>
                         <tr>
 
                 </tbody>
index 8918b3f..db6f712 100644 (file)
@@ -2,6 +2,6 @@
 <div class="hr-line-dashed"></div>
 
 
-<strong> name</strong>: {{project_name_modal}}<br>
+<strong> name</strong>: {{name_modal}}<br>
 
-<strong>description</strong>: {{description_modal}}<br>
\ No newline at end of file
+<strong>description</strong>: {{description_modal}}<br>