]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4366 Rework rename/copy modal
authorStas Vilchik <vilchiks@gmail.com>
Fri, 21 Mar 2014 12:59:59 +0000 (18:59 +0600)
committerStas Vilchik <vilchiks@gmail.com>
Fri, 21 Mar 2014 13:00:12 +0000 (19:00 +0600)
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/js/templates/quality-gates.js
sonar-server/src/main/webapp/templates/quality-gates/quality-gate-edit.hbs

index 2ab11ccf802b785b081cc61e1f27067cbb8fe27f..6ba967a3998bcabcac2d0772d939bf8b73fbada8 100644 (file)
@@ -1559,7 +1559,7 @@ quality_profiles.copy_new_name=New name
 #------------------------------------------------------------------------------
 
 quality_gates.noQualityGates=No Quality Gates
-quality_gates.add=Create Quality Gate
+quality_gates.create=Create Quality Gate
 quality_gates.rename=Rename Quality Gate:
 quality_gates.copy=Copy Quality Gate:
 quality_gates.conditions=Conditions
index 47f39e88dbd938bee73c27ccf7c74a1783f760f2..5faf20aa64c58e8233d8f1db07dc5dcd3c58c9ed 100644 (file)
@@ -48,10 +48,10 @@ public class QgateAppHandler implements RequestHandler {
       "delete",
       "more",
       "name",
-      "quality_gates.add",
       "quality_gates.add_condition",
       "quality_gates.conditions",
       "quality_gates.copy",
+      "quality_gates.create",
       "quality_gates.health_icons",
       "quality_gates.introduction",
       "quality_gates.no_conditions",
index bfb6744a21859a29c6ca2fb035a46610df4b0739..2ba729006af1605500a3feaab988d77d75ba1677 100644 (file)
@@ -410,41 +410,6 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
 
 function program1(depth0,data) {
   
-  var buffer = "", stack1, helper, options;
-  buffer += "<h2>"
-    + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "quality_gates.rename", options) : helperMissing.call(depth0, "t", "quality_gates.rename", options)))
-    + " ";
-  if (helper = helpers.name) { stack1 = helper.call(depth0, {hash:{},data:data}); }
-  else { helper = (depth0 && depth0.name); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
-  buffer += escapeExpression(stack1)
-    + "</h2>";
-  return buffer;
-  }
-
-function program3(depth0,data) {
-  
-  var buffer = "", stack1, helper, options;
-  buffer += "<h2>"
-    + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "quality_gates.copy", options) : helperMissing.call(depth0, "t", "quality_gates.copy", options)))
-    + " ";
-  if (helper = helpers.name) { stack1 = helper.call(depth0, {hash:{},data:data}); }
-  else { helper = (depth0 && depth0.name); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
-  buffer += escapeExpression(stack1)
-    + "</h2>";
-  return buffer;
-  }
-
-function program5(depth0,data) {
-  
-  var buffer = "", helper, options;
-  buffer += "<h2>"
-    + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "quality_gates.add", options) : helperMissing.call(depth0, "t", "quality_gates.add", options)))
-    + "</h2>";
-  return buffer;
-  }
-
-function program7(depth0,data) {
-  
   var buffer = "", helper, options;
   buffer += "<button>"
     + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "save", options) : helperMissing.call(depth0, "t", "save", options)))
@@ -452,7 +417,7 @@ function program7(depth0,data) {
   return buffer;
   }
 
-function program9(depth0,data) {
+function program3(depth0,data) {
   
   var buffer = "", helper, options;
   buffer += "<button>"
@@ -461,7 +426,7 @@ function program9(depth0,data) {
   return buffer;
   }
 
-function program11(depth0,data) {
+function program5(depth0,data) {
   
   var buffer = "", helper, options;
   buffer += "<button>"
@@ -470,7 +435,15 @@ function program11(depth0,data) {
   return buffer;
   }
 
-  buffer += "<form>\n  <div class=\"modal-head\">\n    ";
+  buffer += "<form>\n  <div class=\"modal-head\">\n    <h2>"
+    + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "quality_gates", (depth0 && depth0.method), options) : helperMissing.call(depth0, "t", "quality_gates", (depth0 && depth0.method), options)))
+    + "</h2>\n  </div>\n\n  <div class=\"modal-body\">\n    <div class=\"modal-error\"></div>\n    <div class=\"modal-field\">\n      <label for=\"quality-gate-edit-name\">"
+    + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "name", options) : helperMissing.call(depth0, "t", "name", options)))
+    + " <em class=\"mandatory\">*</em></label>\n      <input id=\"quality-gate-edit-name\" type=\"text\" size=\"50\" maxlength=\"100\" value=\"";
+  if (helper = helpers.name) { stack1 = helper.call(depth0, {hash:{},data:data}); }
+  else { helper = (depth0 && depth0.name); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; }
+  buffer += escapeExpression(stack1)
+    + "\">\n    </div>\n  </div>\n\n  <div class=\"modal-foot\">\n    ";
   stack1 = (helper = helpers.eq || (depth0 && depth0.eq),options={hash:{},inverse:self.noop,fn:self.program(1, program1, data),data:data},helper ? helper.call(depth0, (depth0 && depth0.method), "rename", options) : helperMissing.call(depth0, "eq", (depth0 && depth0.method), "rename", options));
   if(stack1 || stack1 === 0) { buffer += stack1; }
   buffer += "\n    ";
@@ -479,17 +452,6 @@ function program11(depth0,data) {
   buffer += "\n    ";
   stack1 = (helper = helpers.eq || (depth0 && depth0.eq),options={hash:{},inverse:self.noop,fn:self.program(5, program5, data),data:data},helper ? helper.call(depth0, (depth0 && depth0.method), "create", options) : helperMissing.call(depth0, "eq", (depth0 && depth0.method), "create", options));
   if(stack1 || stack1 === 0) { buffer += stack1; }
-  buffer += "\n  </div>\n\n  <div class=\"modal-body\">\n    <div class=\"modal-error\"></div>\n    <div class=\"modal-field\">\n      <label for=\"quality-gate-edit-name\">"
-    + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "name", options) : helperMissing.call(depth0, "t", "name", options)))
-    + " <em class=\"mandatory\">*</em></label>\n      <input id=\"quality-gate-edit-name\" type=\"text\" size=\"50\" maxlength=\"100\">\n    </div>\n  </div>\n\n  <div class=\"modal-foot\">\n    ";
-  stack1 = (helper = helpers.eq || (depth0 && depth0.eq),options={hash:{},inverse:self.noop,fn:self.program(7, program7, data),data:data},helper ? helper.call(depth0, (depth0 && depth0.method), "rename", options) : helperMissing.call(depth0, "eq", (depth0 && depth0.method), "rename", options));
-  if(stack1 || stack1 === 0) { buffer += stack1; }
-  buffer += "\n    ";
-  stack1 = (helper = helpers.eq || (depth0 && depth0.eq),options={hash:{},inverse:self.noop,fn:self.program(9, program9, data),data:data},helper ? helper.call(depth0, (depth0 && depth0.method), "copy", options) : helperMissing.call(depth0, "eq", (depth0 && depth0.method), "copy", options));
-  if(stack1 || stack1 === 0) { buffer += stack1; }
-  buffer += "\n    ";
-  stack1 = (helper = helpers.eq || (depth0 && depth0.eq),options={hash:{},inverse:self.noop,fn:self.program(11, program11, data),data:data},helper ? helper.call(depth0, (depth0 && depth0.method), "create", options) : helperMissing.call(depth0, "eq", (depth0 && depth0.method), "create", options));
-  if(stack1 || stack1 === 0) { buffer += stack1; }
   buffer += "\n    <a id=\"quality-gate-cancel-create\" class=\"action\">"
     + escapeExpression((helper = helpers.t || (depth0 && depth0.t),options={hash:{},data:data},helper ? helper.call(depth0, "cancel", options) : helperMissing.call(depth0, "t", "cancel", options)))
     + "</a>\n  </div>\n</form>";
index 658b9326cbfeb6972c3bad006262e891302bfb6c..6c190b6d242ccd3e7b0b0a47a86c63403a3feb22 100644 (file)
@@ -1,15 +1,13 @@
 <form>
   <div class="modal-head">
-    {{#eq method "rename"}}<h2>{{t 'quality_gates.rename'}} {{name}}</h2>{{/eq}}
-    {{#eq method "copy"}}<h2>{{t 'quality_gates.copy'}} {{name}}</h2>{{/eq}}
-    {{#eq method "create"}}<h2>{{t 'quality_gates.add'}}</h2>{{/eq}}
+    <h2>{{t 'quality_gates' method }}</h2>
   </div>
 
   <div class="modal-body">
     <div class="modal-error"></div>
     <div class="modal-field">
       <label for="quality-gate-edit-name">{{t 'name'}} <em class="mandatory">*</em></label>
-      <input id="quality-gate-edit-name" type="text" size="50" maxlength="100">
+      <input id="quality-gate-edit-name" type="text" size="50" maxlength="100" value="{{name}}">
     </div>
   </div>