aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/issues/sidebar
diff options
context:
space:
mode:
authorstanislavh <stanislav.honcharov@sonarsource.com>2023-08-18 14:57:33 +0200
committersonartech <sonartech@sonarsource.com>2023-08-22 20:03:05 +0000
commit46741d608660feeaf3af8aef4980e085b3e2ba5c (patch)
tree2abcc8cf3bdbf7091daf67f89b711529299751ae /server/sonar-web/src/main/js/apps/issues/sidebar
parent8e85496afd806079b9125f351cf5574f65ff8147 (diff)
downloadsonarqube-46741d608660feeaf3af8aef4980e085b3e2ba5c.tar.gz
sonarqube-46741d608660feeaf3af8aef4980e085b3e2ba5c.zip
SONAR-20197 Rules facet filters use CCT
Diffstat (limited to 'server/sonar-web/src/main/js/apps/issues/sidebar')
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/AttributeCategoryFacet.tsx5
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx5
-rw-r--r--server/sonar-web/src/main/js/apps/issues/sidebar/SoftwareQualityFacet.tsx5
3 files changed, 6 insertions, 9 deletions
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/AttributeCategoryFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/AttributeCategoryFacet.tsx
index 28779bd54fb..981f502c3d1 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/AttributeCategoryFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/AttributeCategoryFacet.tsx
@@ -19,6 +19,7 @@
*/
import * as React from 'react';
+import { CLEAN_CODE_CATEGORIES } from '../../../helpers/constants';
import { CleanCodeAttributeCategory } from '../../../types/clean-code-taxonomy';
import { CommonProps, SimpleListStyleFacet } from './SimpleListStyleFacet';
@@ -26,8 +27,6 @@ interface Props extends CommonProps {
categories: Array<CleanCodeAttributeCategory>;
}
-const CATEGORIES = Object.values(CleanCodeAttributeCategory);
-
export function AttributeCategoryFacet(props: Props) {
const { categories = [], ...rest } = props;
@@ -35,7 +34,7 @@ export function AttributeCategoryFacet(props: Props) {
<SimpleListStyleFacet
property="cleanCodeAttributeCategories"
itemNamePrefix="issue.clean_code_attribute_category"
- listItems={CATEGORIES}
+ listItems={CLEAN_CODE_CATEGORIES}
selectedItems={categories}
{...rest}
/>
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx
index 4b9fba32883..6247269a42a 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/SeverityFacet.tsx
@@ -21,6 +21,7 @@
import * as React from 'react';
import DocumentationTooltip from '../../../components/common/DocumentationTooltip';
import SoftwareImpactSeverityIcon from '../../../components/icons/SoftwareImpactSeverityIcon';
+import { IMPACT_SEVERITIES } from '../../../helpers/constants';
import { translate } from '../../../helpers/l10n';
import { SoftwareImpactSeverity } from '../../../types/clean-code-taxonomy';
import { CommonProps, SimpleListStyleFacet } from './SimpleListStyleFacet';
@@ -29,8 +30,6 @@ interface Props extends CommonProps {
severities: SoftwareImpactSeverity[];
}
-const SEVERITIES = Object.values(SoftwareImpactSeverity);
-
export function SeverityFacet(props: Props) {
const { severities = [], ...rest } = props;
@@ -38,7 +37,7 @@ export function SeverityFacet(props: Props) {
<SimpleListStyleFacet
property="impactSeverities"
itemNamePrefix="severity"
- listItems={SEVERITIES}
+ listItems={IMPACT_SEVERITIES}
selectedItems={severities}
renderIcon={(severity: string) => <SoftwareImpactSeverityIcon severity={severity} />}
help={
diff --git a/server/sonar-web/src/main/js/apps/issues/sidebar/SoftwareQualityFacet.tsx b/server/sonar-web/src/main/js/apps/issues/sidebar/SoftwareQualityFacet.tsx
index 2888116505e..0c94d42c751 100644
--- a/server/sonar-web/src/main/js/apps/issues/sidebar/SoftwareQualityFacet.tsx
+++ b/server/sonar-web/src/main/js/apps/issues/sidebar/SoftwareQualityFacet.tsx
@@ -19,6 +19,7 @@
*/
import * as React from 'react';
+import { SOFTWARE_QUALITIES } from '../../../helpers/constants';
import { SoftwareQuality } from '../../../types/clean-code-taxonomy';
import { CommonProps, SimpleListStyleFacet } from './SimpleListStyleFacet';
@@ -26,8 +27,6 @@ interface Props extends CommonProps {
qualities: Array<SoftwareQuality>;
}
-const QUALITIES = Object.values(SoftwareQuality);
-
export function SoftwareQualityFacet(props: Props) {
const { qualities = [], ...rest } = props;
@@ -35,7 +34,7 @@ export function SoftwareQualityFacet(props: Props) {
<SimpleListStyleFacet
property="impactSoftwareQualities"
itemNamePrefix="issue.software_quality"
- listItems={QUALITIES}
+ listItems={SOFTWARE_QUALITIES}
selectedItems={qualities}
{...rest}
/>