]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6336 display warning only for saved conditions
authorStas Vilchik <vilchiks@gmail.com>
Mon, 16 May 2016 10:31:59 +0000 (12:31 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 16 May 2016 10:32:08 +0000 (12:32 +0200)
server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.js

index 50f0244c683b1ae0906694965861a80952331b1f..b6cc569c4de3c53a160b9c8076b75a3ff39e7a78 100644 (file)
@@ -73,8 +73,9 @@ export default class Conditions extends React.Component {
     });
 
     const duplicates = [];
-    conditions.forEach(condition => {
-      const sameCount = conditions
+    const savedConditions = conditions.filter(condition => condition.id != null);
+    savedConditions.forEach(condition => {
+      const sameCount = savedConditions
           .filter(sample => sample.metric === condition.metric && sample.period === condition.period)
           .length;
       if (sameCount > 1) {