From ee72d1678ac7d13fc093ebb90115eb807f7a2568 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Thu, 13 Apr 2017 09:16:13 +0200 Subject: apply feedback on projects visualizations (#1928) * update visualizations descriptions * do not filter provisioned projects out --- .../sonar-web/src/main/js/apps/projects/styles.css | 3 +- .../apps/projects/visualizations/QualityModel.js | 56 +++++++++++----------- 2 files changed, 30 insertions(+), 29 deletions(-) (limited to 'server/sonar-web') diff --git a/server/sonar-web/src/main/js/apps/projects/styles.css b/server/sonar-web/src/main/js/apps/projects/styles.css index 1f9a2fc8477..45f8cd2663b 100644 --- a/server/sonar-web/src/main/js/apps/projects/styles.css +++ b/server/sonar-web/src/main/js/apps/projects/styles.css @@ -199,9 +199,10 @@ .projects-visualizations-footer { margin-top: 8px; - padding: 15px 0; + padding: 15px 60px; border-top: 1px solid #e6e6e6; font-size: 12px; + line-height: 1.4; text-align: center; } diff --git a/server/sonar-web/src/main/js/apps/projects/visualizations/QualityModel.js b/server/sonar-web/src/main/js/apps/projects/visualizations/QualityModel.js index ada545c4dfc..1f8e04e3480 100644 --- a/server/sonar-web/src/main/js/apps/projects/visualizations/QualityModel.js +++ b/server/sonar-web/src/main/js/apps/projects/visualizations/QualityModel.js @@ -56,11 +56,11 @@ export default class QualityModel extends React.PureComponent { getTooltip( project: Project, - x: number, + x: ?number, y: ?number, - size: number, - color1: number, - color2: number + size: ?number, + color1: ?number, + color2: ?number ) { const fullProjectName = this.props.displayOrganizations && project.organization ? `${project.organization.name} / ${project.name}` @@ -77,30 +77,30 @@ export default class QualityModel extends React.PureComponent { } render() { - const items = this.props.projects - .filter( - ({ measures }) => - measures[X_METRIC] != null && - measures[SIZE_METRIC] != null && - measures[COLOR_METRIC_1] != null && - measures[COLOR_METRIC_2] != null - ) - .map(project => { - const x = Number(project.measures[X_METRIC]); - const y = project.measures[Y_METRIC] != null ? Number(project.measures[Y_METRIC]) : null; - const size = Number(project.measures[SIZE_METRIC]); - const color1 = Number(project.measures[COLOR_METRIC_1]); - const color2 = Number(project.measures[COLOR_METRIC_2]); - return { - x, - y: y || 0, - size, - color: RATING_COLORS[Math.max(color1, color2) - 1], - key: project.key, - tooltip: this.getTooltip(project, x, y, size, color1, color2), - link: getProjectUrl(project.key) - }; - }); + const items = this.props.projects.map(project => { + const x = project.measures[X_METRIC] != null ? Number(project.measures[X_METRIC]) : null; + const y = project.measures[Y_METRIC] != null ? Number(project.measures[Y_METRIC]) : null; + const size = project.measures[SIZE_METRIC] != null + ? Number(project.measures[SIZE_METRIC]) + : null; + const color1 = project.measures[COLOR_METRIC_1] != null + ? Number(project.measures[COLOR_METRIC_1]) + : null; + const color2 = project.measures[COLOR_METRIC_2] != null + ? Number(project.measures[COLOR_METRIC_2]) + : null; + return { + x: x || 0, + y: y || 0, + size: size || 0, + color: color1 != null && color2 != null + ? RATING_COLORS[Math.max(color1, color2) - 1] + : undefined, + key: project.key, + tooltip: this.getTooltip(project, x, y, size, color1, color2), + link: getProjectUrl(project.key) + }; + }); const formatXTick = tick => formatMeasure(tick, X_METRIC_TYPE); const formatYTick = tick => formatMeasure(tick, Y_METRIC_TYPE); return ( -- cgit v1.2.3