]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7402 make it possible to see more about domain on the overview page
authorStas Vilchik <vilchiks@gmail.com>
Fri, 8 Apr 2016 09:34:59 +0000 (11:34 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Fri, 8 Apr 2016 09:34:59 +0000 (11:34 +0200)
server/sonar-web/src/main/js/apps/overview/main/code-smells.js
server/sonar-web/src/main/js/apps/overview/main/coverage.js
server/sonar-web/src/main/js/apps/overview/main/duplications.js
server/sonar-web/src/main/js/apps/overview/main/risk.js
server/sonar-web/src/main/js/apps/overview/main/structure.js
server/sonar-web/src/main/less/pages/overview.less
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 95fae43f517bc0cfb2af83cbdeeb22a218e1d0c1..d731a4c84d8b16b1ac76200487a8dd0a6560ad47 100644 (file)
@@ -22,7 +22,6 @@ import React from 'react';
 
 import {
     Domain,
-    DomainHeader,
     DomainPanel,
     DomainNutshell,
     DomainLeak,
@@ -91,9 +90,17 @@ export const CodeSmells = React.createClass({
     const { snapshotDate } = this.props.component;
     const formattedSnapshotDate = moment(snapshotDate).format('LLL');
 
+    const domainUrl = window.baseUrl + '/component_measures/domain/Maintainability?id=' +
+        encodeURIComponent(this.props.component.key);
+
     return <Domain>
-      <DomainHeader component={this.props.component}
-                    title={translate('overview.domain.code_smells')}/>
+      <div className="overview-card-header">
+        <div className="overview-title">
+          <a href={domainUrl}>
+            {translate('metric.code_smells.name')}
+          </a>
+        </div>
+      </div>
 
       <DomainPanel>
         <DomainNutshell>
index 8f7709438df9c08c70fabdabfd92787dd0b47f93..4d619bbf3797a458a5c0c5f01eca480ce546cf99 100644 (file)
  */
 import React from 'react';
 
-import { Domain,
-         DomainHeader,
-         DomainPanel,
-         DomainNutshell,
-         DomainLeak,
-         MeasuresList,
-         Measure,
-         DomainMixin } from './components';
+import {
+    Domain,
+    DomainPanel,
+    DomainNutshell,
+    DomainLeak,
+    MeasuresList,
+    Measure,
+    DomainMixin
+} from './components';
 import { DrilldownLink } from '../../../components/shared/drilldown-link';
 import { TooltipsMixin } from '../../../components/mixins/tooltips-mixin';
 import { DonutChart } from '../../../components/charts/donut-chart';
@@ -103,9 +104,17 @@ export const GeneralCoverage = React.createClass({
       { value: 100 - this.props.measures[coverageMetric], fill: '#d4333f' }
     ];
 
+    const domainUrl = window.baseUrl + '/component_measures/domain/Tests?id=' +
+        encodeURIComponent(this.props.component.key);
+
     return <Domain>
-      <DomainHeader component={this.props.component}
-                    title={translate('overview.domain.coverage')}/>
+      <div className="overview-card-header">
+        <div className="overview-title">
+          <a href={domainUrl}>
+            {translate('metric.coverage.name')}
+          </a>
+        </div>
+      </div>
 
       <DomainPanel>
         <DomainNutshell>
index 8077c4d97c4d0b4471545fad57d197e1c269faa4..22162b18718402289c6c43fe608d3da4f68966b9 100644 (file)
@@ -20,7 +20,6 @@
 import React from 'react';
 
 import { Domain,
-         DomainHeader,
          DomainPanel,
          DomainNutshell,
          DomainLeak,
@@ -75,9 +74,17 @@ export const GeneralDuplications = React.createClass({
       { value: Math.max(0, 20 - this.props.measures['duplicated_lines_density']), fill: '#e6e6e6' }
     ];
 
+    const domainUrl = window.baseUrl + '/component_measures/domain/Duplication?id=' +
+        encodeURIComponent(this.props.component.key);
+
     return <Domain>
-      <DomainHeader component={this.props.component}
-                    title={translate('overview.domain.duplications')}/>
+      <div className="overview-card-header">
+        <div className="overview-title">
+          <a href={domainUrl}>
+            {translate('overview.domain.duplications')}
+          </a>
+        </div>
+      </div>
 
       <DomainPanel>
         <DomainNutshell>
index d6cf8f95e02c9c4d745f8a35d91deb2265c46db8..d6942d020562b239263758861f0290ea4b505fd3 100644 (file)
@@ -21,7 +21,6 @@ import moment from 'moment';
 import React from 'react';
 
 import {
-    DomainHeader,
     DomainPanel,
     DomainNutshell,
     DomainLeak,
@@ -92,9 +91,23 @@ export const Risk = React.createClass({
     const bugs = this.props.measures['bugs'] || 0;
     const vulnerabilities = this.props.measures['vulnerabilities'] || 0;
 
+    const bugsDomainUrl = window.baseUrl + '/component_measures/domain/Reliability?id=' +
+        encodeURIComponent(this.props.component.key);
+    const vulnerabilitiesDomainUrl = window.baseUrl + '/component_measures/domain/Security?id=' +
+        encodeURIComponent(this.props.component.key);
+
     return <div className="overview-card overview-card-special">
-      <DomainHeader component={this.props.component}
-                    title={translate('overview.domain.risk')}/>
+      <div className="overview-card-header">
+        <div className="overview-title">
+          <a href={bugsDomainUrl}>
+            {translate('metric.bugs.name')}
+          </a>
+          {' & '}
+          <a href={vulnerabilitiesDomainUrl}>
+            {translate('metric.vulnerabilities.name')}
+          </a>
+        </div>
+      </div>
 
       <DomainPanel>
         <DomainNutshell>
index 2f431e63227513c39988342b1f2b9f7b188e7967..fe0e43bd5e14e1d89f4740511e14e91c8e0fd42b 100644 (file)
@@ -20,7 +20,6 @@
 import React from 'react';
 
 import { Domain,
-         DomainHeader,
          DomainPanel,
          DomainNutshell,
          DomainLeak,
@@ -69,9 +68,17 @@ export const GeneralStructure = React.createClass({
   },
 
   render () {
+    const domainUrl = window.baseUrl + '/component_measures/domain/Size?id=' +
+        encodeURIComponent(this.props.component.key);
+
     return <Domain>
-      <DomainHeader component={this.props.component}
-                    title={translate('overview.domain.structure')}/>
+      <div className="overview-card-header">
+        <div className="overview-title">
+          <a href={domainUrl}>
+            {translate('overview.domain.structure')}
+          </a>
+        </div>
+      </div>
 
       <DomainPanel>
         <DomainNutshell>
index de53c77286eb34711c9ddacb9a56e37c7ca4481a..4970d78111b1e90ad1fd76c63e00e9158a0c0fff 100644 (file)
     font-size: 14px;
     letter-spacing: 0.05em;
   }
+
+  & > a {
+    border-bottom-color: #d0d0d0;
+    color: @baseFontColor;
+
+    &:hover, &:focus {
+      border-bottom-color: @lightBlue;
+      color: @blue;
+    }
+  }
 }
 
 /*
index 1fdfa23b98db60d083fd4e1f1b00aa021333e3cf..1ad63828b9493a890bf43238de0241914c982d05 100644 (file)
@@ -3122,9 +3122,6 @@ overview.gate.view.no_alert=The view has passed the quality gate.
 overview.gate.view.warnings=The view has warnings on the following quality gate conditions: {0}.
 overview.gate.view.errors=The view failed the quality gate on the following conditions: {0}.
 
-overview.domain.risk=Bugs & Vulnerabilities
-overview.domain.code_smells=Code Smells
-overview.domain.coverage=Coverage
 overview.domain.duplications=Duplications
 overview.domain.structure=Structure