Bugfix: pass/not pass filter not work in result-report page 63/48763/2
authorgrakiss <grakiss.wanglei@huawei.com>
Wed, 13 Dec 2017 01:15:39 +0000 (01:15 +0000)
committerLeo wang <grakiss.wanglei@huawei.com>
Mon, 18 Dec 2017 03:43:11 +0000 (03:43 +0000)
The reason is there are some conflict with jquery.js and ng-model.
So ng-model not work.

Change-Id: I01ccd0e297d1a89aff8f78d7fb0a63a0e2114f63
Signed-off-by: grakiss <grakiss.wanglei@huawei.com>
cvp/3rd_party/static/testapi-ui/assets/css/combine.css
cvp/3rd_party/static/testapi-ui/components/results-report/partials/reportDetails.html
cvp/3rd_party/static/testapi-ui/components/results-report/resultsReportController.js
cvp/opnfv_testapi/resources/test_handlers.py

index b2f16c9..a6395e7 100644 (file)
@@ -816,7 +816,7 @@ h5 {
   margin-bottom: 0; }
 
 a, a:visited {
-  color: #30739C; }
+  color: #27CCC0; }
 
 .lead {
   font-size: 18px;
index 7dc4396..b552ea4 100644 (file)
@@ -6,15 +6,15 @@ report page.
 Test Filters:<br />
 <div class="btn-toolbar" role="toolbar">
     <div class="btn-group button-margin" data-toggle="buttons">
-        <label class="btn btn-default" ng-class="{'active': ctrl.testStatus === 'total'}">
+        <label class="btn btn-default" ng-click="ctrl.changeStatus('total')" ng-class="{'active': ctrl.testStatus === 'total'}">
             <input type="radio" ng-model="ctrl.testStatus" value="total">
             <span class="text-primary">All</span>
         </label>
-        <label class="btn btn-default" ng-class="{'active': ctrl.testStatus === 'passed'}">
+        <label class="btn btn-default" ng-click="ctrl.changeStatus('passed')" ng-class="{'active': ctrl.testStatus === 'passed'}">
             <input type="radio" ng-model="ctrl.testStatus" value="passed">
             <span class="text-success">Passed</span>
         </label>
-        <label class="btn btn-default" ng-class="{'active': ctrl.testStatus === 'not passed'}">
+        <label class="btn btn-default" ng-click="ctrl.changeStatus('not passed')" ng-class="{'active': ctrl.testStatus === 'not passed'}">
             <input type="radio" ng-model="ctrl.testStatus" value="not passed">
             <span class="text-danger">Not Passed</span>
         </label>
index 0260938..b0061f6 100644 (file)
@@ -47,6 +47,7 @@
         ctrl.openAll = openAll;
         ctrl.folderAll = folderAll;
         ctrl.gotoResultLog = gotoResultLog;
+        ctrl.changeStatus = changeStatus;
 
         /** The testID extracted from the URL route. */
         ctrl.testId = $stateParams.testID;
 
         $scope.load_finish = false;
 
+        function changeStatus(value){
+            ctrl.testStatus = value;
+        }
+
         function extend(case_list) {
             angular.forEach(case_list, function(ele){
                 ctrl.case_list.push(ele);
index 161585e..2b5f28c 100644 (file)
@@ -221,7 +221,14 @@ class TestsGURHandler(GenericTestHandler):
                 query['owner'] = curr_user
                 db_keys.append('owner')
 
-                test_query = {'id': test['id'], 'status': 'review'}
+                test_query = {
+                    'id': test['id'],
+                    '$or': [
+                        {'status': 'review'},
+                        {'status': 'approved'},
+                        {'status': 'not approved'}
+                    ]
+                }
                 record = yield dbapi.db_find_one("tests", test_query)
                 if record:
                     msg = ('{} has already submitted one record with the same '