summaryrefslogtreecommitdiffstats
path: root/server/sonar-web
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-03-24 13:59:23 +0100
committerStas Vilchik <vilchiks@gmail.com>2016-03-24 17:38:54 +0100
commit891f9fe52635c0d9714d60fb99308c201bfa4108 (patch)
treeede827b50a385ed033e725f946b6e551914ff395 /server/sonar-web
parentb5c2ee1492b96ae1dce6370103f42be7c2177b55 (diff)
downloadsonarqube-891f9fe52635c0d9714d60fb99308c201bfa4108.tar.gz
sonarqube-891f9fe52635c0d9714d60fb99308c201bfa4108.zip
SONAR-7402 provide link to file
Diffstat (limited to 'server/sonar-web')
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentCell.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentCell.js b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentCell.js
index 558c80219d4..e5e5a3cbb17 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentCell.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentCell.js
@@ -29,9 +29,14 @@ const ComponentCell = ({ component, isSelected, onClick }) => {
'selected': isSelected
});
- const handleClick = (e) => {
- e.preventDefault();
- onClick();
+ const handleClick = e => {
+ const isLeftClickEvent = e.button === 0;
+ const isModifiedEvent = !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
+
+ if (isLeftClickEvent && !isModifiedEvent) {
+ e.preventDefault();
+ onClick();
+ }
};
const { head, tail } = splitPath(component.path || component.name);
@@ -54,7 +59,7 @@ const ComponentCell = ({ component, isSelected, onClick }) => {
<a
id={'component-measures-component-link-' + component.key}
className={linkClassName}
- href="#"
+ href={getComponentUrl(component.key)}
onClick={handleClick}>
{inner}
</a>