]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5385 Some widget links are broken when apache is configured with AllowEncodedSl...
authorStas Vilchik <vilchiks@gmail.com>
Wed, 18 Feb 2015 16:19:20 +0000 (17:19 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Wed, 18 Feb 2015 16:19:27 +0000 (17:19 +0100)
12 files changed:
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/bubbleChart.html.erb
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_bubble_chart.html.erb
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_cloud.html.erb
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_histogram.html.erb
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_pie_chart.html.erb
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measures/measure_filter_treemap.html.erb
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/treemap.html.erb
server/sonar-web/src/main/coffee/widgets/histogram.coffee
server/sonar-web/src/main/coffee/widgets/treemap.coffee
server/sonar-web/src/main/coffee/widgets/word-cloud.coffee
server/sonar-web/src/main/js/widgets/bubble-chart.js
server/sonar-web/src/main/js/widgets/pie-chart.js

index d3dd9d7d3f17c7fca054c19f01a69451179159cb..e0188194dd2ccb9524fdfb1d8c325bbfc3af9122 100644 (file)
@@ -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') -%>',
index dfb2fba1b938ec88ad37b79b76a5826bc58ecd78..c5a2302549521d3ab65fb85ba865b6e7bf4bf694 100644 (file)
@@ -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') -%>',
index bada1681bd45eec564b03ac414e9eda4ef32493a..c45bb01cfcc0bc13f2232eec6c51ddc1726a99ec 100644 (file)
@@ -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 -%>');
index 0c4d8caf692d6206d9322dc7671568f13ef2ee4e..98842071f4677b6077593e0d3c661f8cc7855b3c 100644 (file)
@@ -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') -%>',
index ca7af9c3d184c8b36545df4d20424e623b9fdc7f..c011ede3f1dbfaa6c3f894374a9131b2215fcf71 100644 (file)
@@ -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') -%>'
       })
index 1d843dd911b9f78ed2eb11fb6d95d723607bd551..48c08f864f2fff2acb127dd387bc4596d3425205 100644 (file)
@@ -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 -%>'
         })
index ed1c68fb0a4435bfcc1d8a14514a303a2175cd67..f6a1fbc2b6b28ead43fe7954ab5b35b4421e8f11 100644 (file)
@@ -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 -%>'
       })
index 2dacc0b73bc91a51eb8907b07f69566482a6171a..7729b2589f80be92fa351afa4dc6f019175b4d88 100644 (file)
@@ -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
index f929f8d24b9868f2c1611461f9fd4525911b0e56..82eed791e84dcfc4f3911f06077c253be5a1d7f2 100644 (file)
@@ -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
 
index 725ba62775fe736eae7f71621fdabd2326440559..a3888c46dfaaff99b98ba398dbf233aa4187767b 100644 (file)
@@ -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) =>
index 8ccf8435cef8ccc1035f76685c5a41eaae4a2a22..1b148797bd40d876d81932289d77dfb72749cbdf 100644 (file)
@@ -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')
index fd4838d4a45601c57b64870925e5139395f14cc6..9c0288f1413b37cd122d228fc3706073c2eefedd 100644 (file)
@@ -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