aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-03-01 12:25:49 +0100
committerStas Vilchik <vilchiks@gmail.com>2016-03-01 12:25:54 +0100
commit8de7cbc9b0565e43a17bdbf2b0fc886a3c248c4f (patch)
treec744aa86dc5781a71ad13f7bb210564a2ca35d56
parent60e564f6c3e2cb95a2a5b527a1e1d49c48fc197d (diff)
downloadsonarqube-8de7cbc9b0565e43a17bdbf2b0fc886a3c248c4f.tar.gz
sonarqube-8de7cbc9b0565e43a17bdbf2b0fc886a3c248c4f.zip
fix widgets resizing on the overview page
-rw-r--r--server/sonar-web/src/main/js/apps/overview/components/domain-treemap.js5
-rw-r--r--server/sonar-web/src/main/js/apps/overview/components/ncloc-distribution.js5
2 files changed, 8 insertions, 2 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 635c0cb41e6..3addeefc02b 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
@@ -133,10 +133,13 @@ export class DomainTreemap extends React.Component {
const canBeClicked = node => node.qualifier !== 'FIL' && node.qualifier !== 'UTS';
+ // FIXME remove this magic number
+ const height = HEIGHT - 35;
+
return <Treemap
items={items}
breadcrumbs={this.state.breadcrumbs}
- height={HEIGHT}
+ height={height}
canBeClicked={canBeClicked}
onRectangleClick={this.handleRectangleClick.bind(this)}
onReset={this.handleReset.bind(this)}/>;
diff --git a/server/sonar-web/src/main/js/apps/overview/components/ncloc-distribution.js b/server/sonar-web/src/main/js/apps/overview/components/ncloc-distribution.js
index 3be2cab002b..5e3c3ccb31e 100644
--- a/server/sonar-web/src/main/js/apps/overview/components/ncloc-distribution.js
+++ b/server/sonar-web/src/main/js/apps/overview/components/ncloc-distribution.js
@@ -104,6 +104,9 @@ export const NclocDistribution = React.createClass({
},
render () {
+ const componentsCount = this.state.components ? this.state.components.length : 1;
+ const height = componentsCount * 25;
+
return <div className="overview-domain-chart">
<div className="overview-card-header">
<h2 className="overview-title">{translate('overview.chart.components')}</h2>
@@ -111,7 +114,7 @@ export const NclocDistribution = React.createClass({
{translateWithParameters('overview.chart.legend.size_x', translate('metric.ncloc.name'))}
</span>
</div>
- <div className="overview-bar-chart" style={{ height: HEIGHT }}>
+ <div className="overview-bar-chart" style={{ height }}>
{this.renderBarChart()}
</div>
</div>;