aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src
diff options
context:
space:
mode:
authorMathieu Suen <mathieu.suen@sonarsource.com>2022-03-21 14:20:27 +0100
committersonartech <sonartech@sonarsource.com>2022-03-22 20:02:36 +0000
commite923c67b06d2449f35fa7373c9562a68c17df31d (patch)
tree914112973489d4597796f04036195eaa21b3b266 /server/sonar-web/src
parent77efa75029d4ed526970ceb1fe300635927c2a39 (diff)
downloadsonarqube-e923c67b06d2449f35fa7373c9562a68c17df31d.tar.gz
sonarqube-e923c67b06d2449f35fa7373c9562a68c17df31d.zip
SONAR-16155 Adding filter on security report link to hotspot page
Diffstat (limited to 'server/sonar-web/src')
-rw-r--r--server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsApp.tsx1
-rw-r--r--server/sonar-web/src/main/js/helpers/__tests__/urls-test.ts16
-rw-r--r--server/sonar-web/src/main/js/helpers/urls.ts1
3 files changed, 17 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsApp.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsApp.tsx
index f8a2a7dbe5f..e774afc2b45 100644
--- a/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsApp.tsx
+++ b/server/sonar-web/src/main/js/apps/security-hotspots/SecurityHotspotsApp.tsx
@@ -447,6 +447,7 @@ export class SecurityHotspotsApp extends React.PureComponent<Props, State> {
[SecurityStandard.OWASP_TOP10]: undefined,
[SecurityStandard.SANS_TOP25]: undefined,
[SecurityStandard.SONARSOURCE]: undefined,
+ [SecurityStandard.OWASP_TOP10_2021]: undefined,
file: undefined
}
});
diff --git a/server/sonar-web/src/main/js/helpers/__tests__/urls-test.ts b/server/sonar-web/src/main/js/helpers/__tests__/urls-test.ts
index 63fc209c51f..81cfc0f0fa8 100644
--- a/server/sonar-web/src/main/js/helpers/__tests__/urls-test.ts
+++ b/server/sonar-web/src/main/js/helpers/__tests__/urls-test.ts
@@ -20,6 +20,7 @@
import { AlmKeys } from '../../types/alm-settings';
import { ComponentQualifier } from '../../types/component';
import { IssueType } from '../../types/issues';
+import { SecurityStandard } from '../../types/security';
import { mockBranch, mockMainBranch, mockPullRequest } from '../mocks/branch-like';
import {
convertGithubApiUrlToLink,
@@ -88,11 +89,24 @@ describe('#getComponentSecurityHotspotsUrl', () => {
expect(
getComponentSecurityHotspotsUrl(SIMPLE_COMPONENT_KEY, {
sinceLeakPeriod: 'true',
+ [SecurityStandard.OWASP_TOP10_2021]: 'a1',
+ [SecurityStandard.CWE]: 'a1',
+ [SecurityStandard.OWASP_TOP10]: 'a1',
+ [SecurityStandard.SANS_TOP25]: 'a1',
+ [SecurityStandard.SONARSOURCE]: 'a1',
ignoredParam: '1234'
})
).toEqual({
pathname: '/security_hotspots',
- query: { id: SIMPLE_COMPONENT_KEY, sinceLeakPeriod: 'true' }
+ query: {
+ id: SIMPLE_COMPONENT_KEY,
+ [SecurityStandard.OWASP_TOP10_2021]: 'a1',
+ [SecurityStandard.CWE]: 'a1',
+ [SecurityStandard.OWASP_TOP10]: 'a1',
+ [SecurityStandard.SANS_TOP25]: 'a1',
+ [SecurityStandard.SONARSOURCE]: 'a1',
+ sinceLeakPeriod: 'true'
+ }
});
});
});
diff --git a/server/sonar-web/src/main/js/helpers/urls.ts b/server/sonar-web/src/main/js/helpers/urls.ts
index cfcf6564696..3051feb0f29 100644
--- a/server/sonar-web/src/main/js/helpers/urls.ts
+++ b/server/sonar-web/src/main/js/helpers/urls.ts
@@ -144,6 +144,7 @@ export function getComponentSecurityHotspotsUrl(componentKey: string, query: Que
assignedToMe,
file,
...pick(query, [
+ SecurityStandard.OWASP_TOP10_2021,
SecurityStandard.SONARSOURCE,
SecurityStandard.OWASP_TOP10,
SecurityStandard.SANS_TOP25,