]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7402 clicking on project bubble brings to the project page
authorStas Vilchik <vilchiks@gmail.com>
Mon, 11 Apr 2016 13:27:55 +0000 (15:27 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 11 Apr 2016 13:27:55 +0000 (15:27 +0200)
server/sonar-web/src/main/js/apps/component-measures/components/bubbleChart/BubbleChart.js
server/sonar-web/src/main/js/components/charts/bubble-chart.js

index 2fcfb83778b5e6a361971131ae8585c062ff3331..2f51e605e6527687222c8ea4be51d0298d6cdae4 100644 (file)
@@ -25,6 +25,7 @@ import bubbles from '../../config/bubbles';
 import { getComponentLeaves } from '../../../../api/components';
 import { formatMeasure } from '../../../../helpers/measures';
 import Workspace from '../../../../components/workspace/main';
+import { getComponentUrl } from '../../../../helpers/urls';
 
 const HEIGHT = 500;
 const BUBBLES_LIMIT = 500;
@@ -115,8 +116,12 @@ export default class BubbleChart extends React.Component {
     return `<div class="text-left">${inner}</div>`;
   }
 
-  handleBubbleClick (id) {
-    Workspace.openComponent({ uuid: id });
+  handleBubbleClick (component) {
+    if (['FIL', 'UTS'].includes(component.qualifier)) {
+      Workspace.openComponent({ uuid: component.id });
+    } else {
+      window.location = getComponentUrl(component.refKey || component.key);
+    }
   }
 
   renderBubbleChart () {
@@ -125,7 +130,7 @@ export default class BubbleChart extends React.Component {
         x: getMeasure(file, this.xMetric.key),
         y: getMeasure(file, this.yMetric.key),
         size: getMeasure(file, this.sizeMetric.key),
-        link: file.id,
+        link: file,
         tooltip: this.getTooltip(file)
       };
     });
index 5ab62b25e6da2e9c38fdcdaf631f0205804ab845..3956e2ea7cd56252c4a50f2eee49049fd16d266e 100644 (file)
@@ -32,7 +32,7 @@ export const Bubble = React.createClass({
     y: React.PropTypes.number.isRequired,
     r: React.PropTypes.number.isRequired,
     tooltip: React.PropTypes.string,
-    link: React.PropTypes.string
+    link: React.PropTypes.any
   },
 
   handleClick () {