diff options
author | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-07-07 12:25:02 +0200 |
---|---|---|
committer | Grégoire Aubert <gregoire.aubert@sonarsource.com> | 2017-07-13 14:34:17 +0200 |
commit | f6c60617b20ca2c301b4b2a94cb063d12dbbc758 (patch) | |
tree | 75085b5312d05071a7a3c0be7f03f91567e45f5e | |
parent | 5df7ff772f32072fdc35cee3be3b60c0572c5e75 (diff) | |
download | sonarqube-f6c60617b20ca2c301b4b2a94cb063d12dbbc758.tar.gz sonarqube-f6c60617b20ca2c301b4b2a94cb063d12dbbc758.zip |
SONAR-9403 Show an empty project activity graph instead of a message for metrics that don't have data
-rw-r--r-- | server/sonar-web/src/main/js/apps/projectActivity/utils.js | 4 | ||||
-rw-r--r-- | server/sonar-web/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<Serie>) => - 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(); } }; |