]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-12722 Security report hotspot's link point to the new hotspot page
authorPhilippe Perrin <philippe.perrin@sonarsource.com>
Thu, 9 Jan 2020 13:50:31 +0000 (14:50 +0100)
committerSonarTech <sonartech@sonarsource.com>
Mon, 13 Jan 2020 19:46:38 +0000 (20:46 +0100)
server/sonar-web/src/main/js/app/components/extensions/exposeLibraries.ts
server/sonar-web/src/main/js/helpers/urls.ts

index f79ab41aefb810450e5668b63cd714060e3d8e87..dd34f0fc164962cc0f8a4564dec7d43aa928d692 100644 (file)
@@ -86,7 +86,11 @@ import {
   renderSansTop25Category,
   renderSonarSourceSecurityCategory
 } from '../../../helpers/security-standard';
-import { getComponentIssuesUrl, getRulesUrl } from '../../../helpers/urls';
+import {
+  getComponentIssuesUrl,
+  getComponentSecurityHotspotsUrl,
+  getRulesUrl
+} from '../../../helpers/urls';
 import addGlobalSuccessMessage from '../../utils/addGlobalSuccessMessage';
 import throwGlobalError from '../../utils/throwGlobalError';
 import A11ySkipTarget from '../a11y/A11ySkipTarget';
@@ -109,6 +113,7 @@ const exposeLibraries = () => {
     renderSansTop25Category,
     renderSonarSourceSecurityCategory,
     getComponentIssuesUrl,
+    getComponentSecurityHotspotsUrl,
     getRulesUrl
   };
   global.SonarMeasures = { ...measures, formatMeasure };
index da55e2cc2e99220e0d4f3a311499d95b0730b865..5daea42ff6e33b1aca3448ba59a824ff29e22f92 100644 (file)
@@ -73,6 +73,13 @@ export function getComponentIssuesUrl(componentKey: string, query?: Query): Loca
   return { pathname: '/project/issues', query: { ...(query || {}), id: componentKey } };
 }
 
+/**
+ * Generate URL for a component's security hotspot page
+ */
+export function getComponentSecurityHotspotsUrl(componentKey: string): Location {
+  return { pathname: '/security_hotspots', query: { id: componentKey } };
+}
+
 /**
  * Generate URL for a component's drilldown page
  */