From 2d5660a9a61d4074644fed44ff535107e714b6d3 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Wed, 9 Dec 2015 09:57:23 +0100 Subject: [PATCH] filter out empty components on the overview treemap --- .../overview/components/domain-treemap.js | 29 ++++++++++--------- 1 file 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'; -- 2.39.5