aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-12-02 15:01:20 +0100
committerStas Vilchik <vilchiks@gmail.com>2015-12-02 15:25:48 +0100
commit78e12d6af59b774ee6f3fa16e38aa35caab159d7 (patch)
tree048adf514083bcaa1789638d8290bee9523d53b4 /server/sonar-web
parent334f0603c306a73bea460e1f04bf8a2b013428ab (diff)
downloadsonarqube-78e12d6af59b774ee6f3fa16e38aa35caab159d7.tar.gz
sonarqube-78e12d6af59b774ee6f3fa16e38aa35caab159d7.zip
improve display of overview pages when no coverage or duplications details available
Diffstat (limited to 'server/sonar-web')
-rw-r--r--server/sonar-web/src/main/js/apps/overview/domains/coverage-domain.js14
-rw-r--r--server/sonar-web/src/main/js/apps/overview/domains/duplications-domain.js14
2 files changed, 27 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/apps/overview/domains/coverage-domain.js b/server/sonar-web/src/main/js/apps/overview/domains/coverage-domain.js
index d79f7846f51..f9aabc06ec6 100644
--- a/server/sonar-web/src/main/js/apps/overview/domains/coverage-domain.js
+++ b/server/sonar-web/src/main/js/apps/overview/domains/coverage-domain.js
@@ -36,7 +36,7 @@ export const CoverageMain = React.createClass({
ready: true,
measures,
leak,
- coverageMetricPrefix: this.getCoverageMetricPrefix(measures),
+ coverageMetricPrefix: this.getCoverageMetricPrefix(measures)
});
});
},
@@ -73,6 +73,14 @@ export const CoverageMain = React.createClass({
</div>;
},
+ renderEmpty() {
+ return <div className="overview-detailed-page">
+ <div className="page">
+ <p>{window.t('overview.no_coverage')}</p>
+ </div>
+ </div>;
+ },
+
renderLegend () {
return <DomainLeakTitle inline={true} label={this.state.leakPeriodLabel} date={this.state.leakPeriodDate}/>
},
@@ -89,6 +97,10 @@ export const CoverageMain = React.createClass({
let coverageMetric = this.state.coverageMetricPrefix + 'coverage',
uncoveredLinesMetric = this.state.coverageMetricPrefix + 'uncovered_lines';
+ if (this.state.measures[coverageMetric] == null) {
+ return this.renderEmpty();
+ }
+
return <div className="overview-detailed-page">
<div className="overview-cards-list">
<div className="overview-card overview-card-fixed-width">
diff --git a/server/sonar-web/src/main/js/apps/overview/domains/duplications-domain.js b/server/sonar-web/src/main/js/apps/overview/domains/duplications-domain.js
index fe4cae3afac..785ca31ae65 100644
--- a/server/sonar-web/src/main/js/apps/overview/domains/duplications-domain.js
+++ b/server/sonar-web/src/main/js/apps/overview/domains/duplications-domain.js
@@ -64,6 +64,14 @@ export const DuplicationsMain = React.createClass({
</div>;
},
+ renderEmpty() {
+ return <div className="overview-detailed-page">
+ <div className="page">
+ <p>{window.t('overview.no_duplications')}</p>
+ </div>
+ </div>;
+ },
+
renderLegend () {
return <DomainLeakTitle inline={true} label={this.state.leakPeriodLabel} date={this.state.leakPeriodDate}/>
},
@@ -81,9 +89,15 @@ export const DuplicationsMain = React.createClass({
if (!this.state.ready) {
return this.renderLoading();
}
+
+ if (this.state.measures['duplicated_lines_density'] == null) {
+ return this.renderEmpty();
+ }
+
let treemapScale = d3.scale.linear()
.domain([0, 25, 50, 75, 100])
.range(CHART_COLORS_RANGE_PERCENT);
+
return <div className="overview-detailed-page">
<div className="overview-cards-list">
<div className="overview-card overview-card-fixed-width">