diff options
author | Wouter Admiraal <wouter.admiraal@sonarsource.com> | 2023-05-09 15:52:44 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-05-16 20:02:50 +0000 |
commit | a412e8133c13dad2a64aeda574c556d26a68abe0 (patch) | |
tree | d7abb00947803852ec58344f84859749b1d87248 /server/sonar-web/src/main/js/apps/issues/utils.ts | |
parent | fd7ad162b2200b8aee72b9760e9c7aef9eae5182 (diff) | |
download | sonarqube-a412e8133c13dad2a64aeda574c556d26a68abe0.tar.gz sonarqube-a412e8133c13dad2a64aeda574c556d26a68abe0.zip |
SONAR-19197 Allow issues to be filtered by code variant
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.ts | 6 |
1 files changed, 5 insertions, 1 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 400718aa381..d2aee46d244 100644 --- a/server/sonar-web/src/main/js/apps/issues/utils.ts +++ b/server/sonar-web/src/main/js/apps/issues/utils.ts @@ -34,6 +34,7 @@ import { import { get, save } from '../../helpers/storage'; import { isDefined } from '../../helpers/types'; import { Facet, RawFacet } from '../../types/issues'; +import { MetricType } from '../../types/metrics'; import { SecurityStandard } from '../../types/security'; import { Dict, Issue, Paging, RawQuery } from '../../types/types'; import { UserBase } from '../../types/users'; @@ -44,6 +45,7 @@ export interface Query { assigned: boolean; assignees: string[]; author: string[]; + codeVariants: string[]; createdAfter: Date | undefined; createdAt: string; createdBefore: Date | undefined; @@ -111,6 +113,7 @@ export function parseQuery(query: RawQuery): Query { statuses: parseAsArray(query.statuses, parseAsString), tags: parseAsArray(query.tags, parseAsString), types: parseAsArray(query.types, parseAsString), + codeVariants: parseAsArray(query.codeVariants, parseAsString), }; } @@ -157,6 +160,7 @@ export function serializeQuery(query: Query): RawQuery { statuses: serializeStringArray(query.statuses), tags: serializeStringArray(query.tags), types: serializeStringArray(query.types), + codeVariants: serializeStringArray(query.codeVariants), }; return cleanQuery(filter); @@ -182,7 +186,7 @@ export function parseFacets(facets: RawFacet[]): Dict<Facet> { } export function formatFacetStat(stat: number | undefined) { - return stat && formatMeasure(stat, 'SHORT_INT'); + return stat && formatMeasure(stat, MetricType.ShortInteger); } export const searchAssignees = ( |