};
render() {
- const { analysis, isFirst, canAdmin } = this.props;
+ const { analysis, isFirst, canAdmin, canCreateVersion } = this.props;
const { date, events } = analysis;
const parsedDate = parseDate(date);
const hasVersion = events.find(event => event.category === 'VERSION') != null;
- const canAddVersion = canAdmin && !hasVersion && this.props.canCreateVersion;
+ const canAddVersion = canAdmin && !hasVersion && canCreateVersion;
const canAddEvent = canAdmin;
const canDeleteAnalyses =
this.props.canDeleteAnalyses && !isFirst && !analysis.manualNewCodePeriodBaseline;
let tooltipContent = <TimeFormatter date={parsedDate} long={true} />;
- // If projectVersion AND codePeriodVersion are set, add the projectVersion
- // to the tooltip content.
- if (analysis.projectVersion && analysis.codePeriodVersion) {
+ if (analysis.buildString) {
tooltipContent = (
<>
{tooltipContent}
<br />
{translateWithParameters(
- 'project_activity.analysis_project_version_X',
- analysis.projectVersion
+ 'project_activity.analysis_build_string_X',
+ analysis.buildString
)}
</>
);
<Tooltip mouseEnterDelay={0.5} overlay={tooltipContent} placement="left">
<li
className={classNames('project-activity-analysis', { selected: this.props.selected })}
- data-date={date.valueOf()}
+ data-date={parsedDate.valueOf()}
onClick={this.handleClick}
tabIndex={0}>
<div className="project-activity-time spacer-right">
*/
import { InjectedRouter } from 'react-router';
import { Location } from 'history';
+import { ParsedAnalysis } from '../apps/projectActivity/utils';
import { Profile } from '../apps/quality-profiles/types';
export function mockAlmApplication(overrides: Partial<T.AlmApplication> = {}): T.AlmApplication {
};
}
+export function mockParsedAnalysis(overrides: Partial<ParsedAnalysis> = {}): ParsedAnalysis {
+ return {
+ date: new Date('2017-03-01T09:36:01+0100'),
+ events: [],
+ key: 'foo',
+ projectVersion: '1.0',
+ ...overrides
+ };
+}
+
+export function mockAnalysisEvent(overrides: Partial<T.AnalysisEvent> = {}): T.AnalysisEvent {
+ return {
+ category: 'QUALITY_GATE',
+ key: 'E11',
+ description: 'Lorem ipsum dolor sit amet',
+ name: 'Lorem ipsum',
+ qualityGate: {
+ status: 'ERROR',
+ stillFailing: true,
+ failing: [
+ {
+ key: 'foo',
+ name: 'Foo',
+ branch: 'master'
+ },
+ {
+ key: 'bar',
+ name: 'Bar',
+ branch: 'feature/bar'
+ }
+ ]
+ },
+ ...overrides
+ };
+}
+
export function mockAppState(overrides: Partial<T.AppState> = {}): T.AppState {
return {
defaultOrganization: 'foo',
#------------------------------------------------------------------------------
project_activity.analysis=Analysis
-project_activity.analysis_project_version_X=Project version: {0}
+project_activity.analysis_build_string_X=Build string: {0}
project_activity.add_version=Create Version
project_activity.analyzed.TRK=Project Analyzed
project_activity.analyzed.APP=Application Analyzed