]> source.dussan.org Git - sonarqube.git/commitdiff
improve rendering of ratings on project overview page
authorStas Vilchik <vilchiks@gmail.com>
Fri, 1 Apr 2016 15:26:29 +0000 (17:26 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Fri, 1 Apr 2016 15:26:29 +0000 (17:26 +0200)
server/sonar-web/src/main/js/apps/overview/main/code-smells.js
server/sonar-web/src/main/js/apps/overview/main/risk.js
server/sonar-web/src/main/less/pages/overview.less

index ff53578e60d24e744b4beae38da3e0bac5d616f6..b5024d444f4f72dcdf8b68ebad80ed6aca154e7c 100644 (file)
@@ -99,39 +99,35 @@ export const CodeSmells = React.createClass({
           <MeasuresList>
 
             <Measure composite={true}>
-              <div className="display-inline-block text-middle big-spacer-right">
-                <div
-                    className="overview-domain-measure-value"
-                    title={translateWithParameters('widget.as_calculated_on_x', formattedSnapshotDate)}
-                    data-toggle="tooltip">
-                  <DrilldownLink component={this.props.component.key} metric="sqale_rating">
-                    <Rating value={this.props.measures['sqale_rating']}/>
-                  </DrilldownLink>
-                </div>
-              </div>
-              <div className="display-inline-block text-middle">
-                <div
-                    className="overview-domain-measure-value"
-                    title={translateWithParameters('widget.as_calculated_on_x', formattedSnapshotDate)}
-                    data-toggle="tooltip">
-                  <DrilldownLink component={this.props.component.key} metric="sqale_index">
-                    {formatMeasure(debt, 'SHORT_WORK_DUR')}
-                  </DrilldownLink>
+              <div className="display-inline-block text-middle" style={{ paddingLeft: 56 }}>
+                <div className="overview-domain-measure-value">
+                  <IssuesLink
+                      component={this.props.component.key}
+                      params={{ resolved: 'false', types: 'CODE_SMELL' }}>
+                    <span
+                        title={translateWithParameters('widget.as_calculated_on_x', formattedSnapshotDate)}
+                        data-toggle="tooltip">
+                      {formatMeasure(codeSmells, 'SHORT_INT')}
+                    </span>
+                  </IssuesLink>
+                  <div className="overview-domain-measure-sup">
+                    <DrilldownLink component={this.props.component.key} metric="sqale_rating">
+                      <Rating value={this.props.measures['sqale_rating']}/>
+                    </DrilldownLink>
+                  </div>
                 </div>
-                <div className="overview-domain-measure-label">{getMetricName('effort')}</div>
+                <div className="overview-domain-measure-label">{getMetricName('code_smells')}</div>
               </div>
             </Measure>
 
-            <Measure label={getMetricName('code_smells')}>
-              <IssuesLink
-                  component={this.props.component.key}
-                  params={{ resolved: 'false', types: 'CODE_SMELL' }}>
+            <Measure label={getMetricName('effort')}>
+              <DrilldownLink component={this.props.component.key} metric="sqale_index">
                 <span
                     title={translateWithParameters('widget.as_calculated_on_x', formattedSnapshotDate)}
                     data-toggle="tooltip">
-                  {formatMeasure(codeSmells, 'SHORT_INT')}
+                  {formatMeasure(debt, 'SHORT_WORK_DUR')}
                 </span>
-              </IssuesLink>
+              </DrilldownLink>
             </Measure>
           </MeasuresList>
           {this.renderTimeline('before', true)}
index c732299dfb6d582135d3c61c6a73f83c8919d764..6cc95ad5811b4eb757d9254b1b14ea4c2ac6fd9f 100644 (file)
@@ -102,17 +102,7 @@ export const Risk = React.createClass({
           <MeasuresList>
 
             <Measure composite={true}>
-              <div className="display-inline-block text-middle big-spacer-right">
-                <div
-                    className="overview-domain-measure-value"
-                    title={translateWithParameters('widget.as_calculated_on_x', formattedSnapshotDate)}
-                    data-toggle="tooltip">
-                  <DrilldownLink component={this.props.component.key} metric="reliability_rating">
-                    <Rating value={this.props.measures['reliability_rating']}/>
-                  </DrilldownLink>
-                </div>
-              </div>
-              <div className="display-inline-block text-middle">
+              <div className="display-inline-block text-middle" style={{ paddingLeft: 56 }}>
                 <div className="overview-domain-measure-value">
                   <IssuesLink
                       component={this.props.component.key}
@@ -123,22 +113,17 @@ export const Risk = React.createClass({
                       {formatMeasure(bugs, 'SHORT_INT')}
                     </span>
                   </IssuesLink>
+                  <div className="overview-domain-measure-sup">
+                    <DrilldownLink component={this.props.component.key} metric="reliability_rating">
+                      <Rating value={this.props.measures['reliability_rating']}/>
+                    </DrilldownLink>
+                  </div>
                 </div>
                 <div className="overview-domain-measure-label">{getMetricName('bugs')}</div>
               </div>
             </Measure>
 
             <Measure composite={true}>
-              <div className="display-inline-block text-middle big-spacer-right">
-                <div
-                    className="overview-domain-measure-value"
-                    title={translateWithParameters('widget.as_calculated_on_x', formattedSnapshotDate)}
-                    data-toggle="tooltip">
-                  <DrilldownLink component={this.props.component.key} metric="security_rating">
-                    <Rating value={this.props.measures['security_rating']}/>
-                  </DrilldownLink>
-                </div>
-              </div>
               <div className="display-inline-block text-middle">
                 <div className="overview-domain-measure-value">
                   <IssuesLink
@@ -150,6 +135,11 @@ export const Risk = React.createClass({
                       {formatMeasure(vulnerabilities, 'SHORT_INT')}
                     </span>
                   </IssuesLink>
+                  <div className="overview-domain-measure-sup">
+                    <DrilldownLink component={this.props.component.key} metric="security_rating">
+                      <Rating value={this.props.measures['security_rating']}/>
+                    </DrilldownLink>
+                  </div>
                 </div>
                 <div className="overview-domain-measure-label">{getMetricName('vulnerabilities')}</div>
               </div>
index c87ce90ba4d917b67871be2fc749a268c524674d..de53c77286eb34711c9ddacb9a56e37c7ca4481a 100644 (file)
   .overview-domain-leak & { text-align: center; }
 }
 
+.overview-domain-measure-sup {
+  display: inline-block;
+  vertical-align: top;
+  margin-top: -4px;
+  margin-left: 6px;
+  font-size: 16px;
+}
+
 .overview-domain-timeline {
   position: absolute;
   z-index: 1;