]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7708 Reorganize "Code Smells" domain on project page (#1027)
authorStas Vilchik <vilchiks@gmail.com>
Thu, 16 Jun 2016 15:28:47 +0000 (17:28 +0200)
committerGitHub <noreply@github.com>
Thu, 16 Jun 2016 15:28:47 +0000 (17:28 +0200)
it/it-tests/src/test/resources/measure/ProjectOverviewTest/test_project_overview_after_first_analysis.html
server/sonar-web/src/main/js/apps/overview/main/CodeSmells.js

index d9ba349bae6ed4ce30e8112b3618b0d48060cf33..071c91eb3bd83144557274762fe0c5e7782289e6 100644 (file)
@@ -26,8 +26,8 @@
   </tr>
   <tr>
     <td>waitForText</td>
-    <td>id=content</td>
-    <td>*0*A*Code Smells*0*Debt*</td>
+    <td>id=overview-code-smells</td>
+    <td>*0*A*Debt*0*Code Smells*</td>
   </tr>
   <tr>
     <td>waitForText</td>
index 1704d7e0fa9a859bf3658aeba270800e5cbdab02..9d98f14d0019916826d9c5b6ba4d93ad5eff80ed 100644 (file)
@@ -43,7 +43,8 @@ class CodeSmells extends React.Component {
     }
 
     const formattedSnapshotDate = moment(component.snapshotDate).format('LLL');
-    const tooltip = translateWithParameters('widget.as_calculated_on_x', formattedSnapshotDate);
+    const tooltip = translateWithParameters('widget.as_calculated_on_x',
+        formattedSnapshotDate);
 
     return (
         <a href={getComponentIssuesUrl(component.key, params)}>
@@ -83,19 +84,19 @@ class CodeSmells extends React.Component {
           <div className="overview-domain-measures">
             <div className="overview-domain-measure">
               <div className="overview-domain-measure-value">
-                {this.props.renderIssues('new_code_smells', 'CODE_SMELL')}
+                {this.renderDebt('new_technical_debt', 'CODE_SMELL')}
               </div>
               <div className="overview-domain-measure-label">
-                {getMetricName('new_code_smells')}
+                {getMetricName('new_effort')}
               </div>
             </div>
 
             <div className="overview-domain-measure">
               <div className="overview-domain-measure-value">
-                {this.renderDebt('new_technical_debt', 'CODE_SMELL')}
+                {this.props.renderIssues('new_code_smells', 'CODE_SMELL')}
               </div>
               <div className="overview-domain-measure-label">
-                {getMetricName('new_effort')}
+                {getMetricName('new_code_smells')}
               </div>
             </div>
           </div>
@@ -111,13 +112,14 @@ class CodeSmells extends React.Component {
           <div className="overview-domain-measures">
 
             <div className="overview-domain-measure">
-              <div className="display-inline-block text-middle" style={{ paddingLeft: 56 }}>
+              <div className="display-inline-block text-middle"
+                   style={{ paddingLeft: 56 }}>
                 <div className="overview-domain-measure-value">
-                  {this.props.renderIssues('code_smells', 'CODE_SMELL')}
+                  {this.renderDebt('sqale_index', 'CODE_SMELL')}
                   {this.props.renderRating('sqale_rating')}
                 </div>
                 <div className="overview-domain-measure-label">
-                  {getMetricName('code_smells')}
+                  {getMetricName('effort')}
                 </div>
               </div>
             </div>
@@ -125,10 +127,10 @@ class CodeSmells extends React.Component {
             <div className="overview-domain-measure">
               <div className="display-inline-block text-middle">
                 <div className="overview-domain-measure-value">
-                  {this.renderDebt('sqale_index', 'CODE_SMELL')}
+                  {this.props.renderIssues('code_smells', 'CODE_SMELL')}
                 </div>
                 <div className="overview-domain-measure-label">
-                  {getMetricName('effort')}
+                  {getMetricName('code_smells')}
                 </div>
               </div>
             </div>
@@ -141,7 +143,7 @@ class CodeSmells extends React.Component {
 
   render () {
     return (
-        <div className="overview-card">
+        <div className="overview-card" id="overview-code-smells">
           {this.renderHeader()}
 
           <div className="overview-domain-panel">