aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2011-08-24 15:50:32 +0200
committerFabrice Bellingard <bellingard@gmail.com>2011-08-24 15:50:32 +0200
commit8a4f61072115d5c57098ae43d13dc4bba1292250 (patch)
tree74ec1fe30c4ea306e2d9750f07e45fe15e39a22a /plugins
parent88195bbe5d8864fbb3ddd6d62718206075be6f4b (diff)
downloadsonarqube-8a4f61072115d5c57098ae43d13dc4bba1292250.tar.gz
sonarqube-8a4f61072115d5c57098ae43d13dc4bba1292250.zip
SONAR-2074 Select 'ncloc' by default for 1rst display
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb
index 274eeda8f2e..ad44fbac17a 100644
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb
+++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/timeline.html.erb
@@ -9,6 +9,12 @@
metric_name_map[metric.id] = message('metric.' + metric.name + '.name')
end
end
+ if metric_data_map.empty?
+ # No metric has been selected, it's the first time the widget is displayed: 'ncloc' is the default metric
+ ncloc = Metric.find(:all, :conditions => "name = 'ncloc'").first
+ metric_data_map[ncloc.id] = []
+ metric_name_map[ncloc.id] = message('metric.ncloc.name')
+ end
# Retrieve metric trend information
options = {}