diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2015-12-09 09:57:23 +0100 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2015-12-09 16:29:49 +0100 |
commit | 2d5660a9a61d4074644fed44ff535107e714b6d3 (patch) | |
tree | 892de0d515a861c2b37c2074fd9ebe079482c74c /server/sonar-web | |
parent | 1b46233a42f2f36f8e4dace604dbe88510966ace (diff) | |
download | sonarqube-2d5660a9a61d4074644fed44ff535107e714b6d3.tar.gz sonarqube-2d5660a9a61d4074644fed44ff535107e714b6d3.zip |
filter out empty components on the overview treemap
Diffstat (limited to 'server/sonar-web')
-rw-r--r-- | server/sonar-web/src/main/js/apps/overview/components/domain-treemap.js | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/server/sonar-web/src/main/js/apps/overview/components/domain-treemap.js b/server/sonar-web/src/main/js/apps/overview/components/domain-treemap.js index 033a791ead4..03253cbcf5a 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/domain-treemap.js +++ b/server/sonar-web/src/main/js/apps/overview/components/domain-treemap.js @@ -95,20 +95,21 @@ export class DomainTreemap extends React.Component { return this.renderLoading(); } - // TODO filter out zero sized components - let items = this.state.components.map(component => { - let colorMeasure = this.props.colorMetric ? component.measures[this.props.colorMetric] : null; - return { - key: component.key, - name: component.name, - qualifier: component.qualifier, - size: component.measures[this.props.sizeMetric], - color: colorMeasure != null ? this.props.scale(colorMeasure) : '#777', - tooltip: this.getTooltip(component), - label: component.name, - link: getComponentUrl(component.key) - }; - }); + let items = this.state.components + .filter(component => component.measures[this.props.sizeMetric]) + .map(component => { + let colorMeasure = this.props.colorMetric ? component.measures[this.props.colorMetric] : null; + return { + key: component.key, + name: component.name, + qualifier: component.qualifier, + size: component.measures[this.props.sizeMetric], + color: colorMeasure != null ? this.props.scale(colorMeasure) : '#777', + tooltip: this.getTooltip(component), + label: component.name, + link: getComponentUrl(component.key) + }; + }); const canBeClicked = node => node.qualifier !== 'FIL' && node.qualifier !== 'UTS'; |