aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins CI <ci@sonarsource.com>2015-12-10 08:01:23 +0100
committerJenkins CI <ci@sonarsource.com>2015-12-10 08:01:23 +0100
commit39f16286bfcd6dc247352e34f0fb93cc202104c4 (patch)
treeec0a35b568276944da37c197b146086e81245cfd
parent0102d8108a6b40e3876ace01f1df0afbdeb37ddc (diff)
parent4904c052b4e5f7ed0e061655a6b1a8a3e4f8e2ad (diff)
downloadsonarqube-39f16286bfcd6dc247352e34f0fb93cc202104c4.tar.gz
sonarqube-39f16286bfcd6dc247352e34f0fb93cc202104c4.zip
Automatic merge from branch-5.3
* origin/branch-5.3: fix "hide number of failing tasks on then project level page" cut long language names on the overview page hide link icon on very small treemap cells
-rw-r--r--server/sonar-web/src/main/js/apps/background-tasks/stats.js2
-rw-r--r--server/sonar-web/src/main/js/apps/overview/components/language-distribution.js6
-rw-r--r--server/sonar-web/src/main/js/components/charts/treemap.js4
3 files changed, 10 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/stats.js b/server/sonar-web/src/main/js/apps/background-tasks/stats.js
index 2383f8d76fa..d71f1927ef8 100644
--- a/server/sonar-web/src/main/js/apps/background-tasks/stats.js
+++ b/server/sonar-web/src/main/js/apps/background-tasks/stats.js
@@ -62,7 +62,7 @@ export default React.createClass({
return null;
}
- if (this.props.options.component) {
+ if (this.props.options && this.props.options.component) {
return null;
}
diff --git a/server/sonar-web/src/main/js/apps/overview/components/language-distribution.js b/server/sonar-web/src/main/js/apps/overview/components/language-distribution.js
index 848107deaae..a8aa975a959 100644
--- a/server/sonar-web/src/main/js/apps/overview/components/language-distribution.js
+++ b/server/sonar-web/src/main/js/apps/overview/components/language-distribution.js
@@ -29,6 +29,10 @@ export const LanguageDistribution = React.createClass({
}
},
+ cutLanguageName (name) {
+ return name.length > 10 ? `${name.substr(0, 7)}...` : name;
+ },
+
renderBarChart () {
let data = this.props.distribution.split(';').map((point, index) => {
let tokens = point.split('=');
@@ -37,7 +41,7 @@ export const LanguageDistribution = React.createClass({
data = _.sortBy(data, d => -d.x);
- let yTicks = data.map(point => this.getLanguageName(point.value));
+ let yTicks = data.map(point => this.getLanguageName(point.value)).map(this.cutLanguageName);
let yValues = data.map(point => formatMeasure(point.x / this.props.lines * 100, 'PERCENT'));
diff --git a/server/sonar-web/src/main/js/components/charts/treemap.js b/server/sonar-web/src/main/js/components/charts/treemap.js
index 44d54dd698f..fe27224a9be 100644
--- a/server/sonar-web/src/main/js/components/charts/treemap.js
+++ b/server/sonar-web/src/main/js/components/charts/treemap.js
@@ -45,6 +45,10 @@ export const TreemapRect = React.createClass({
return null;
}
+ if (this.props.width < 24 || this.props.height < 24) {
+ return null;
+ }
+
return <a onClick={e => e.stopPropagation()}
className="treemap-link"
href={this.props.link}