]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7402 provide link to file
authorStas Vilchik <vilchiks@gmail.com>
Thu, 24 Mar 2016 12:59:23 +0000 (13:59 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Thu, 24 Mar 2016 16:38:54 +0000 (17:38 +0100)
server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentCell.js

index 558c80219d47ad693f79381d969906078dd7f92e..e5e5a3cbb178e93d0119e15ec4c2ae4736ce09e9 100644 (file)
@@ -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>