From 31a27608e429bb5962512ef7e3a01b12b49a01f8 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Thu, 7 Jan 2016 12:26:07 +0100 Subject: [PATCH] SONAR-7149 display a full file path in the tooltip when searching --- .../main/js/apps/code/components/ComponentName.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/server/sonar-web/src/main/js/apps/code/components/ComponentName.js b/server/sonar-web/src/main/js/apps/code/components/ComponentName.js index 4c52269fadc..f8b02d6b87f 100644 --- a/server/sonar-web/src/main/js/apps/code/components/ComponentName.js +++ b/server/sonar-web/src/main/js/apps/code/components/ComponentName.js @@ -23,6 +23,16 @@ import Truncated from './Truncated'; import QualifierIcon from '../../../components/shared/qualifier-icon'; +function getTooltip (component) { + const isFile = component.qualifier === 'FIL' || component.qualifier === 'UTS'; + if (isFile && component.path) { + return component.path; + } else { + return component.name; + } +} + + const Component = ({ component, onBrowse }) => { const handleClick = (e) => { e.preventDefault(); @@ -30,7 +40,7 @@ const Component = ({ component, onBrowse }) => { }; return ( - + {' '} {onBrowse ? ( -- 2.39.5