@@ -11,9 +11,11 @@ import type { GenericIncidentIssue } from "../../../../../redux/services/types";
1111import { getIdeLauncherLinkForSpan } from "../../../../../utils/getIdeLauncherLinkForSpan" ;
1212import { getInsightTypeInfo } from "../../../../../utils/getInsightTypeInfo" ;
1313import { roundTo } from "../../../../../utils/roundTo" ;
14+ import type { TagType } from "../../../../common/v3/Tag/types" ;
1415import { Tooltip } from "../../../../common/v3/Tooltip" ;
16+ import { getTagType as getErrorTagType } from "../../../../Errors/Score" ;
1517import {
16- getTagType ,
18+ getTagType as getIssueTagType ,
1719 InsightIcon
1820} from "../../../../Insights/InsightsCatalog/InsightsPage/InsightCardRenderer/insightCards/common/InsightCard/InsightHeader/InsightIcon" ;
1921import { getValueLabel } from "../../../../Insights/InsightsCatalog/InsightsPage/InsightCardRenderer/insightCards/common/InsightCard/InsightHeader/InsightIcon/getValueLabel" ;
@@ -43,6 +45,19 @@ import { isErrorIncidentIssue, isInsightIncidentIssue } from "./typeGuards";
4345// ]
4446// };
4547
48+ const getErrorTagLabel = ( tagType : TagType ) : string => {
49+ switch ( tagType ) {
50+ case "lowSeverity" :
51+ return "Low" ;
52+ case "mediumSeverity" :
53+ return "Medium" ;
54+ case "highSeverity" :
55+ return "High" ;
56+ default :
57+ return "" ;
58+ }
59+ } ;
60+
4661const REFRESH_INTERVAL = 10 * 1000 ; // in milliseconds
4762
4863const columnHelper = createColumnHelper < GenericIncidentIssue > ( ) ;
@@ -82,8 +97,8 @@ export const RelatedIssues = () => {
8297 const label = isInsightIncidentIssue ( issue )
8398 ? insightTypeInfo ?. label
8499 : isErrorIncidentIssue ( issue )
85- ? issue . issue_type
86- : undefined ;
100+ ? issue . issue_type
101+ : undefined ;
87102
88103 return (
89104 < s . IssueInfoContainer >
@@ -118,17 +133,35 @@ export const RelatedIssues = () => {
118133 } ,
119134 cell : ( info ) => {
120135 const issue = info . getValue ( ) ;
121- const tagTitle = `${ roundTo ( issue . criticality * 100 , 0 ) } %` ;
122- const tagLabel = getValueLabel ( issue . criticality ) ;
123- const tagType = getTagType ( tagLabel ) ;
124136
125- return (
126- < s . CriticalityTag
127- title = { tagTitle }
128- type = { tagType }
129- content = { < s . CriticalityLabel > { tagLabel } </ s . CriticalityLabel > }
130- />
131- ) ;
137+ switch ( issue . type ) {
138+ case "issue" : {
139+ const tagLabel = getValueLabel ( issue . criticality ) ;
140+
141+ return (
142+ < s . CriticalityTag
143+ title = { `${ roundTo ( issue . criticality * 100 , 0 ) } %` }
144+ type = { getIssueTagType ( tagLabel ) }
145+ content = { < s . CriticalityLabel > { tagLabel } </ s . CriticalityLabel > }
146+ />
147+ ) ;
148+ }
149+ case "error" : {
150+ const tagType = getErrorTagType ( issue . criticality ) ;
151+
152+ return (
153+ < s . CriticalityTag
154+ title = { issue . criticality }
155+ type = { tagType }
156+ content = {
157+ < s . CriticalityLabel >
158+ { getErrorTagLabel ( tagType ) }
159+ </ s . CriticalityLabel >
160+ }
161+ />
162+ ) ;
163+ }
164+ }
132165 }
133166 } )
134167 ] ;
0 commit comments