diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps')
-rw-r--r-- | server/sonar-web/src/main/js/apps/component-measures/details/history/MeasureHistory.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/apps/component-measures/details/history/MeasureHistory.js b/server/sonar-web/src/main/js/apps/component-measures/details/history/MeasureHistory.js index 2370fce1031..3e0f15fec20 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/details/history/MeasureHistory.js +++ b/server/sonar-web/src/main/js/apps/component-measures/details/history/MeasureHistory.js @@ -24,7 +24,7 @@ import React from 'react'; import Spinner from './../../components/Spinner'; import Timeline from '../../../../components/charts/Timeline'; import { getTimeMachineData } from '../../../../api/time-machine'; -import { getEvents } from '../../../../api/events'; +import { getProjectActivity } from '../../../../api/projectActivity'; import { formatMeasure, getShortType } from '../../../../helpers/measures'; import { translate } from '../../../../helpers/l10n'; @@ -91,9 +91,10 @@ export default class MeasureHistory extends React.Component { } fetchEvents () { - return getEvents(this.props.component.key, 'Version').then(r => { - const events = r.map(event => { - return { version: event.n, date: moment(event.dt).toDate() }; + return getProjectActivity(this.props.component.key, { category: 'VERSION' }).then(({ analyses }) => { + const events = analyses.map(analysis => { + const version = analysis.events.find(event => event.category === 'VERSION'); + return { version: version.name, date: moment(analysis.date).toDate() }; }); return sortBy(events, 'date'); |