]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8972 Limit the input length when creating custom metrics
authorStas Vilchik <stas.vilchik@sonarsource.com>
Wed, 11 Oct 2017 15:47:58 +0000 (17:47 +0200)
committerStas Vilchik <stas.vilchik@sonarsource.com>
Thu, 12 Oct 2017 08:23:25 +0000 (10:23 +0200)
server/sonar-web/src/main/js/apps/custom-measures/templates/custom-measures-form.hbs
server/sonar-web/src/main/js/apps/metrics/templates/metrics-form.hbs
server/sonar-web/src/main/js/apps/metrics/templates/metrics-list-item.hbs

index 884cad7e08dfa0cdd1440857df44901444bf007d..48f42005b6d6409c33eb92783e92888677799dca 100644 (file)
@@ -32,7 +32,7 @@
   </div>
   <div class="modal-foot">
     <button id="create-custom-measure-submit" {{#unless canCreateMetric}}disabled{{/unless}}>
-      {{#if id}}{{t 'update_verb'}}{{else}}{{t 'create_verb'}}{{/if}}
+      {{#if id}}{{t 'update_verb'}}{{else}}{{t 'create'}}{{/if}}
     </button>
     <a href="#" class="js-modal-close" id="create-custom-measure-cancel">{{t 'cancel'}}</a>
   </div>
index 55c9c9d4936fd2fe540ab500b904841a15d4b24e..638c96f654d528475d90ca9fe0b096b5dfe31fab 100644 (file)
@@ -6,15 +6,15 @@
     <div class="js-modal-messages"></div>
     <div class="modal-field">
       <label for="create-metric-key">{{t 'key'}}<em class="mandatory">*</em></label>
-      <input id="create-metric-key" name="key" type="text" maxlength="200" required value="{{key}}">
+      <input id="create-metric-key" name="key" type="text" maxlength="64" required value="{{key}}">
     </div>
     <div class="modal-field">
       <label for="create-metric-name">{{t 'name'}}<em class="mandatory">*</em></label>
-      <input id="create-metric-name" name="name" type="text" maxlength="200" required value="{{name}}">
+      <input id="create-metric-name" name="name" type="text" maxlength="64" required value="{{name}}">
     </div>
     <div class="modal-field">
       <label for="create-metric-description">{{t 'description'}}</label>
-      <textarea id="create-metric-description" name="description">{{description}}</textarea>
+      <textarea id="create-metric-description" maxlength="255" name="description">{{description}}</textarea>
     </div>
     <div class="modal-field">
       <label for="create-metric-domain">{{t 'custom_metrics.domain'}}</label>
index cb25af27f9436c632972fbb8434986465302cdb0..4f696e1d4914fff567058539f2d14ff8fb10a0fd 100644 (file)
@@ -5,19 +5,19 @@
 
 <div class="display-inline-block text-top width-30">
   <div>
-    <strong class="js-metric-name">{{name}}</strong>
-    <span class="js-metric-key note little-spacer-left">{{key}}</span>
+    <strong class="js-metric-name text-limited">{{name}}</strong>
+    <span class="js-metric-key note little-spacer-left text-limited">{{key}}</span>
   </div>
 </div>
 
-<div class="display-inline-block text-top width-20">
+<div class="display-inline-block text-top width-20 text-ellipsis">
   <span class="js-metric-domain">{{this.domain}}</span>
 </div>
 
-<div class="display-inline-block text-top width-20">
+<div class="display-inline-block text-top width-20 text-ellipsis">
   <span class="js-metric-type">{{t 'metric.type' type}}</span>
 </div>
 
-<div class="display-inline-block text-top width-20">
+<div class="display-inline-block text-top width-20 text-ellipsis" title="{{description}}">
   <span class="js-metric-description">{{description}}</span>
 </div>