]> source.dussan.org Git - sonarqube.git/commitdiff
fix quality gate link for new_maintainability_rating
authorStas Vilchik <vilchiks@gmail.com>
Tue, 9 May 2017 14:24:48 +0000 (16:24 +0200)
committerStas Vilchik <stas-vilchik@users.noreply.github.com>
Wed, 10 May 2017 07:40:15 +0000 (09:40 +0200)
server/sonar-web/src/main/js/apps/overview/qualityGate/QualityGateCondition.js
server/sonar-web/src/main/js/apps/overview/qualityGate/__tests__/QualityGateCondition-test.js
server/sonar-web/src/main/js/apps/overview/qualityGate/__tests__/__snapshots__/QualityGateCondition-test.js.snap

index 132c49a88e907870512cd9afc6cfd4f061de2a6f..1c0d73f31cb47bcef0c1b98849094bada45d5650 100644 (file)
@@ -104,7 +104,7 @@ export default class QualityGateCondition extends React.PureComponent {
       security_rating: ['VULNERABILITY', false],
       new_security_rating: ['VULNERABILITY', true],
       sqale_rating: ['CODE_SMELL', false],
-      new_sqale_rating: ['CODE_SMELL', true]
+      new_maintainability_rating: ['CODE_SMELL', true]
     };
 
     return RATING_METRICS_MAPPING[metricKey]
index e07cc20c666f097d823becc16de135e531d8a2e4..1b711f7c60c0c56f946ab8b1afc19535ebb1c199 100644 (file)
@@ -122,8 +122,8 @@ it('new_security_rating', () => {
   ).toMatchSnapshot();
 });
 
-it('new_sqale_rating', () => {
-  const condition = mockRatingCondition('new_sqale_rating');
+it('new_maintainability_rating', () => {
+  const condition = mockRatingCondition('new_maintainability_rating');
   condition.period = 1;
   condition.measure.periods = periods;
   expect(
index 7a70e96aa6d59b16ee8f5c8cc04b9fd16aae9c3e..b392a10f2244eb3d2c63e812b36ac3800af706aa 100644 (file)
@@ -1,11 +1,21 @@
 // Jest Snapshot v1, https://goo.gl/fbAQLP
 
-exports[`new_open_issues 1`] = `
-<DrilldownLink
+exports[`new_maintainability_rating 1`] = `
+<Link
   className="overview-quality-gate-condition overview-quality-gate-condition-error overview-quality-gate-condition-leak"
-  component="abcd-key"
-  metric="new_open_issues"
-  sinceLeakPeriod={true}
+  onlyActiveOnIndex={false}
+  style={Object {}}
+  to={
+    Object {
+      "pathname": "/project/issues",
+      "query": Object {
+        "id": "abcd-key",
+        "resolved": "false",
+        "sinceLeakPeriod": "true",
+        "types": "CODE_SMELL",
+      },
+    }
+  }
 >
   <div
     className="overview-quality-gate-condition-container"
@@ -16,15 +26,15 @@ exports[`new_open_issues 1`] = `
       <Measure
         measure={
           Object {
-            "leak": "10",
-            "value": "10",
+            "leak": "3",
+            "value": "3",
           }
         }
         metric={
           Object {
-            "key": "new_open_issues",
-            "name": "new_open_issues",
-            "type": "INT",
+            "key": "new_maintainability_rating",
+            "name": "new_maintainability_rating",
+            "type": "RATING",
           }
         }
       />
@@ -35,39 +45,28 @@ exports[`new_open_issues 1`] = `
       >
         <IssueTypeIcon
           className="little-spacer-right"
-          query="new_open_issues"
+          query="new_maintainability_rating"
         />
-        new_open_issues
+        new_maintainability_rating
       </div>
       <div
         className="overview-quality-gate-threshold"
       >
-        quality_gates.operator.GT
+        quality_gates.operator.GT.rating
          
-        0
+        A
       </div>
     </div>
   </div>
-</DrilldownLink>
+</Link>
 `;
 
-exports[`new_reliability_rating 1`] = `
-<Link
+exports[`new_open_issues 1`] = `
+<DrilldownLink
   className="overview-quality-gate-condition overview-quality-gate-condition-error overview-quality-gate-condition-leak"
-  onlyActiveOnIndex={false}
-  style={Object {}}
-  to={
-    Object {
-      "pathname": "/project/issues",
-      "query": Object {
-        "id": "abcd-key",
-        "resolved": "false",
-        "severities": "BLOCKER,CRITICAL,MAJOR,MINOR",
-        "sinceLeakPeriod": "true",
-        "types": "BUG",
-      },
-    }
-  }
+  component="abcd-key"
+  metric="new_open_issues"
+  sinceLeakPeriod={true}
 >
   <div
     className="overview-quality-gate-condition-container"
@@ -78,15 +77,15 @@ exports[`new_reliability_rating 1`] = `
       <Measure
         measure={
           Object {
-            "leak": "3",
-            "value": "3",
+            "leak": "10",
+            "value": "10",
           }
         }
         metric={
           Object {
-            "key": "new_reliability_rating",
-            "name": "new_reliability_rating",
-            "type": "RATING",
+            "key": "new_open_issues",
+            "name": "new_open_issues",
+            "type": "INT",
           }
         }
       />
@@ -97,23 +96,23 @@ exports[`new_reliability_rating 1`] = `
       >
         <IssueTypeIcon
           className="little-spacer-right"
-          query="new_reliability_rating"
+          query="new_open_issues"
         />
-        new_reliability_rating
+        new_open_issues
       </div>
       <div
         className="overview-quality-gate-threshold"
       >
-        quality_gates.operator.GT.rating
+        quality_gates.operator.GT
          
-        A
+        0
       </div>
     </div>
   </div>
-</Link>
+</DrilldownLink>
 `;
 
-exports[`new_security_rating 1`] = `
+exports[`new_reliability_rating 1`] = `
 <Link
   className="overview-quality-gate-condition overview-quality-gate-condition-error overview-quality-gate-condition-leak"
   onlyActiveOnIndex={false}
@@ -126,7 +125,7 @@ exports[`new_security_rating 1`] = `
         "resolved": "false",
         "severities": "BLOCKER,CRITICAL,MAJOR,MINOR",
         "sinceLeakPeriod": "true",
-        "types": "VULNERABILITY",
+        "types": "BUG",
       },
     }
   }
@@ -146,8 +145,8 @@ exports[`new_security_rating 1`] = `
         }
         metric={
           Object {
-            "key": "new_security_rating",
-            "name": "new_security_rating",
+            "key": "new_reliability_rating",
+            "name": "new_reliability_rating",
             "type": "RATING",
           }
         }
@@ -159,9 +158,9 @@ exports[`new_security_rating 1`] = `
       >
         <IssueTypeIcon
           className="little-spacer-right"
-          query="new_security_rating"
+          query="new_reliability_rating"
         />
-        new_security_rating
+        new_reliability_rating
       </div>
       <div
         className="overview-quality-gate-threshold"
@@ -175,7 +174,7 @@ exports[`new_security_rating 1`] = `
 </Link>
 `;
 
-exports[`new_sqale_rating 1`] = `
+exports[`new_security_rating 1`] = `
 <Link
   className="overview-quality-gate-condition overview-quality-gate-condition-error overview-quality-gate-condition-leak"
   onlyActiveOnIndex={false}
@@ -186,8 +185,9 @@ exports[`new_sqale_rating 1`] = `
       "query": Object {
         "id": "abcd-key",
         "resolved": "false",
+        "severities": "BLOCKER,CRITICAL,MAJOR,MINOR",
         "sinceLeakPeriod": "true",
-        "types": "CODE_SMELL",
+        "types": "VULNERABILITY",
       },
     }
   }
@@ -207,8 +207,8 @@ exports[`new_sqale_rating 1`] = `
         }
         metric={
           Object {
-            "key": "new_sqale_rating",
-            "name": "new_sqale_rating",
+            "key": "new_security_rating",
+            "name": "new_security_rating",
             "type": "RATING",
           }
         }
@@ -220,9 +220,9 @@ exports[`new_sqale_rating 1`] = `
       >
         <IssueTypeIcon
           className="little-spacer-right"
-          query="new_sqale_rating"
+          query="new_security_rating"
         />
-        new_sqale_rating
+        new_security_rating
       </div>
       <div
         className="overview-quality-gate-threshold"