From be5f38aad4af03268722e3f4fff85d1127406095 Mon Sep 17 00:00:00 2001 From: stanislavh Date: Mon, 21 Aug 2023 16:00:31 +0200 Subject: [PATCH] SONAR-20023 Add severity icons to new facet --- .../src/main/js/apps/issues/sidebar/SeverityFacet.tsx | 2 ++ .../src/main/js/apps/issues/sidebar/SimpleListStyleFacet.tsx | 3 +++ 2 files changed, 5 insertions(+) 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 4d0329681a6..cf878fcdb9f 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 @@ -20,6 +20,7 @@ import * as React from 'react'; import DocumentationTooltip from '../../../components/common/DocumentationTooltip'; +import SoftwareImpactSeverityIcon from '../../../components/icons/SoftwareImpactSeverityIcon'; import { translate } from '../../../helpers/l10n'; import { SoftwareImpactSeverity } from '../../../types/issues'; import { CommonProps, SimpleListStyleFacet } from './SimpleListStyleFacet'; @@ -39,6 +40,7 @@ export function SeverityFacet(props: Props) { itemNamePrefix="severity" listItems={SEVERITIES} selectedItems={severities} + renderIcon={(severity: string) => } help={ extends CommonProps { listItems: Array; itemNamePrefix: string; selectedItems: Array; + renderIcon?: (item: string) => React.ReactNode; } export function SimpleListStyleFacet(props: Props) { @@ -55,6 +56,7 @@ export function SimpleListStyleFacet(props: Props) { listItems, itemNamePrefix, help, + renderIcon, } = props; const nbSelectableItems = listItems.filter((item) => stats[item]).length; @@ -86,6 +88,7 @@ export function SimpleListStyleFacet(props: Props) { active={active} className="it__search-navigator-facet" key={item} + icon={renderIcon?.(item)} name={translate(itemNamePrefix, item)} onClick={(itemValue, multiple) => { if (multiple) { -- 2.39.5