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;
}
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 (
/>
</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>
const { event } = props;
if (event.category === 'VERSION') {
- return <span className="overview-analysis-event badge">{props.event.name}</span>;
+ return (
+ <Tooltip overlay={`${translate('version')} ${props.event.name}`} mouseEnterDelay={0.5}>
+ <span className="overview-analysis-event badge">{props.event.name}</span>
+ </Tooltip>
+ );
}
return (
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`should render a version correctly 1`] = `
-<span
- className="overview-analysis-event badge"
+<Tooltip
+ mouseEnterDelay={0.5}
+ overlay="version 6.5-SNAPSHOT"
+ placement="bottom"
>
- 6.5-SNAPSHOT
-</span>
+ <span
+ className="overview-analysis-event badge"
+ >
+ 6.5-SNAPSHOT
+ </span>
+</Tooltip>
`;
exports[`should render an event correctly 1`] = `
.overview-analysis-event.badge {
vertical-align: middle;
+ /* 260px to match the sidebar width on project dashboard */
+ max-width: 260px;
padding: 4px 14px;
+ box-sizing: border-box;
border-radius: 2px;
font-weight: bold;
font-size: 12px;
letter-spacing: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
.overview-analysis-event + .overview-analysis-event {
import { throttle } from 'lodash';
import ProjectActivityAnalysis from './ProjectActivityAnalysis';
import DateFormatter from '../../../components/intl/DateFormatter';
+import Tooltip from '../../../components/controls/Tooltip';
import { translate } from '../../../helpers/l10n';
import { toShortNotSoISOString } from '../../../helpers/dates';
import {
<li key={version.key || 'noversion'}>
{version.version && (
<div className={classNames('project-activity-version-badge', { first: idx === 0 })}>
- <span className="badge">{version.version}</span>
+ <Tooltip
+ overlay={`${translate('version')} ${version.version}`}
+ mouseEnterDelay={0.5}>
+ <span className="badge">{version.version}</span>
+ </Tooltip>
</div>
)}
<ul className="project-activity-days-list">
<div
className="project-activity-version-badge first"
>
- <span
- className="badge"
+ <Tooltip
+ mouseEnterDelay={0.5}
+ overlay="version 6.4"
+ placement="bottom"
>
- 6.4
- </span>
+ <span
+ className="badge"
+ >
+ 6.4
+ </span>
+ </Tooltip>
</div>
<ul
className="project-activity-days-list"
<div
className="project-activity-version-badge first"
>
- <span
- className="badge"
+ <Tooltip
+ mouseEnterDelay={0.5}
+ overlay="version 6.5-SNAPSHOT"
+ placement="bottom"
>
- 6.5-SNAPSHOT
- </span>
+ <span
+ className="badge"
+ >
+ 6.5-SNAPSHOT
+ </span>
+ </Tooltip>
</div>
<ul
className="project-activity-days-list"
<div
className="project-activity-version-badge first"
>
- <span
- className="badge"
+ <Tooltip
+ mouseEnterDelay={0.5}
+ overlay="version 6.5-SNAPSHOT"
+ placement="bottom"
>
- 6.5-SNAPSHOT
- </span>
+ <span
+ className="badge"
+ >
+ 6.5-SNAPSHOT
+ </span>
+ </Tooltip>
</div>
<ul
className="project-activity-days-list"
<div
className="project-activity-version-badge"
>
- <span
- className="badge"
+ <Tooltip
+ mouseEnterDelay={0.5}
+ overlay="version 6.4"
+ placement="bottom"
>
- 6.4
- </span>
+ <span
+ className="badge"
+ >
+ 6.4
+ </span>
+ </Tooltip>
</div>
<ul
className="project-activity-days-list"
}
.project-activity-version-badge .badge {
+ max-width: 385px;
vertical-align: middle;
padding: 4px 14px 4px 14px;
+ box-sizing: border-box;
border-radius: 0 2px 2px 0;
font-weight: bold;
font-size: 12px;
letter-spacing: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
}