From 9c32ccb0abea0435fa28d1f98c37a8f8a7903cd7 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 11 Apr 2016 15:27:55 +0200 Subject: [PATCH] SONAR-7402 clicking on project bubble brings to the project page --- .../components/bubbleChart/BubbleChart.js | 11 ++++++++--- .../src/main/js/components/charts/bubble-chart.js | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/bubbleChart/BubbleChart.js b/server/sonar-web/src/main/js/apps/component-measures/components/bubbleChart/BubbleChart.js index 2fcfb83778b..2f51e605e65 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/bubbleChart/BubbleChart.js +++ b/server/sonar-web/src/main/js/apps/component-measures/components/bubbleChart/BubbleChart.js @@ -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 `
${inner}
`; } - 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) }; }); diff --git a/server/sonar-web/src/main/js/components/charts/bubble-chart.js b/server/sonar-web/src/main/js/components/charts/bubble-chart.js index 5ab62b25e6d..3956e2ea7cd 100644 --- a/server/sonar-web/src/main/js/components/charts/bubble-chart.js +++ b/server/sonar-web/src/main/js/components/charts/bubble-chart.js @@ -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 () { -- 2.39.5