From d55ab331ed66b29cfd99c0a41f94c4ddf521f4ca Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gr=C3=A9goire=20Aubert?= Date: Fri, 23 Jun 2017 11:45:49 +0200 Subject: [PATCH] SONAR-8550 Group analyses by version in the project activity list --- .../components/ProjectActivityAnalysesList.js | 65 +++++++++++-------- .../components/ProjectActivityAnalysis.js | 2 +- .../components/ProjectActivityApp.js | 4 +- .../components/forms/AddEventForm.js | 2 +- .../components/projectActivity.css | 4 +- .../src/main/js/apps/projectActivity/utils.js | 27 +++++++- .../sonar-web/src/main/less/init/forms.less | 4 ++ .../pageobjects/ProjectAnalysisItem.java | 23 +++---- .../projectEvent/ProjectActivityPageTest.java | 8 ++- 9 files changed, 89 insertions(+), 50 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysesList.js b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysesList.js index 5242772fef8..e6dd14181e0 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysesList.js +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysesList.js @@ -19,11 +19,11 @@ */ // @flow import React from 'react'; -import { groupBy } from 'lodash'; import moment from 'moment'; import ProjectActivityAnalysis from './ProjectActivityAnalysis'; import FormattedDate from '../../../components/ui/FormattedDate'; import { translate } from '../../../helpers/l10n'; +import { getAnalysesByVersionByDay } from '../utils'; import type { Analysis } from '../types'; type Props = { @@ -50,35 +50,44 @@ export default function ProjectActivityAnalysesList(props: Props) { ); } - const firstAnalysis = props.analyses[0]; - const byDay = groupBy(props.analyses, analysis => moment(analysis.date).startOf('day').valueOf()); + const firstAnalysisKey = props.analyses[0].key; + const byVersionByDay = getAnalysesByVersionByDay(props.analyses); return (
-