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 | |
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
12 files changed, 13 insertions, 36 deletions
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/bubbleChart.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/bubbleChart.html.erb index d3dd9d7d3f1..e0188194dd2 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/bubbleChart.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/bubbleChart.html.erb @@ -72,7 +72,7 @@ .components(data.components) .height(<%= chartHeight -%>) .options({ - baseUrl: baseUrl + '/dashboard/index/', + baseUrl: baseUrl + '/dashboard/index', xLog: <%= xLog -%>, yLog: <%= yLog -%>, noData: '<%= message('no_data') -%>', diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_bubble_chart.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_bubble_chart.html.erb index dfb2fba1b93..c5a23025495 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_bubble_chart.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_bubble_chart.html.erb @@ -49,7 +49,7 @@ .metricsPriority(metrics) .height(<%= chartHeight -%>) .options({ - baseUrl: baseUrl + '/dashboard/index/', + baseUrl: baseUrl + '/dashboard/index', xLog: <%= xLog -%>, yLog: <%= yLog -%>, noData: '<%= message('no_data') -%>', 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 bada1681bd4..c45bb01cfcc 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 @@ -43,7 +43,7 @@ .metricsPriority(metrics) .options({ maxItemsReachedMessage: '<%= message("widget.measure_filter_histogram.max_items_reached", :params => [maxItems]) -%>', - baseUrl: baseUrl + '/dashboard/index/', + baseUrl: baseUrl + '/dashboard/index', noData: '<%= message('no_data') -%>' }) .render('#<%= containerId -%>'); diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_histogram.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_histogram.html.erb index 0c4d8caf692..98842071f46 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_histogram.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_histogram.html.erb @@ -43,7 +43,7 @@ .source(baseUrl + '/measures/search_filter?' + query) .metricsPriority(metrics) .options({ - baseUrl: baseUrl + '/dashboard/index/', + baseUrl: baseUrl + '/dashboard/index', relativeScale: <%= relativeScale -%>, maxItemsReachedMessage: '<%= message("widget.measure_filter_histogram.max_items_reached", :params => [maxItems]) -%>', noData: '<%= message('no_data') -%>', diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_pie_chart.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_pie_chart.html.erb index ca7af9c3d18..c011ede3f1d 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_pie_chart.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_pie_chart.html.erb @@ -47,7 +47,7 @@ .metricsPriority(metrics) .height(<%= chartHeight %>) .options({ - baseUrl: baseUrl + '/dashboard/index/', + baseUrl: baseUrl + '/dashboard/index', noData: '<%= message('no_data') -%>', noMainMetric: '<%= message('widget.measure_filter.no_main_metric') -%>' }) diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_treemap.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_treemap.html.erb index 1d843dd911b..48c08f864f2 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_treemap.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_treemap.html.erb @@ -50,7 +50,7 @@ heightInPercents: '<%= widget_properties['heightInPercents'] -%>', maxItems: <%= maxItems -%>, maxItemsReachedMessage: '<%= message("widget.measure_filter_histogram.max_items_reached", :params => [maxItems]) -%>', - baseUrl: baseUrl + '/dashboard/index/', + baseUrl: baseUrl + '/dashboard/index', noData: '<%= message('no_data') -%>', resource: '<%= filter.name -%>' }) diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/treemap.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/treemap.html.erb index ed1c68fb0a4..f6a1fbc2b6b 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/treemap.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/treemap.html.erb @@ -71,7 +71,7 @@ heightInPercents: '<%= widget_properties['heightInPercents'] -%>', maxItems: <%= maxItems -%>, maxItemsReachedMessage: '<%= message("widget.measure_filter_histogram.max_items_reached", :params => [maxItems]) -%>', - baseUrl: baseUrl + '/dashboard/index/', + baseUrl: baseUrl + '/dashboard/index', noData: '<%= message('no_data') -%>', resource: '<%= @resource.name -%>' }) 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 |