From f6c60617b20ca2c301b4b2a94cb063d12dbbc758 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gr=C3=A9goire=20Aubert?= Date: Fri, 7 Jul 2017 12:25:02 +0200 Subject: [PATCH] SONAR-9403 Show an empty project activity graph instead of a message for metrics that don't have data --- server/sonar-web/src/main/js/apps/projectActivity/utils.js | 4 +--- .../src/main/js/components/charts/AdvancedTimeline.js | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/projectActivity/utils.js b/server/sonar-web/src/main/js/apps/projectActivity/utils.js index 24c4f3fecc6..a42c389972c 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/utils.js +++ b/server/sonar-web/src/main/js/apps/projectActivity/utils.js @@ -66,9 +66,7 @@ export const datesQueryChanged = (prevQuery: Query, nextQuery: Query): boolean = }; export const hasHistoryData = (series: Array) => - series.some( - serie => serie.data && serie.data.length > 2 && serie.data.some(p => p.y || p.y === 0) - ); + series.some(serie => serie.data && serie.data.length > 2); export const historyQueryChanged = (prevQuery: Query, nextQuery: Query): boolean => prevQuery.graph !== nextQuery.graph; diff --git a/server/sonar-web/src/main/js/components/charts/AdvancedTimeline.js b/server/sonar-web/src/main/js/components/charts/AdvancedTimeline.js index 78ff543351f..2f657229c61 100644 --- a/server/sonar-web/src/main/js/components/charts/AdvancedTimeline.js +++ b/server/sonar-web/src/main/js/components/charts/AdvancedTimeline.js @@ -126,7 +126,7 @@ export default class AdvancedTimeline extends React.PureComponent { } else { return scaleLinear() .range([availableHeight, 0]) - .domain([0, max(flatData, d => d.y) || 0]) + .domain([0, max(flatData, d => d.y) || 1]) .nice(); } }; -- 2.39.5