diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2011-08-24 15:50:32 +0200 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2011-08-24 15:50:32 +0200 |
commit | 8a4f61072115d5c57098ae43d13dc4bba1292250 (patch) | |
tree | 74ec1fe30c4ea306e2d9750f07e45fe15e39a22a /plugins | |
parent | 88195bbe5d8864fbb3ddd6d62718206075be6f4b (diff) | |
download | sonarqube-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.erb | 6 |
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 = {} |