<div className="project-activity-event-inner">
<div className="project-activity-event-inner-icon little-spacer-right">
<ProjectEventIcon
- className={'text-text-bottom project-activity-event-icon ' + event.category}
+ className={'project-activity-event-icon margin-align ' + event.category}
/>
</div>
<span className="project-activity-event-inner-text">
<tr><td className="project-activity-graph-tooltip-separator" colSpan="3"><hr /></td></tr>
{events.map(event => (
<tr key={event.key} className="project-activity-graph-tooltip-line">
- <td className="spacer-right thin">
- <ProjectEventIcon className={'project-activity-event-icon ' + event.category} />
+ <td className="text-top spacer-right thin">
+ <ProjectEventIcon
+ className={'project-activity-event-icon margin-align ' + event.category}
+ />
</td>
<td colSpan="2">
- <span>{translate('event.category', event.category)}:</span>
- {' '} {event.name}
+ <span className="little-spacer-right">
+ {translate('event.category', event.category)}:
+ </span>
+ {event.name}
</td>
</tr>
))}
)}
/>
</td>
- <td className="text-right spacer-right thin">
+ <td className="text-right spacer-right">
<span className="project-activity-graph-tooltip-value">{props.value}</span>
{ratingValue && <Rating className="spacer-left" small={true} value={ratingValue} />}
</td>
role="listitem"
tabIndex="0">
<div className="project-activity-time spacer-right">
- <FormattedDate date={date} format="LT" tooltipFormat="LTS" />
+ <FormattedDate className="text-middle" date={date} format="LT" tooltipFormat="LTS" />
</div>
- <div
- className="project-activity-analysis-icon little-spacer-top big-spacer-right"
- title={analysisTitle}
- />
+ <div className="project-activity-analysis-icon big-spacer-right" title={analysisTitle} />
{canAdmin &&
<div className="project-activity-analysis-actions spacer-left">
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import React from 'react';
+import { shallow } from 'enzyme';
+import GraphsTooltipsContentEvents from '../GraphsTooltipsContentEvents';
+
+const EVENTS = [
+ {
+ key: '1',
+ category: 'VERSION',
+ name: '6.5'
+ },
+ {
+ key: '2',
+ category: 'OTHER',
+ name: 'Foo'
+ }
+];
+
+it('should render correctly', () => {
+ expect(shallow(<GraphsTooltipsContentEvents events={EVENTS} />)).toMatchSnapshot();
+});
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<tbody>
+ <tr>
+ <td
+ className="project-activity-graph-tooltip-separator"
+ colSpan="3"
+ >
+ <hr />
+ </td>
+ </tr>
+ <tr
+ className="project-activity-graph-tooltip-line"
+ >
+ <td
+ className="text-top spacer-right thin"
+ >
+ <ProjectEventIcon
+ className="project-activity-event-icon margin-align VERSION"
+ />
+ </td>
+ <td
+ colSpan="2"
+ >
+ <span
+ className="little-spacer-right"
+ >
+ event.category.VERSION
+ :
+ </span>
+ 6.5
+ </td>
+ </tr>
+ <tr
+ className="project-activity-graph-tooltip-line"
+ >
+ <td
+ className="text-top spacer-right thin"
+ >
+ <ProjectEventIcon
+ className="project-activity-event-icon margin-align OTHER"
+ />
+ </td>
+ <td
+ colSpan="2"
+ >
+ <span
+ className="little-spacer-right"
+ >
+ event.category.OTHER
+ :
+ </span>
+ Foo
+ </td>
+ </tr>
+</tbody>
+`;
/>
</td>
<td
- className="text-right spacer-right thin"
+ className="text-right spacer-right"
>
<span
className="project-activity-graph-tooltip-value"
/>
</td>
<td
- className="text-right spacer-right thin"
+ className="text-right spacer-right"
>
<span
className="project-activity-graph-tooltip-value"
float: left;
width: 10px;
height: 10px;
- margin-top: 4px;
+ margin-top: 5px;
border: 2px solid #4b9fd5;
border-radius: 10px;
box-sizing: border-box;
margin-left: 4px;
}
+.project-activity-event-icon.margin-align {
+ margin-top: 3px;
+}
+
.project-activity-event-icon.VERSION {
color: #4b9fd5;
}
export default class FormattedDate extends React.PureComponent {
props: {
+ className?: string,
date: string | number,
format?: string,
tooltipFormat?: string
};
render() {
- const { date, format, tooltipFormat } = this.props;
+ const { className, date, format, tooltipFormat } = this.props;
const m = moment(date);
const title = tooltipFormat ? m.format(tooltipFormat) : undefined;
return (
- <time dateTime={m.format()} title={title}>
+ <time className={className} dateTime={m.format()} title={title}>
{m.format(format)}
</time>
);