aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2014-04-07 17:03:59 +0600
committerStas Vilchik <vilchiks@gmail.com>2014-04-07 17:04:08 +0600
commit3a1dc469ddb0f0e14952b931a70f4213bec4f8c3 (patch)
tree5e9b29aa31b3cac89d052dbbbd802c3e529d9066
parentf03d90c5d72b1f258d1a4ceb594b261a1204cbf7 (diff)
downloadsonarqube-3a1dc469ddb0f0e14952b931a70f4213bec4f8c3.tar.gz
sonarqube-3a1dc469ddb0f0e14952b931a70f4213bec4f8c3.zip
SONAR-3113 Add links to dashboards
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_cloud.html.erb1
-rw-r--r--sonar-server/src/main/coffee/widgets/word-cloud.coffee17
-rw-r--r--sonar-server/src/main/less/style.less3
3 files changed, 19 insertions, 2 deletions
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_cloud.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_cloud.html.erb
index 48988ee7a4c..4e8a9440fc0 100644
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_cloud.html.erb
+++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_cloud.html.erb
@@ -42,6 +42,7 @@
.source(baseUrl + '/measures/search_filter?' + query)
.metricsPriority(metrics)
.options({
+ reverseColor: <%= reverseColor -%>,
baseUrl: baseUrl + '/dashboard/index/',
noData: '<%= message('no_data') -%>'
})
diff --git a/sonar-server/src/main/coffee/widgets/word-cloud.coffee b/sonar-server/src/main/coffee/widgets/word-cloud.coffee
index 8a942a1440a..39560337ca7 100644
--- a/sonar-server/src/main/coffee/widgets/word-cloud.coffee
+++ b/sonar-server/src/main/coffee/widgets/word-cloud.coffee
@@ -49,7 +49,11 @@ window.SonarWidgets.WordCloud.prototype.render = (container) ->
@getSizeMetric = (d) => d.measures[@sizeMetric].val
# Configure scales
- @color = d3.scale.linear().domain([0, 100]).range(['#d62728', '#1f77b4'])
+ @color = d3.scale.linear().domain([0, 100])
+ if @options().reverseColor
+ @color.range(['#1f77b4', '#d62728'])
+ else
+ @color.range(['#d62728', '#1f77b4'])
sizeDomain = d3.extent @components(), (d) => @getSizeMetric d
@size = d3.scale.linear().domain(sizeDomain).range([10, 24])
@@ -60,9 +64,18 @@ window.SonarWidgets.WordCloud.prototype.render = (container) ->
window.SonarWidgets.WordCloud.prototype.update = ->
# Configure words
@words = @box.selectAll('a').data @components()
- @words.enter().append('a').classed('cloud-word', true).text (d) -> d.name
+
+ wordsEnter = @words.enter().append('a')
+ wordsEnter.classed 'cloud-word', true
+ wordsEnter.text (d) -> d.name
+ wordsEnter.attr 'href', (d) =>
+ url = @options().baseUrl + encodeURIComponent(d.key)
+ url += '?metric=' + encodeURIComponent(@colorMetric) if d.qualifier == 'CLA' || d.qualifier == 'FIL'
+ url
+
@words.style 'color', (d) => @color @getColorMetric d
@words.style 'font-size', (d) => "#{@size @getSizeMetric d}px"
+
@words.exit().remove()
diff --git a/sonar-server/src/main/less/style.less b/sonar-server/src/main/less/style.less
index 9e50e752215..e1fb7171e3b 100644
--- a/sonar-server/src/main/less/style.less
+++ b/sonar-server/src/main/less/style.less
@@ -2756,6 +2756,9 @@ div.rule-title {
vertical-align: baseline;
white-space: nowrap;
margin-right: 14px;
+ text-decoration: none;
+
+ &:hover { text-decoration: underline; }
}
/* ------------------- Admin pages ------------------- */