render () {
return <div className="overview-domain-chart">
<div className="overview-card-header">
- <h2 className="overview-title">Project Files</h2>
+ <h2 className="overview-title">{window.t('overview.chart.files')}</h2>
<ul className="list-inline small">
<li>X: {this.state.xMetric.name}</li>
<li>Y: {this.state.yMetric.name}</li>
return <div className="overview-domain-chart">
<div className="overview-card-header">
<div>
- <h2 className="overview-title">Timeline</h2>
+ <h2 className="overview-title">{window.t('overview.chart.history')}</h2>
{this.renderTimelineMetricSelect()}
</div>
{this.renderComparisonMetricSelect()}
`${this.state.sizeMetric.name}: ${formatMeasure(component.measures[this.props.sizeMetric], this.state.sizeMetric.type)}`
];
if (this.state.colorMetric) {
- inner.push(`${this.state.colorMetric.name}: ${formatMeasure(component.measures[this.props.colorMetric], this.state.colorMetric.type)}`);
+ let measure = component.measures[this.props.colorMetric],
+ formatted = measure != null ? formatMeasure(measure, this.state.colorMetric.type) : '—';
+ inner.push(`${this.state.colorMetric.name}: ${formatted}`);
}
inner = inner.join('<br>');
return `<div class="text-left">${inner}</div>`;
let color = this.props.colorMetric ? <li>Color: {this.state.colorMetric.name}</li> : null;
return <div className="overview-domain-chart">
<div className="overview-card-header">
- <h2 className="overview-title">Treemap</h2>
+ <h2 className="overview-title">{window.t('overview.chart.components')}</h2>
<ul className="list-inline small">
<li>Size: {this.state.sizeMetric.name}</li>
{color}
return null;
}
- let leak = this.props.leak[this.getMetric()];
+ let leak = this.props.leak[this.getMetric()] || 0;
let added = this.props.leak[this.getNewMetric()] || 0;
let removed = added - leak;
<div className="overview-cards-list">
<div className="overview-card overview-card-fixed-width">
<div className="overview-card-header">
- <div className="overview-title">Coverage Overview</div>
+ <div className="overview-title">{window.t('overview.domain.coverage')}</div>
{this.renderLegend()}
</div>
<CoverageMeasuresList {...this.props} {...this.state}/>
import { AddedRemovedMeasure, AddedRemovedDebt, OnNewCodeMeasure, SeverityMeasure } from './../components/issue-measure';
import { IssuesTags } from './../components/issues-tags';
import Assignees from './../components/issues-assignees';
-import { getFacets, extractAssignees } from '../../../api/issues';
+import { getFacet, extractAssignees } from '../../../api/issues';
import StatusHelper from '../../../components/shared/status-helper';
import { Rating } from '../../../components/shared/rating';
import { DrilldownLink } from '../../../components/shared/drilldown-link';
componentDidMount() {
Promise.all([
this.requestMeasures(),
- this.requestIssues()
+ this.requestIssues(),
+ this.requestAssignees()
]).then(responses => {
let measures = this.getMeasuresValues(responses[0], 'value');
let leak = this.getMeasuresValues(responses[0], 'var' + this.props.leakPeriodIndex);
- let tags = this.getFacet(responses[1].facets, 'tags');
- let assignees = extractAssignees(this.getFacet(responses[1].facets, 'assignees'), responses[1].response);
+ let tags = responses[1].facet;
+ let assignees = extractAssignees(responses[2].facet, responses[2].response);
this.setState({ ready: true, measures, leak, tags, assignees });
});
},
},
requestIssues () {
- return getFacets({
+ return getFacet({
componentUuids: this.props.component.id,
resolved: 'false'
- }, ['tags', 'assignees']);
+ }, 'tags');
+ },
+
+ requestAssignees () {
+ return getFacet({
+ componentUuids: this.props.component.id,
+ resolved: 'false',
+ statuses: 'OPEN,REOPENED'
+ }, 'assignees');
},
renderLoading () {
<div className="overview-cards-list">
<div className="overview-card overview-card-fixed-width">
<div className="overview-card-header">
- <div className="overview-title">Technical Debt Overview</div>
+ <div className="overview-title">{window.t('overview.domain.debt')}</div>
{this.renderLegend()}
</div>
<div className="overview-detailed-measure">
<div className="overview-detailed-measure-nutshell">
<div className="overview-detailed-measure-name">
- <StatusHelper status="OPEN"/> & <StatusHelper status="REOPENED"/> Issues
+ {window.t('overview.unmanaged_issues')}
</div>
<div className="spacer-top">
<Assignees {...this.props} assignees={this.state.assignees}/>
<div className="overview-cards-list">
<div className="overview-card overview-card-fixed-width">
<div className="overview-card-header">
- <div className="overview-title">Duplications Overview</div>
+ <div className="overview-title">{window.t('overview.domain.duplications')}</div>
{this.renderLegend()}
</div>
<div className="overview-detailed-measures-list">
return <div className="overview-detailed-page">
<div className="overview-card">
<div className="overview-card-header">
- <div className="overview-title">Size Overview</div>
+ <div className="overview-title">{window.t('overview.domain.size')}</div>
{this.renderLegend()}
</div>
import React from 'react';
import { Timeline } from './timeline';
-import { navigate } from '../../../components/router/router';
import { Legend } from '../components/legend';
export const DomainTitle = React.createClass({
- handleClick(e) {
- e.preventDefault();
- navigate(this.props.linkTo);
- },
-
render () {
if (this.props.linkTo) {
+ let url = window.baseUrl + '/overview' + this.props.linkTo +
+ '?id=' + encodeURIComponent(this.props.component.key);
return <div>
<div className="overview-title">
{this.props.children}
- <a onClick={this.handleClick} className="small big-spacer-left link-no-underline" href="#">
+ <a className="small big-spacer-left link-no-underline" href={url}>
More <i className="icon-chevron-right" style={{ position: 'relative', top: -1 }}/></a>
</div>
</div>;
export const DomainHeader = React.createClass({
render () {
return <div className="overview-card-header">
- <DomainTitle linkTo={this.props.linkTo}>{this.props.title}</DomainTitle>
+ <DomainTitle {...this.props}>{this.props.title}</DomainTitle>
<Legend leakPeriodLabel={this.props.leakPeriodLabel} leakPeriodDate={this.props.leakPeriodDate}/>
</div>;
}
}
return <Domain>
- <DomainHeader title="Coverage" linkTo="/tests"/>
+ <DomainHeader component={this.props.component} title={window.t('overview.domain.coverage')} linkTo="/tests"/>
<DomainPanel domain="coverage">
<DomainNutshell>
if (!this.hasLeakPeriod()) {
return null;
}
+ let measure = this.props.leak['duplicated_lines_density'],
+ formatted = measure != null ? formatMeasureVariation(measure, 'PERCENT') : '—';
return <DomainLeak>
<MeasuresList>
<Measure label={getMetricName('duplications')}>
- {formatMeasureVariation(this.props.leak['duplicated_lines_density'], 'PERCENT')}
+ {formatted}
</Measure>
</MeasuresList>
{this.renderTimeline('after')}
render () {
return <Domain>
- <DomainHeader title="Duplications" linkTo="/duplications"/>
+ <DomainHeader component={this.props.component} title={window.t('overview.domain.duplications')}
+ linkTo="/duplications"/>
<DomainPanel domain="duplications">
<DomainNutshell>
render () {
return <Domain>
- <DomainHeader title="Technical Debt" linkTo="/issues"
+ <DomainHeader component={this.props.component} title={window.t('overview.domain.debt')} linkTo="/issues"
leakPeriodLabel={this.props.leakPeriodLabel} leakPeriodDate={this.props.leakPeriodDate}/>
<DomainPanel domain="issues">
if (!this.hasLeakPeriod()) {
return null;
}
-
+ let measure = this.props.leak['ncloc'],
+ formatted = measure != null ? formatMeasureVariation(measure, 'SHORT_INT') : '—';
return <DomainLeak>
<MeasuresList>
- <Measure label={getMetricName('ncloc')}>
- {formatMeasureVariation(this.props.leak['ncloc'], 'SHORT_INT')}
- </Measure>
+ <Measure label={getMetricName('ncloc')}>{formatted}</Measure>
</MeasuresList>
{this.renderTimeline('after')}
</DomainLeak>;
render () {
return <Domain>
- <DomainHeader title="Size" linkTo="/size"/>
+ <DomainHeader component={this.props.component} title={window.t('overview.domain.size')} linkTo="/size"/>
<DomainPanel domain="size">
<DomainNutshell>
'SHORT_WORK_DUR': shortDurationVariationFormatter,
'RATING': ratingFormatter,
'LEVEL': levelFormatter,
- 'MILLISEC': millisecondsFormatter
+ 'MILLISEC': millisecondsVariationFormatter
};
return FORMATTERS[type] || noFormatter;
}
}
}
+function millisecondsVariationFormatter (value) {
+ let absValue = Math.abs(value),
+ formattedValue = millisecondsFormatter(absValue);
+ return value < 0 ? `-${formattedValue}` : `+${formattedValue}`;
+}
+
/*
* Debt Formatters
overview.quality_profiles=Quality Profiles
overview.water_leak=Water Leak
overview.project_in_a_nutshell=Project In a Nutshell
+overview.unmanaged_issues=Unmanaged Issues
overview.metric.issues=Issues
overview.metric.debt=Debt
overview.gate.WARN=Warning
overview.gate.OK=Passed
-overview.domain.issues=Issues & Technical Debt
-overview.domain.coverage=Coverage & Tests
+overview.domain.debt=Technical Debt
+overview.domain.coverage=Coverage
overview.domain.duplications=Duplications
-overview.domain.size=Size & Complexity
+overview.domain.size=Size
+
+overview.chart.files=Files
+overview.chart.components=Components
+overview.chart.history=History
#------------------------------------------------------------------------------