]> source.dussan.org Git - sonarqube.git/commitdiff
fix bug which prevents to add a quality gate condition for "new_" metric
authorStas Vilchik <vilchiks@gmail.com>
Mon, 11 Apr 2016 13:31:25 +0000 (15:31 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 11 Apr 2016 13:31:25 +0000 (15:31 +0200)
server/sonar-web/src/main/js/apps/quality-gates/components/Condition.js

index 550b89054990143c3cebb3da5ed14dab075008da..ad60d332bd268ce66342ba1fa0154d3a6c0a4218 100644 (file)
@@ -73,6 +73,10 @@ export default class Condition extends Component {
       data.period = period;
     }
 
+    if (condition.metric.indexOf('new_') === 0) {
+      data.period = '1';
+    }
+
     e.preventDefault();
     createCondition(qualityGate.id, data).then(newCondition => {
       this.setState({ changed: false });