aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2014-03-20 15:04:26 +0600
committerStas Vilchik <vilchiks@gmail.com>2014-03-20 15:04:26 +0600
commit6a14ae614f65a775e9c88ce74e435127134f6aa7 (patch)
tree66e4c5770da9e874fa5347edfe0878ebf8f26c37 /sonar-server
parent068fd7df4105aecfcd0c092c27fc173bd25c0ae8 (diff)
downloadsonarqube-6a14ae614f65a775e9c88ce74e435127134f6aa7.tar.gz
sonarqube-6a14ae614f65a775e9c88ce74e435127134f6aa7.zip
SONAR-5083 SONAR-5112 Add placeholder for WORK_DUR and RATING fields
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_condition_template.hbs.erb4
-rw-r--r--sonar-server/src/main/webapp/javascripts/navigator/filters/metric-filters.js8
-rw-r--r--sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-condition-view.coffee4
-rw-r--r--sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-condition-view.js9
4 files changed, 23 insertions, 2 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_condition_template.hbs.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_condition_template.hbs.erb
index 7ca50016040..3a4b2a5821c 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_condition_template.hbs.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/quality_gates/templates/_quality_gate_detail_condition_template.hbs.erb
@@ -28,7 +28,7 @@
<td width="15%" nowrap="nowrap">
<i class="icon-alert-warn" title="{{t 'alerts.warning_tooltip'}}"></i>
{{#if canEdit}}
- <input name="warning" class="measure-input" data-type="{{metric.type}}" type="text">
+ <input name="warning" class="measure-input" data-type="{{metric.type}}" placeholder="{{metric.placeholder}}" type="text">
{{else}}
{{warning}}
{{/if}}
@@ -36,7 +36,7 @@
<td width="15%" nowrap="nowrap">
<i class="icon-alert-error" title="{{t 'alerts.error_tooltip'}}"></i>
{{#if canEdit}}
- <input name="error" class="measure-input" data-type="{{metric.type}}" type="text">
+ <input name="error" class="measure-input" data-type="{{metric.type}}" placeholder="{{metric.placeholder}}" type="text">
{{else}}
{{error}}
{{/if}}
diff --git a/sonar-server/src/main/webapp/javascripts/navigator/filters/metric-filters.js b/sonar-server/src/main/webapp/javascripts/navigator/filters/metric-filters.js
index b97c557654f..f680d0e06e1 100644
--- a/sonar-server/src/main/webapp/javascripts/navigator/filters/metric-filters.js
+++ b/sonar-server/src/main/webapp/javascripts/navigator/filters/metric-filters.js
@@ -31,6 +31,14 @@ define(['navigator/filters/base-filters', 'common/handlebars-extensions'], funct
});
if (metric) {
this.$('[name=val]').data('type', metric.metric.val_type);
+ switch (metric.metric.val_type) {
+ case 'WORK_DUR':
+ this.$('[name=val]').prop('placeholder', '1d 7h 59min');
+ break;
+ case 'RATING':
+ this.$('[name=val]').prop('placeholder', 'A');
+ break;
+ }
}
},
diff --git a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-condition-view.coffee b/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-condition-view.coffee
index 4ca7cdc15b8..50992789af0 100644
--- a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-condition-view.coffee
+++ b/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-condition-view.coffee
@@ -41,6 +41,10 @@ define [
populateMetric: ->
metricKey = @model.get('metric')
metric = _.findWhere @options.app.metrics, key: metricKey
+ if metric?
+ switch metric.type
+ when 'WORK_DUR' then metric.placeholder = '1d 7h 59min'
+ when 'RATING' then metric.placeholder = 'A'
@model.set { metric: metric }, { silent: true }
@model.set { isDiffMetric: metric.key.indexOf('new_') == 0 }, { silent: true }
diff --git a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-condition-view.js b/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-condition-view.js
index f1f741f7e19..fba38b1ca8f 100644
--- a/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-condition-view.js
+++ b/sonar-server/src/main/webapp/javascripts/quality-gate/views/quality-gate-detail-condition-view.js
@@ -51,6 +51,15 @@
metric = _.findWhere(this.options.app.metrics, {
key: metricKey
});
+ if (metric != null) {
+ switch (metric.type) {
+ case 'WORK_DUR':
+ metric.placeholder = '1d 7h 59min';
+ break;
+ case 'RATING':
+ metric.placeholder = 'A';
+ }
+ }
this.model.set({
metric: metric
}, {