]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7143 fix tooltips, improve rendering of long names
authorStas Vilchik <vilchiks@gmail.com>
Fri, 18 Dec 2015 09:54:17 +0000 (10:54 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Fri, 18 Dec 2015 10:02:51 +0000 (11:02 +0100)
server/sonar-web/src/main/js/apps/code/components/Component.js
server/sonar-web/src/main/js/apps/code/components/Components.js
server/sonar-web/src/main/js/apps/code/components/Truncated.js
server/sonar-web/src/main/less/pages/code.less
server/sonar-web/tests/apps/code/components-test.js

index 00a752cb591a41ba7ec324ba74fd474e5d0d0372..638088b5adacb889016242c62bc96192c15c171d 100644 (file)
@@ -12,7 +12,7 @@ const Component = ({ component, coverageMetric, onBrowse }) => (
           <ComponentDetach component={component}/>
         </span>
       </td>
-      <td>
+      <td className="code-name-cell">
         <ComponentName
             component={component}
             onBrowse={onBrowse}/>
index 79a83c3e51acd03250bc894ce1adfabc0ac9b512..d2dffb6786966ade8d1fcb5eb1b86db5d874699b 100644 (file)
@@ -19,6 +19,7 @@ const Components = ({ baseComponent, components, coverageMetric, onBrowse }) =>
       </thead>
       <tbody>
         <Component
+            key={baseComponent.uuid}
             component={baseComponent}
             coverageMetric={coverageMetric}/>
         <tr className="blank">
@@ -29,7 +30,7 @@ const Components = ({ baseComponent, components, coverageMetric, onBrowse }) =>
         {components.length ? (
             components.map(component => (
                 <Component
-                    key={component.key}
+                    key={component.uuid}
                     component={component}
                     coverageMetric={coverageMetric}
                     onBrowse={onBrowse}/>
index cc58a7b79ff2800c991f1af3df82773149b6f8f2..ecf7bb87904095dfb5d7ca9fcc4fde7f7320a9a4 100644 (file)
@@ -4,7 +4,7 @@ import React from 'react';
 const Truncated = ({ children, title }) => (
     <span
         className="code-truncated"
-        title={title}
+        data-title={title}
         data-toggle="tooltip">
       {children}
     </span>
index 8fda47825e6437db037cbc85ce7d56990656fff7..ec50b00aeffec2db0191c685b57774601414286a 100644 (file)
   .text-ellipsis;
 }
 
+.code-name-cell {
+  max-width: 0;
+}
+
+.code-name-cell .code-truncated {
+  max-width: 100%;
+}
+
 .code-source-viewer .source-viewer-header-component {
   visibility: hidden;
 }
index 2469bf268702353d3cd1937670b42c06af8e95bf..5048b2fa8bc6c28307ed92cf7bd94a8c7205e219 100644 (file)
@@ -278,7 +278,7 @@ describe('Code :: Components', () => {
           .to.equal('span');
       expect(output.text())
           .to.equal('123');
-      expect(output.prop('title'))
+      expect(output.prop('data-title'))
           .to.equal('ABC');
     });
   });