]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-13462 Correct Portfolio activity links
authorWouter Admiraal <wouter.admiraal@sonarsource.com>
Thu, 28 May 2020 13:25:00 +0000 (15:25 +0200)
committersonartech <sonartech@sonarsource.com>
Tue, 2 Jun 2020 20:05:09 +0000 (20:05 +0000)
server/sonar-web/src/main/js/apps/portfolio/components/MetricBox.tsx
server/sonar-web/src/main/js/apps/portfolio/components/__tests__/__snapshots__/MetricBox-test.tsx.snap
server/sonar-web/src/main/js/apps/portfolio/utils.ts

index 9a4cfcd42966f77bcbcf0b0d6eebf98454eba1dd..f55432c9900b593a2b21c45d87d0c4923ac7e7d2 100644 (file)
@@ -26,6 +26,7 @@ import ActivityLink from '../../../components/common/ActivityLink';
 import MeasuresLink from '../../../components/common/MeasuresLink';
 import Measure from '../../../components/measure/Measure';
 import { getComponentDrilldownUrl } from '../../../helpers/urls';
+import { GraphType } from '../../../types/project-activity';
 import { METRICS_PER_TYPE } from '../utils';
 import Effort from './Effort';
 import MainRating from './MainRating';
@@ -116,7 +117,11 @@ export default function MetricBox({ component, measures, metricKey }: MetricBoxP
           <MeasuresLink component={component} metric={keys.measuresMetric} />
         </div>
         <div>
-          <ActivityLink component={component} metric={keys.activity || keys.rating} />
+          <ActivityLink
+            component={component}
+            metric={keys.activity || keys.rating}
+            graph={GraphType.custom}
+          />
         </div>
       </div>
     </div>
index 58b528b0d45ee890e689bd2cffd46206749fbee6..9abbbb1952299f07cdf050d21b754e72eddfc02b 100644 (file)
@@ -50,7 +50,8 @@ exports[`should render correctly 1`] = `
     <div>
       <ActivityLink
         component="foo"
-        metric="reliability_rating"
+        graph="custom"
+        metric="reliability_rating,bugs"
       />
     </div>
   </div>
@@ -130,6 +131,7 @@ exports[`should render correctly for releasability 1`] = `
     <div>
       <ActivityLink
         component="foo"
+        graph="custom"
         metric="releasability_rating"
       />
     </div>
@@ -210,6 +212,7 @@ exports[`should render correctly for releasability 2`] = `
     <div>
       <ActivityLink
         component="foo"
+        graph="custom"
         metric="releasability_rating"
       />
     </div>
@@ -254,6 +257,7 @@ exports[`should render correctly when no effort 1`] = `
     <div>
       <ActivityLink
         component="foo"
+        graph="custom"
         metric="releasability_rating"
       />
     </div>
index 08caec372088cbf3a1d1148e62f3d1981d38bb3c..2f30a249cef4f2269c3e1781c768f0da4df68ff9 100644 (file)
@@ -66,7 +66,8 @@ export const METRICS_PER_TYPE: T.Dict<MetricKeys> = {
     label: 'metric_domain.Reliability',
     rating: 'reliability_rating',
     effort: 'reliability_rating_effort',
-    last_change: 'last_change_on_reliability_rating'
+    last_change: 'last_change_on_reliability_rating',
+    activity: 'reliability_rating,bugs'
   },
   vulnerabilities: {
     measuresMetric: 'Security',
@@ -81,14 +82,16 @@ export const METRICS_PER_TYPE: T.Dict<MetricKeys> = {
     label: 'portfolio.metric_domain.security_hotspots',
     rating: 'security_review_rating',
     effort: 'security_review_rating_effort',
-    last_change: 'last_change_on_security_review_rating'
+    last_change: 'last_change_on_security_review_rating',
+    activity: 'security_review_rating,security_hotspots'
   },
   maintainability: {
     measuresMetric: 'Maintainability',
     label: 'metric_domain.Maintainability',
     rating: 'sqale_rating',
     effort: 'maintainability_rating_effort',
-    last_change: 'last_change_on_maintainability_rating'
+    last_change: 'last_change_on_maintainability_rating',
+    activity: 'sqale_rating,code_smells'
   }
 };