aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps
diff options
context:
space:
mode:
author7PH <benjamin.raymond@sonarsource.com>2023-08-29 14:34:05 +0200
committersonartech <sonartech@sonarsource.com>2023-08-30 20:03:06 +0000
commita071713469d8ab358099b913a214aab0aa27cd4a (patch)
treedf920a3ca7b9f7836c2593adc98a696ae588a97e /server/sonar-web/src/main/js/apps
parent41ab6192d3d537d75f37994bf9c223d365366ce1 (diff)
downloadsonarqube-a071713469d8ab358099b913a214aab0aa27cd4a.tar.gz
sonarqube-a071713469d8ab358099b913a214aab0aa27cd4a.zip
SONAR-20023 Keep support for the old severity filter if provided in the URL
Diffstat (limited to 'server/sonar-web/src/main/js/apps')
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/query.ts5
-rw-r--r--server/sonar-web/src/main/js/apps/issues/__tests__/utils-test.ts9
-rw-r--r--server/sonar-web/src/main/js/apps/issues/utils.ts7
3 files changed, 8 insertions, 13 deletions
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/query.ts b/server/sonar-web/src/main/js/apps/coding-rules/query.ts
index eb31bc35298..60385450920 100644
--- a/server/sonar-web/src/main/js/apps/coding-rules/query.ts
+++ b/server/sonar-web/src/main/js/apps/coding-rules/query.ts
@@ -24,7 +24,6 @@ import {
parseAsOptionalBoolean,
parseAsOptionalString,
parseAsString,
- parseImpactSeverityQuery,
queriesEqual,
serializeDateShort,
serializeOptionalBoolean,
@@ -93,7 +92,7 @@ export function parseQuery(query: RawQuery): Query {
),
compareToProfile: parseAsOptionalString(query.compareToProfile),
cwe: parseAsArray(query.cwe, parseAsString),
- impactSeverities: parseImpactSeverityQuery(query.impactSeverities, query.severities),
+ impactSeverities: parseAsArray<SoftwareImpactSeverity>(query.impactSeverities, parseAsString),
impactSoftwareQualities: parseAsArray<SoftwareQuality>(
query.impactSoftwareQualities,
parseAsString
@@ -133,7 +132,7 @@ export function serializeQuery(query: Query): RawQuery {
qprofile: serializeString(query.profile),
repositories: serializeStringArray(query.repositories),
rule_key: serializeString(query.ruleKey),
- severities: undefined,
+ severities: serializeStringArray(query.severities),
sonarsourceSecurity: serializeStringArray(query.sonarsourceSecurity),
statuses: serializeStringArray(query.statuses),
tags: serializeStringArray(query.tags),
diff --git a/server/sonar-web/src/main/js/apps/issues/__tests__/utils-test.ts b/server/sonar-web/src/main/js/apps/issues/__tests__/utils-test.ts
index 15c4260b27c..e366cd670d5 100644
--- a/server/sonar-web/src/main/js/apps/issues/__tests__/utils-test.ts
+++ b/server/sonar-web/src/main/js/apps/issues/__tests__/utils-test.ts
@@ -102,6 +102,7 @@ describe('serialize/deserialize', () => {
s: 'rules',
scopes: 'a,b',
inNewCodePeriod: 'true',
+ severities: 'a,b',
sonarsourceSecurity: 'a,b',
statuses: 'a,b',
tags: 'a,b',
@@ -133,11 +134,7 @@ describe('serialize/deserialize', () => {
cwe: [],
directories: [],
files: [],
- impactSeverities: [
- SoftwareImpactSeverity.Low,
- SoftwareImpactSeverity.High,
- SoftwareImpactSeverity.Medium,
- ],
+ impactSeverities: [SoftwareImpactSeverity.Low],
impactSoftwareQualities: [SoftwareQuality.Maintainability],
inNewCodePeriod: false,
issues: [],
@@ -153,7 +150,7 @@ describe('serialize/deserialize', () => {
resolved: true,
rules: [],
scopes: [],
- severities: [],
+ severities: ['CRITICAL', 'MAJOR'],
sonarsourceSecurity: [],
sort: '',
statuses: [],
diff --git a/server/sonar-web/src/main/js/apps/issues/utils.ts b/server/sonar-web/src/main/js/apps/issues/utils.ts
index f3f9c40661b..81f6e8bf764 100644
--- a/server/sonar-web/src/main/js/apps/issues/utils.ts
+++ b/server/sonar-web/src/main/js/apps/issues/utils.ts
@@ -26,7 +26,6 @@ import {
parseAsBoolean,
parseAsDate,
parseAsString,
- parseImpactSeverityQuery,
queriesEqual,
serializeDateShort,
serializeString,
@@ -106,7 +105,7 @@ export function parseQuery(query: RawQuery): Query {
cwe: parseAsArray(query.cwe, parseAsString),
directories: parseAsArray(query.directories, parseAsString),
files: parseAsArray(query.files, parseAsString),
- impactSeverities: parseImpactSeverityQuery(query.impactSeverities, query.severities),
+ impactSeverities: parseAsArray<SoftwareImpactSeverity>(query.impactSeverities, parseAsString),
impactSoftwareQualities: parseAsArray<SoftwareQuality>(
query.impactSoftwareQualities,
parseAsString
@@ -125,7 +124,7 @@ export function parseQuery(query: RawQuery): Query {
resolved: parseAsBoolean(query.resolved),
rules: parseAsArray(query.rules, parseAsString),
scopes: parseAsArray(query.scopes, parseAsString),
- severities: [],
+ severities: parseAsArray(query.severities, parseAsString),
sonarsourceSecurity: parseAsArray(query.sonarsourceSecurity, parseAsString),
sort: parseAsSort(query.s),
statuses: parseAsArray(query.statuses, parseAsString),
@@ -173,7 +172,7 @@ export function serializeQuery(query: Query): RawQuery {
rules: serializeStringArray(query.rules),
s: serializeString(query.sort),
scopes: serializeStringArray(query.scopes),
- severities: undefined,
+ severities: serializeStringArray(query.severities),
impactSeverities: serializeStringArray(query.impactSeverities),
impactSoftwareQualities: serializeStringArray(query.impactSoftwareQualities),
inNewCodePeriod: query.inNewCodePeriod ? 'true' : undefined,