]> source.dussan.org Git - sonarqube.git/commitdiff
fix widgets resizing on the overview page
authorStas Vilchik <vilchiks@gmail.com>
Tue, 1 Mar 2016 11:25:49 +0000 (12:25 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 1 Mar 2016 11:25:54 +0000 (12:25 +0100)
server/sonar-web/src/main/js/apps/overview/components/domain-treemap.js
server/sonar-web/src/main/js/apps/overview/components/ncloc-distribution.js

index 635c0cb41e616d04275cdd94884bdb524d17bc0e..3addeefc02b353ca8720eee1a5d54a741ad3f6b2 100644 (file)
@@ -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)}/>;
index 3be2cab002baeb382764acf3de2583501eaf56f5..5e3c3ccb31e6a913484ce0d656eb59610222dca9 100644 (file)
@@ -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>;