aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2017-01-25 13:56:53 +0100
committerStas Vilchik <vilchiks@gmail.com>2017-01-25 13:56:53 +0100
commit0644be43e7d604609c02f600e7067d6d429137b5 (patch)
tree6a80264dbfb6812aff07900364eacbda8a7b60d6
parent4029e97abc4ee6b5abd2f6e04d9814a8fa31074b (diff)
downloadsonarqube-0644be43e7d604609c02f600e7067d6d429137b5.tar.gz
sonarqube-0644be43e7d604609c02f600e7067d6d429137b5.zip
SONAR-8393 display size rating on project page
-rw-r--r--server/sonar-web/src/main/js/apps/overview/meta/MetaSize.js4
-rw-r--r--server/sonar-web/src/main/js/apps/overview/styles.css4
-rw-r--r--server/sonar-web/src/main/js/components/ui/SizeRating.js9
3 files changed, 11 insertions, 6 deletions
diff --git a/server/sonar-web/src/main/js/apps/overview/meta/MetaSize.js b/server/sonar-web/src/main/js/apps/overview/meta/MetaSize.js
index 8717d86e587..e1c09abf572 100644
--- a/server/sonar-web/src/main/js/apps/overview/meta/MetaSize.js
+++ b/server/sonar-web/src/main/js/apps/overview/meta/MetaSize.js
@@ -22,6 +22,7 @@ import { DrilldownLink } from '../../../components/shared/drilldown-link';
import LanguageDistribution from '../../../components/charts/LanguageDistribution';
import { formatMeasure } from '../../../helpers/measures';
import { getMetricName } from '../helpers/metrics';
+import SizeRating from '../../../components/ui/SizeRating';
export default class MetaSize extends React.Component {
static propTypes = {
@@ -42,6 +43,9 @@ export default class MetaSize extends React.Component {
return (
<div id="overview-size" className="overview-meta-card">
<div id="overview-ncloc" className="overview-meta-size-ncloc">
+ <span className="spacer-right">
+ <SizeRating value={ncloc.value}/>
+ </span>
<DrilldownLink component={this.props.component.key} metric="ncloc">
{formatMeasure(ncloc.value, 'SHORT_INT')}
</DrilldownLink>
diff --git a/server/sonar-web/src/main/js/apps/overview/styles.css b/server/sonar-web/src/main/js/apps/overview/styles.css
index 7bf16ff1941..ad20bb215a1 100644
--- a/server/sonar-web/src/main/js/apps/overview/styles.css
+++ b/server/sonar-web/src/main/js/apps/overview/styles.css
@@ -319,8 +319,8 @@
}
.overview-meta-size-ncloc a {
- line-height: 1;
- font-size: 24px;
+ line-height: 24px;
+ font-size: 18px;
font-weight: 300;
}
diff --git a/server/sonar-web/src/main/js/components/ui/SizeRating.js b/server/sonar-web/src/main/js/components/ui/SizeRating.js
index 1e7a9044601..1a142a85c23 100644
--- a/server/sonar-web/src/main/js/components/ui/SizeRating.js
+++ b/server/sonar-web/src/main/js/components/ui/SizeRating.js
@@ -17,16 +17,17 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+// @flow
import React from 'react';
import classNames from 'classnames';
import inRange from 'lodash/inRange';
import './SizeRating.css';
export default class SizeRating extends React.Component {
- static propTypes = {
- value: React.PropTypes.oneOfType([React.PropTypes.number, React.PropTypes.string]),
- small: React.PropTypes.bool,
- muted: React.PropTypes.bool
+ props: {
+ value: number,
+ small?: boolean,
+ muted?: boolean
};
static defaultProps = {