aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/issues/utils.ts
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2018-07-05 13:34:18 +0200
committerSonarTech <sonartech@sonarsource.com>2018-07-17 20:21:23 +0200
commit051e9f592d84c0ff8ca05a65dbeeb077babb38a0 (patch)
treed33f1653e192f2e02db53d67b408937b64ca9e6b /server/sonar-web/src/main/js/apps/issues/utils.ts
parenta5a7d77e3ae98448888c15863e645a14d549d736 (diff)
downloadsonarqube-051e9f592d84c0ff8ca05a65dbeeb077babb38a0.tar.gz
sonarqube-051e9f592d84c0ff8ca05a65dbeeb077babb38a0.zip
SONAR-10980 Add Standards facet on the Issues page (#473)
Diffstat (limited to 'server/sonar-web/src/main/js/apps/issues/utils.ts')
-rw-r--r--server/sonar-web/src/main/js/apps/issues/utils.ts23
1 files changed, 17 insertions, 6 deletions
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 82df6728898..2cfa7db377d 100644
--- a/server/sonar-web/src/main/js/apps/issues/utils.ts
+++ b/server/sonar-web/src/main/js/apps/issues/utils.ts
@@ -44,24 +44,29 @@ export interface Query {
createdAt: string;
createdBefore: Date | undefined;
createdInLast: string;
+ cwe: string[];
directories: string[];
facetMode: string;
files: string[];
issues: string[];
languages: string[];
modules: string[];
+ owaspTop10: string[];
projects: string[];
- resolved: boolean;
resolutions: string[];
+ resolved: boolean;
rules: string[];
- sort: string;
+ sansTop25: string[];
severities: string[];
sinceLeakPeriod: boolean;
+ sort: string;
statuses: string[];
tags: string[];
types: string[];
}
+export const STANDARDS = 'standards';
+
// allow sorting by CREATION_DATE only
const parseAsSort = (sort: string) => (sort === 'CREATION_DATE' ? 'CREATION_DATE' : '');
const ISSUES_DEFAULT = 'sonarqube.issues.default';
@@ -75,19 +80,22 @@ export function parseQuery(query: RawQuery): Query {
createdAt: parseAsString(query.createdAt),
createdBefore: parseAsDate(query.createdBefore),
createdInLast: parseAsString(query.createdInLast),
+ cwe: parseAsArray(query.cwe, parseAsString),
directories: parseAsArray(query.directories, parseAsString),
facetMode: parseAsFacetMode(query.facetMode),
files: parseAsArray(query.fileUuids, parseAsString),
issues: parseAsArray(query.issues, parseAsString),
languages: parseAsArray(query.languages, parseAsString),
modules: parseAsArray(query.moduleUuids, parseAsString),
+ owaspTop10: parseAsArray(query.owaspTop10, parseAsString),
projects: parseAsArray(query.projectUuids, parseAsString),
- resolved: parseAsBoolean(query.resolved),
resolutions: parseAsArray(query.resolutions, parseAsString),
+ resolved: parseAsBoolean(query.resolved),
rules: parseAsArray(query.rules, parseAsString),
- sort: parseAsSort(query.s),
+ sansTop25: parseAsArray(query.sansTop25, parseAsString),
severities: parseAsArray(query.severities, parseAsString),
sinceLeakPeriod: parseAsBoolean(query.sinceLeakPeriod, false),
+ sort: parseAsSort(query.s),
statuses: parseAsArray(query.statuses, parseAsString),
tags: parseAsArray(query.tags, parseAsString),
types: parseAsArray(query.types, parseAsString)
@@ -109,20 +117,23 @@ export function serializeQuery(query: Query): RawQuery {
createdAt: serializeString(query.createdAt),
createdBefore: serializeDateShort(query.createdBefore),
createdInLast: serializeString(query.createdInLast),
+ cwe: serializeStringArray(query.cwe),
directories: serializeStringArray(query.directories),
facetMode: query.facetMode === 'effort' ? serializeString(query.facetMode) : undefined,
fileUuids: serializeStringArray(query.files),
issues: serializeStringArray(query.issues),
languages: serializeStringArray(query.languages),
moduleUuids: serializeStringArray(query.modules),
+ owaspTop10: serializeStringArray(query.owaspTop10),
projectUuids: serializeStringArray(query.projects),
- resolved: query.resolved ? undefined : 'false',
resolutions: serializeStringArray(query.resolutions),
+ resolved: query.resolved ? undefined : 'false',
+ rules: serializeStringArray(query.rules),
s: serializeString(query.sort),
+ sansTop25: serializeStringArray(query.sansTop25),
severities: serializeStringArray(query.severities),
sinceLeakPeriod: query.sinceLeakPeriod ? 'true' : undefined,
statuses: serializeStringArray(query.statuses),
- rules: serializeStringArray(query.rules),
tags: serializeStringArray(query.tags),
types: serializeStringArray(query.types)
};