@@ -3,6 +3,7 @@ import { useMemo } from "react";
33import { useParams } from "react-router" ;
44import { useGetIncidentQuery } from "../../../../../redux/services/digma" ;
55import type { GenericIncidentIssue } from "../../../../../redux/services/types" ;
6+ import { getIdeLauncherLinkForError } from "../../../../../utils/getIdeLauncherLinkForError" ;
67import { getIdeLauncherLinkForSpan } from "../../../../../utils/getIdeLauncherLinkForSpan" ;
78import { getInsightTypeInfo } from "../../../../../utils/getInsightTypeInfo" ;
89import { roundTo } from "../../../../../utils/roundTo" ;
@@ -16,7 +17,6 @@ import {
1617import { getValueLabel } from "../../../../Insights/InsightsCatalog/InsightsPage/InsightCardRenderer/insightCards/common/InsightCard/InsightHeader/InsightIcon/getValueLabel" ;
1718import { Table } from "../Table" ;
1819import * as s from "./styles" ;
19- import { isErrorIncidentIssue , isInsightIncidentIssue } from "./typeGuards" ;
2020
2121const getErrorTagLabel = ( tagType : TagType ) : string => {
2222 switch ( tagType ) {
@@ -65,39 +65,54 @@ export const RelatedIssues = () => {
6565 } ,
6666 cell : ( info ) => {
6767 const issue = info . getValue ( ) ;
68- const insightTypeInfo = isInsightIncidentIssue ( issue )
69- ? getInsightTypeInfo ( issue . issue_type )
70- : undefined ;
7168
72- const label = isInsightIncidentIssue ( issue )
73- ? insightTypeInfo ?. label
74- : isErrorIncidentIssue ( issue )
75- ? issue . issue_type
76- : undefined ;
69+ switch ( issue . type ) {
70+ case "issue" : {
71+ const insightTypeInfo = getInsightTypeInfo ( issue . issue_type ) ;
72+ const label = insightTypeInfo ?. label ;
7773
78- return (
79- < s . IssueInfoContainer >
80- { insightTypeInfo && (
81- < InsightIcon
82- insightTypeInfo = { insightTypeInfo }
83- criticality = { issue . criticality }
84- />
85- ) }
86- < Tooltip title = { label } >
87- { issue . span_uid ? (
88- < s . Link
89- href = { getIdeLauncherLinkForSpan ( issue . span_uid ) }
90- target = { "_blank" }
91- rel = { "noopener noreferrer" }
92- >
93- { label }
94- </ s . Link >
95- ) : (
96- < s . IssueTypeTitle > { label } </ s . IssueTypeTitle >
97- ) }
98- </ Tooltip >
99- </ s . IssueInfoContainer >
100- ) ;
74+ return (
75+ < s . IssueInfoContainer >
76+ { insightTypeInfo && (
77+ < InsightIcon
78+ insightTypeInfo = { insightTypeInfo }
79+ criticality = { issue . criticality }
80+ />
81+ ) }
82+ < Tooltip title = { label } >
83+ { issue . span_uid ? (
84+ < s . Link
85+ href = { getIdeLauncherLinkForSpan ( issue . span_uid ) }
86+ target = { "_blank" }
87+ rel = { "noopener noreferrer" }
88+ >
89+ { label }
90+ </ s . Link >
91+ ) : (
92+ < s . IssueTypeTitle > { label } </ s . IssueTypeTitle >
93+ ) }
94+ </ Tooltip >
95+ </ s . IssueInfoContainer >
96+ ) ;
97+ }
98+ case "error" : {
99+ const label = issue . issue_type ;
100+
101+ return (
102+ < s . IssueInfoContainer >
103+ < Tooltip title = { label } >
104+ < s . Link
105+ href = { getIdeLauncherLinkForError ( issue . issue_id ) }
106+ target = { "_blank" }
107+ rel = { "noopener noreferrer" }
108+ >
109+ { label }
110+ </ s . Link >
111+ </ Tooltip >
112+ </ s . IssueInfoContainer >
113+ ) ;
114+ }
115+ }
101116 }
102117 } ) ,
103118 columnHelper . accessor ( ( x ) => x , {
0 commit comments