diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-10-25 14:26:57 +0200 |
---|---|---|
committer | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-10-25 17:33:29 +0200 |
commit | c889f5e0f9bda5487b376ad13dda253dfa394605 (patch) | |
tree | eb03f9fca2be3e86b8e699396c4b7fb89d2106e1 /server/sonar-web/src/main/js/app | |
parent | 83c615c8afe8ceb63ccac52858da14afec6b36f0 (diff) | |
download | sonarqube-c889f5e0f9bda5487b376ad13dda253dfa394605.tar.gz sonarqube-c889f5e0f9bda5487b376ad13dda253dfa394605.zip |
better rendering of long versions
Diffstat (limited to 'server/sonar-web/src/main/js/app')
2 files changed, 26 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMeta.tsx b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMeta.tsx index 43540593843..1a2b4bd1cd8 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMeta.tsx +++ b/server/sonar-web/src/main/js/app/components/nav/component/ComponentNavMeta.tsx @@ -21,7 +21,9 @@ import * as React from 'react'; import BranchStatus from '../../../../components/common/BranchStatus'; import { Branch, Component } from '../../../types'; import DateTimeFormatter from '../../../../components/intl/DateTimeFormatter'; +import Tooltip from '../../../../components/controls/Tooltip'; import { isShortLivingBranch } from '../../../../helpers/branches'; +import { translate } from '../../../../helpers/l10n'; interface Props { branch?: Branch; @@ -41,7 +43,17 @@ export default function ComponentNavMeta(props: Props) { } if (props.component.version && !shortBranch) { - metaList.push(<li key="version">Version {props.component.version}</li>); + metaList.push( + <li key="version"> + <Tooltip + overlay={`${translate('version')} ${props.component.version}`} + mouseEnterDelay={0.5}> + <span className="text-limited"> + {translate('version')} {props.component.version} + </span> + </Tooltip> + </li> + ); } return ( diff --git a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavMeta-test.tsx.snap b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavMeta-test.tsx.snap index 905f83959b1..a1dd339dfce 100644 --- a/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavMeta-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/nav/component/__tests__/__snapshots__/ComponentNavMeta-test.tsx.snap @@ -13,8 +13,19 @@ exports[`renders meta for long-living branch 1`] = ` /> </li> <li> - Version - 0.0.1 + <Tooltip + mouseEnterDelay={0.5} + overlay="version 0.0.1" + placement="bottom" + > + <span + className="text-limited" + > + version + + 0.0.1 + </span> + </Tooltip> </li> </ul> </div> |