From d383aa2db56e889c1dfbc0608483cad96f508f52 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 16 May 2016 12:31:59 +0200 Subject: [PATCH] SONAR-6336 display warning only for saved conditions --- .../src/main/js/apps/quality-gates/components/Conditions.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.js b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.js index 50f0244c683..b6cc569c4de 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/Conditions.js @@ -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) { -- 2.39.5