import ActivityLink from '../../../components/common/ActivityLink';
import DeferredSpinner from '../../../components/ui/DeferredSpinner';
import { parseDate } from '../../../helpers/dates';
-import { translate } from '../../../helpers/l10n';
+import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { localizeMetric } from '../../../helpers/measures';
import { BranchLike } from '../../../types/branch-like';
import { GraphType, MeasureHistory } from '../../../types/project-activity';
import { Analysis as AnalysisType, Component, Metric } from '../../../types/types';
metrics
} = props;
- const series = generateSeries(
- measuresHistory,
- graph,
- metrics,
- getDisplayedHistoryMetrics(graph, [])
- );
+ const displayedMetrics = getDisplayedHistoryMetrics(graph, []);
+ const series = generateSeries(measuresHistory, graph, metrics, displayedMetrics);
const graphs = splitSeriesInGraphs(series, MAX_GRAPH_NB, MAX_SERIES_PER_GRAPH);
let shownLeakPeriodDate;
if (leakPeriodDate !== undefined) {
<div className="overview-panel-content">
<div className="display-flex-row">
<div className="display-flex-column flex-1">
- <div aria-hidden={true} className="overview-panel-padded display-flex-column flex-1">
+ <div className="overview-panel-padded display-flex-column flex-1">
<GraphsHeader graph={graph} metrics={metrics} updateGraph={props.onGraphChange} />
- <GraphsHistory
- analyses={[]}
- graph={graph}
- graphs={graphs}
- leakPeriodDate={shownLeakPeriodDate}
- loading={Boolean(loading)}
- measuresHistory={measuresHistory}
- series={series}
- />
+ <div
+ aria-label={translateWithParameters(
+ 'overview.activity.graph_shows_data_for_x',
+ displayedMetrics.map(metricKey => localizeMetric(metricKey)).join(', ')
+ )}>
+ <div aria-hidden={true}>
+ <GraphsHistory
+ analyses={[]}
+ graph={graph}
+ graphs={graphs}
+ leakPeriodDate={shownLeakPeriodDate}
+ loading={Boolean(loading)}
+ measuresHistory={measuresHistory}
+ series={series}
+ />
+ </div>
+ </div>
</div>
<div className="overview-panel-padded bordered-top text-right">
className="display-flex-column flex-1"
>
<div
- aria-hidden={true}
className="overview-panel-padded display-flex-column flex-1"
>
<GraphsHeader
}
updateGraph={[MockFunction]}
/>
- <GraphsHistory
- analyses={Array []}
- graph="issues"
- graphs={
- Array [
- Array [
- Object {
- "data": Array [
+ <div
+ aria-label="overview.activity.graph_shows_data_for_x.metric.bugs.name, metric.code_smells.name, metric.vulnerabilities.name"
+ >
+ <div
+ aria-hidden={true}
+ >
+ <GraphsHistory
+ analyses={Array []}
+ graph="issues"
+ graphs={
+ Array [
+ Array [
Object {
- "x": 2016-10-27T14:33:50.000Z,
- "y": 20,
+ "data": Array [
+ Object {
+ "x": 2016-10-27T14:33:50.000Z,
+ "y": 20,
+ },
+ ],
+ "name": "bugs",
+ "translatedName": "Bugs",
+ "type": "PERCENT",
},
],
- "name": "bugs",
- "translatedName": "Bugs",
- "type": "PERCENT",
- },
- ],
- ]
- }
- loading={false}
- measuresHistory={
- Array [
- Object {
- "bestValue": true,
- "history": Array [
+ ]
+ }
+ loading={false}
+ measuresHistory={
+ Array [
Object {
- "date": 2016-10-27T14:33:50.000Z,
- "value": "20",
+ "bestValue": true,
+ "history": Array [
+ Object {
+ "date": 2016-10-27T14:33:50.000Z,
+ "value": "20",
+ },
+ ],
+ "metric": "bugs",
+ "period": Object {
+ "bestValue": true,
+ "index": 1,
+ "value": "1.0",
+ },
+ "value": "1.0",
},
- ],
- "metric": "bugs",
- "period": Object {
- "bestValue": true,
- "index": 1,
- "value": "1.0",
- },
- "value": "1.0",
- },
- ]
- }
- series={
- Array [
- Object {
- "data": Array [
+ ]
+ }
+ series={
+ Array [
Object {
- "x": 2016-10-27T14:33:50.000Z,
- "y": 20,
+ "data": Array [
+ Object {
+ "x": 2016-10-27T14:33:50.000Z,
+ "y": 20,
+ },
+ ],
+ "name": "bugs",
+ "translatedName": "Bugs",
+ "type": "PERCENT",
},
- ],
- "name": "bugs",
- "translatedName": "Bugs",
- "type": "PERCENT",
- },
- ]
- }
- />
+ ]
+ }
+ />
+ </div>
+ </div>
</div>
<div
className="overview-panel-padded bordered-top text-right"
className="display-flex-column flex-1"
>
<div
- aria-hidden={true}
className="overview-panel-padded display-flex-column flex-1"
>
<GraphsHeader
}
updateGraph={[MockFunction]}
/>
- <GraphsHistory
- analyses={Array []}
- graph="issues"
- graphs={
- Array [
- Array [
- Object {
- "data": Array [
+ <div
+ aria-label="overview.activity.graph_shows_data_for_x.metric.bugs.name, metric.code_smells.name, metric.vulnerabilities.name"
+ >
+ <div
+ aria-hidden={true}
+ >
+ <GraphsHistory
+ analyses={Array []}
+ graph="issues"
+ graphs={
+ Array [
+ Array [
Object {
- "x": 2016-10-27T14:33:50.000Z,
- "y": 20,
+ "data": Array [
+ Object {
+ "x": 2016-10-27T14:33:50.000Z,
+ "y": 20,
+ },
+ ],
+ "name": "bugs",
+ "translatedName": "Bugs",
+ "type": "PERCENT",
},
],
- "name": "bugs",
- "translatedName": "Bugs",
- "type": "PERCENT",
- },
- ],
- ]
- }
- loading={true}
- measuresHistory={
- Array [
- Object {
- "bestValue": true,
- "history": Array [
+ ]
+ }
+ loading={true}
+ measuresHistory={
+ Array [
Object {
- "date": 2016-10-27T14:33:50.000Z,
- "value": "20",
+ "bestValue": true,
+ "history": Array [
+ Object {
+ "date": 2016-10-27T14:33:50.000Z,
+ "value": "20",
+ },
+ ],
+ "metric": "bugs",
+ "period": Object {
+ "bestValue": true,
+ "index": 1,
+ "value": "1.0",
+ },
+ "value": "1.0",
},
- ],
- "metric": "bugs",
- "period": Object {
- "bestValue": true,
- "index": 1,
- "value": "1.0",
- },
- "value": "1.0",
- },
- ]
- }
- series={
- Array [
- Object {
- "data": Array [
+ ]
+ }
+ series={
+ Array [
Object {
- "x": 2016-10-27T14:33:50.000Z,
- "y": 20,
+ "data": Array [
+ Object {
+ "x": 2016-10-27T14:33:50.000Z,
+ "y": 20,
+ },
+ ],
+ "name": "bugs",
+ "translatedName": "Bugs",
+ "type": "PERCENT",
},
- ],
- "name": "bugs",
- "translatedName": "Bugs",
- "type": "PERCENT",
- },
- ]
- }
- />
+ ]
+ }
+ />
+ </div>
+ </div>
</div>
<div
className="overview-panel-padded bordered-top text-right"
export default function ChartLegendIcon({ index, ...iconProps }: Props) {
const COLORS = [colors.blue, colors.darkBlue, '#24c6e0'];
return (
- <Icon {...iconProps}>
+ <Icon {...iconProps} aria-hidden={true}>
<path
d="M14.325 7.143v1.714q0 0.357-0.25 0.607t-0.607 0.25h-10.857q-0.357 0-0.607-0.25t-0.25-0.607v-1.714q0-0.357 0.25-0.607t0.607-0.25h10.857q0.357 0 0.607 0.25t0.25 0.607z"
style={{ fill: COLORS[index] || COLORS[0] }}
overview.project_key.TRK=Project Key
overview.project_key.click_to_copy=Click to copy the key to your clipboard
overview.activity=Activity
+overview.activity.graph_shows_data_for_x=This space normally shows historical data for {0}. Click on the "Activity" link below to see more information.
overview.recent_activity=Recent Activity
overview.measures=Measures
overview.measures.empty_explanation=Measures on New Code will appear after the second analysis of this branch.