]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5092 Change message on default quality gate when user is not quality admin
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Mon, 17 Mar 2014 17:31:20 +0000 (18:31 +0100)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Mon, 17 Mar 2014 17:32:27 +0000 (18:32 +0100)
plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
sonar-server/src/main/java/org/sonar/server/qualitygate/ws/QgateAppHandler.java
sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_projects_template.hbs.erb
sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-projects-view.coffee
sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-projects-view.js
sonar-server/src/test/java/org/sonar/server/qualitygate/ws/QgateAppHandlerTest.java

index ca4b6133421d3e1905844fe8531fc853a500a75d..c7f831e44def608d9e76440ef593f0ceae4e3c8c 100644 (file)
@@ -1658,7 +1658,8 @@ quality_gates.add_condition=Add Condition
 quality_gates.no_conditions=No Conditions
 quality_gates.introduction=Only project measures are checked against thresholds. Modules, packages and classes are ignored.
 quality_gates.health_icons=Project health icons represent:
-quality_gates.projects_for_default=You must not select specific projects for the default quality gate.
+quality_gates.projects_for_default=Every project not specifically associated to a quality gate will be associated to this one by default.
+quality_gates.projects_for_default.edit=You must not select specific projects for the default quality gate.
 quality_gates.projects.with=With
 quality_gates.projects.without=Without
 quality_gates.projects.all=All
index bf69138d4c1b27bd1013bfc62cb242ec411e202d..294dea34686a7b12da7c97796d8f15c9fa9152b3 100644 (file)
@@ -69,6 +69,7 @@ public class QgateAppHandler implements RequestHandler {
       "quality_gates.projects.with",
       "quality_gates.projects.without",
       "quality_gates.projects_for_default",
+      "quality_gates.projects_for_default.edit",
       "quality_gates.rename",
       "rename",
       "save",
index 9f107237684aececd3761fb12870d1d281fa8ef3..22487657e3b80744f1bc6dea4fb8d8aea92efd23 100644 (file)
@@ -2,7 +2,11 @@
   <div class="quality-gate-section-name">{{t 'quality_gates.projects'}}</div>
 
   {{#if default}}
-    <p>{{t 'quality_gates.projects_for_default'}}</p>
+    {{#if canEdit}}
+      <p>{{t 'quality_gates.projects_for_default.edit'}}</p>
+    {{else}}
+      <p>{{t 'quality_gates.projects_for_default'}}</p>
+    {{/if}}
   {{else}}
     <div id="select-list-projects"></div>
   {{/if}}
index 70fbe8f261e08f9aef49308b93185de19f3c07ff..b496d311a378e6e08b5b8ddb30f1c7feece14fde 100644 (file)
@@ -33,3 +33,6 @@ define [
           tooltips:
             select: t('quality_gates.projects.select_hint')
             deselect: t('quality_gates.projects.deselect_hint')
+
+    serializeData: ->
+      _.extend super, canEdit: @options.app.canEdit
index 3c647112f037e63fe82fbd733bca0284e841eb4a..3651f6fb735ef2e186a20b68c645cc1db464cfe9 100644 (file)
         }
       };
 
+      QualityGateDetailProjectsView.prototype.serializeData = function() {
+        return _.extend(QualityGateDetailProjectsView.__super__.serializeData.apply(this, arguments), {
+          canEdit: this.options.app.canEdit
+        });
+      };
+
       return QualityGateDetailProjectsView;
 
     })(Marionette.ItemView);
index 814c973b9130a27dcadc86a97f61ce53265a7373..40b55c17c7995ea139ea0d2480fb02ee738a1e8e 100644 (file)
@@ -89,7 +89,7 @@ public class QgateAppHandlerTest {
     Collection<Map> periods = (Collection<Map>) responseJson.get("periods");
     assertThat(periods).hasSize(3);
     Map messages = (Map) responseJson.get("messages");
-    assertThat(messages).isNotNull().isNotEmpty().hasSize(46);
+    assertThat(messages).isNotNull().isNotEmpty().hasSize(47);
     for (Entry message: (Set<Entry>) messages.entrySet()) {
       assertThat(message.getKey()).isEqualTo(message.getValue());
     }