diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-02-18 17:19:20 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-02-18 17:19:27 +0100 |
commit | 235184a87be82354763647e4bfb8e170925b2732 (patch) | |
tree | 280b956ff167782df5167441ddd37bc1c4843691 /server/sonar-web/src/main | |
parent | 87d444ab3bf860db5d39843d689ff9d330c18384 (diff) | |
download | sonarqube-235184a87be82354763647e4bfb8e170925b2732.tar.gz sonarqube-235184a87be82354763647e4bfb8e170925b2732.zip |
SONAR-5385 Some widget links are broken when apache is configured with AllowEncodedSlashes On
Diffstat (limited to 'server/sonar-web/src/main')
5 files changed, 6 insertions, 29 deletions
diff --git a/server/sonar-web/src/main/coffee/widgets/histogram.coffee b/server/sonar-web/src/main/coffee/widgets/histogram.coffee index 2dacc0b73bc..7729b2589f8 100644 --- a/server/sonar-web/src/main/coffee/widgets/histogram.coffee +++ b/server/sonar-web/src/main/coffee/widgets/histogram.coffee @@ -121,10 +121,7 @@ class Histogram extends window.SonarWidgets.BaseWidget .attr 'transform', (d) => @trans @legendWidth() + @x(@mainMetric.value d) + 5, @barHeight @bars.exit().remove() @bars.on 'click', (d) => - url = @options().baseUrl + encodeURIComponent d.key - if d.qualifier == 'CLA' || d.qualifier == 'FIL' - url += '?metric=' + encodeURIComponent @mainMetric.key - window.location = url + window.location = @options().baseUrl + '?id=' + encodeURIComponent(d.key) @metricLabel.attr 'transform', @trans @legendWidth(), 0 @@ -139,4 +136,4 @@ window.SonarWidgets.Histogram = Histogram window.SonarWidgets.Histogram.defaults = height: 300 margin: { top: 4, right: 50, bottom: 4, left: 10 } - legendWidth: 220
\ No newline at end of file + legendWidth: 220 diff --git a/server/sonar-web/src/main/coffee/widgets/treemap.coffee b/server/sonar-web/src/main/coffee/widgets/treemap.coffee index f929f8d24b9..82eed791e84 100644 --- a/server/sonar-web/src/main/coffee/widgets/treemap.coffee +++ b/server/sonar-web/src/main/coffee/widgets/treemap.coffee @@ -41,9 +41,7 @@ class Treemap extends window.SonarWidgets.BaseWidget @cellsLink = @box.selectAll('.treemap-link').data nodes @cellsLink.html '<i class="icon-link"></i>' @cellsLink.attr 'href', (d) => - url = @options().baseUrl + encodeURIComponent(d.key) - url += '?metric=' + encodeURIComponent(@colorMetric.key) if d.qualifier == 'CLA' || d.qualifier == 'FIL' - url + @options().baseUrl + '?id=' + encodeURIComponent(d.key) @attachEvents cellsEnter diff --git a/server/sonar-web/src/main/coffee/widgets/word-cloud.coffee b/server/sonar-web/src/main/coffee/widgets/word-cloud.coffee index 725ba62775f..a3888c46dfa 100644 --- a/server/sonar-web/src/main/coffee/widgets/word-cloud.coffee +++ b/server/sonar-web/src/main/coffee/widgets/word-cloud.coffee @@ -16,9 +16,7 @@ class WordCloud extends window.SonarWidgets.BaseWidget wordsEnter = words.enter().append('a').classed 'cloud-word', true wordsEnter.text (d) -> d.name wordsEnter.attr 'href', (d) => - url = @options().baseUrl + encodeURIComponent(d.key) - url += '?metric=' + encodeURIComponent(@colorMetric.key) if d.qualifier == 'CLA' || d.qualifier == 'FIL' - url + @options().baseUrl + '?id=' + encodeURIComponent(d.key) wordsEnter.attr 'title', (d) => @tooltip d words.style 'color', (d) => diff --git a/server/sonar-web/src/main/js/widgets/bubble-chart.js b/server/sonar-web/src/main/js/widgets/bubble-chart.js index 8ccf8435cef..1b148797bd4 100644 --- a/server/sonar-web/src/main/js/widgets/bubble-chart.js +++ b/server/sonar-web/src/main/js/widgets/bubble-chart.js @@ -198,15 +198,7 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets; // Set event listeners this.items .on('click', function (d) { - switch (d.qualifier) { - case 'CLA': - case 'FIL': - window.location = widget.options().baseUrl + encodeURIComponent(d.key) + - '?metric=' + encodeURIComponent(widget.sizeMetric); - break; - default: - window.location = widget.options().baseUrl + encodeURIComponent(d.key); - } + window.location = widget.options().baseUrl + '?id=' + encodeURIComponent(d.key); }) .on('mouseenter', function (d) { d3.select(this).select('circle') diff --git a/server/sonar-web/src/main/js/widgets/pie-chart.js b/server/sonar-web/src/main/js/widgets/pie-chart.js index fd4838d4a45..9c0288f1413 100644 --- a/server/sonar-web/src/main/js/widgets/pie-chart.js +++ b/server/sonar-web/src/main/js/widgets/pie-chart.js @@ -330,15 +330,7 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets; }, clickHandler = function(d) { - switch (d.qualifier) { - case 'CLA': - case 'FIL': - window.location = widget.options().baseUrl + encodeURIComponent(d.key) + - '?metric=' + encodeURIComponent(widget.mainMetric); - break; - default: - window.location = widget.options().baseUrl + encodeURIComponent(d.key); - } + window.location = widget.options().baseUrl + '?id=' + encodeURIComponent(d.key); }; this.sectors |