diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-12-18 10:54:17 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-12-18 11:02:51 +0100 |
commit | e75c3de15ad0bff50150ad84c3af4a7239c34422 (patch) | |
tree | 445af8cc07116bb41e867c9063a96df4f5bd374e /server | |
parent | e76fa39804056cad55e436c39a3540f245e9f1ac (diff) | |
download | sonarqube-e75c3de15ad0bff50150ad84c3af4a7239c34422.tar.gz sonarqube-e75c3de15ad0bff50150ad84c3af4a7239c34422.zip |
SONAR-7143 fix tooltips, improve rendering of long names
Diffstat (limited to 'server')
5 files changed, 13 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/apps/code/components/Component.js b/server/sonar-web/src/main/js/apps/code/components/Component.js index 00a752cb591..638088b5ada 100644 --- a/server/sonar-web/src/main/js/apps/code/components/Component.js +++ b/server/sonar-web/src/main/js/apps/code/components/Component.js @@ -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}/> diff --git a/server/sonar-web/src/main/js/apps/code/components/Components.js b/server/sonar-web/src/main/js/apps/code/components/Components.js index 79a83c3e51a..d2dffb67869 100644 --- a/server/sonar-web/src/main/js/apps/code/components/Components.js +++ b/server/sonar-web/src/main/js/apps/code/components/Components.js @@ -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}/> diff --git a/server/sonar-web/src/main/js/apps/code/components/Truncated.js b/server/sonar-web/src/main/js/apps/code/components/Truncated.js index cc58a7b79ff..ecf7bb87904 100644 --- a/server/sonar-web/src/main/js/apps/code/components/Truncated.js +++ b/server/sonar-web/src/main/js/apps/code/components/Truncated.js @@ -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> diff --git a/server/sonar-web/src/main/less/pages/code.less b/server/sonar-web/src/main/less/pages/code.less index 8fda47825e6..ec50b00aeff 100644 --- a/server/sonar-web/src/main/less/pages/code.less +++ b/server/sonar-web/src/main/less/pages/code.less @@ -38,6 +38,14 @@ .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; } diff --git a/server/sonar-web/tests/apps/code/components-test.js b/server/sonar-web/tests/apps/code/components-test.js index 2469bf26870..5048b2fa8bc 100644 --- a/server/sonar-web/tests/apps/code/components-test.js +++ b/server/sonar-web/tests/apps/code/components-test.js @@ -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'); }); }); |