aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-08-11 11:44:01 +0200
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-08-14 11:44:44 +0200
commit17d12ea757e29e084ab61e4071e80a249e45e225 (patch)
tree96d7e08ce64ec19717beb213464c3d0d8cac32e0 /server/sonar-web/src/main/js
parentdbd5f70a261ac7033f09098eb245ccf2b3b29334 (diff)
downloadsonarqube-17d12ea757e29e084ab61e4071e80a249e45e225.tar.gz
sonarqube-17d12ea757e29e084ab61e4071e80a249e45e225.zip
SONAR-9608 Improve no result rendering on treemaps
Diffstat (limited to 'server/sonar-web/src/main/js')
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.js1
-rw-r--r--server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.js12
2 files changed, 10 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.js b/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.js
index aa8bafa94f2..5c95697b671 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/FilesView.js
@@ -124,6 +124,7 @@ export default class ListView extends React.PureComponent {
selectedComponent={this.props.selectedKey}
/>
{this.props.paging &&
+ this.props.components.length > 0 &&
<ListFooter
count={this.props.components.length}
total={this.props.paging.total}
diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.js b/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.js
index 3029c9a6263..30fcc2f0dc7 100644
--- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.js
+++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/TreeMapView.js
@@ -21,10 +21,11 @@
import React from 'react';
import { AutoSizer } from 'react-virtualized';
import { scaleLinear, scaleOrdinal } from 'd3-scale';
-import QualifierIcon from '../../../components/icons-components/QualifierIcon';
-import TreeMap from '../../../components/charts/TreeMap';
import ColorBoxLegend from '../../../components/charts/ColorBoxLegend';
import ColorGradientLegend from '../../../components/charts/ColorGradientLegend';
+import EmptyResult from './EmptyResult';
+import QualifierIcon from '../../../components/icons-components/QualifierIcon';
+import TreeMap from '../../../components/charts/TreeMap';
import { translate, translateWithParameters, getLocalizedMetricName } from '../../../helpers/l10n';
import { formatMeasure, isDiffMetric } from '../../../helpers/measures';
import { getComponentUrl } from '../../../helpers/urls';
@@ -164,6 +165,11 @@ export default class TreeMapView extends React.PureComponent {
}
render() {
+ const { treemapItems } = this.state;
+ if (treemapItems.length <= 0) {
+ return <EmptyResult />;
+ }
+
return (
<div className="measure-details-treemap">
<ul className="list-inline note spacer-bottom">
@@ -186,7 +192,7 @@ export default class TreeMapView extends React.PureComponent {
<AutoSizer>
{({ width }) =>
<TreeMap
- items={this.state.treemapItems}
+ items={treemapItems}
onRectangleClick={this.props.handleSelect}
height={HEIGHT}
width={width}