]> source.dussan.org Git - sonarqube.git/commitdiff
fix displaying of project with slash in the name on measures page
authorStas Vilchik <vilchiks@gmail.com>
Mon, 25 Apr 2016 13:55:07 +0000 (15:55 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 25 Apr 2016 13:57:38 +0000 (15:57 +0200)
server/sonar-web/src/main/js/apps/component-measures/details/drilldown/ComponentCell.js

index 2455a5a4601d88914cc1ae9b018d4ca7076a0662..1fc9ecab2c2858bedcd5ac5925c499ca615e2474 100644 (file)
@@ -39,12 +39,19 @@ const ComponentCell = ({ component, isSelected, onClick }) => {
     }
   };
 
-  const { head, tail } = splitPath(component.path || component.name);
+  let head = '';
+  let tail = component.path || component.name;
+
+  if (['DIR', 'FIL', 'CLA'].includes(component.qualifier)) {
+    const parts = splitPath(tail);
+    head = parts.head;
+    tail = parts.tail;
+  }
 
   const inner = (
       <span title={component.refKey || component.key}>
         <QualifierIcon qualifier={component.qualifier}/>
-          &nbsp;
+        &nbsp;
         {head.length > 0 && (
             <span className="note">{head}/</span>
         )}