Skip to content

Commit 9ffda3e

Browse files
committed
Fix issue links
1 parent 19ef1a3 commit 9ffda3e

File tree

11 files changed

+119
-64
lines changed

11 files changed

+119
-64
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ To set environment variables use .env file
4848

4949
| Name | Type | Default | Description |
5050
| ----------------- | ------ | ------- | --------------------------------------------------------- |
51+
| PORT | number | 3000 | Port (for dev server) |
5152
| UI_BASE_URL | string | - | Base URL to proxy requests to ingress (for dev server) |
5253
| JAEGER_API_PATH | string | - | URL path to proxy requests to Jaeger UI (for dev server ) |
5354
| API_BASE_URL | string | - | Base URL to proxy Digma API requests (for dev server) |

src/components/Agentic/IncidentDetails/AdditionalInfo/RelatedIssues/index.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ import {
77
import { useMemo } from "react";
88
import { useAgenticSelector } from "../../../../../containers/Agentic/hooks";
99
import { useGetIncidentQuery } from "../../../../../redux/services/digma";
10-
import type { IncidentIssue } from "../../../../../redux/services/types";
10+
import type { GenericIncidentIssue } from "../../../../../redux/services/types";
1111
import { getIdeLauncherLinkForSpan } from "../../../../../utils/getIdeLauncherLinkForSpan";
1212
import { getInsightTypeInfo } from "../../../../../utils/getInsightTypeInfo";
13-
import { Tag } from "../../../../common/v3/Tag";
1413
import { Tooltip } from "../../../../common/v3/Tooltip";
1514
import {
1615
getTagType,
@@ -45,7 +44,7 @@ import { isErrorIncidentIssue, isInsightIncidentIssue } from "./typeGuards";
4544

4645
const REFRESH_INTERVAL = 10 * 1000; // in milliseconds
4746

48-
const columnHelper = createColumnHelper<IncidentIssue>();
47+
const columnHelper = createColumnHelper<GenericIncidentIssue>();
4948

5049
export const RelatedIssues = () => {
5150
const incidentId = useAgenticSelector((state) => state.incidents.incidentId);
@@ -91,8 +90,8 @@ export const RelatedIssues = () => {
9190
/>
9291
)}
9392
<Tooltip title={label}>
94-
{issue.span_id ? (
95-
<s.Link href={getIdeLauncherLinkForSpan(issue.span_id)}>
93+
{issue.span_uid ? (
94+
<s.Link href={getIdeLauncherLinkForSpan(issue.span_uid)}>
9695
{label}
9796
</s.Link>
9897
) : (
@@ -115,7 +114,11 @@ export const RelatedIssues = () => {
115114
const tagType = getTagType(tagLabel);
116115

117116
return (
118-
<Tag title={issue.criticality} type={tagType} content={tagLabel} />
117+
<s.CriticalityTag
118+
title={issue.criticality}
119+
type={tagType}
120+
content={<s.CriticalityLabel>{tagLabel}</s.CriticalityLabel>}
121+
/>
119122
);
120123
}
121124
})

src/components/Agentic/IncidentDetails/AdditionalInfo/RelatedIssues/styles.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import styled from "styled-components";
22
import { Link as CommonLink } from "../../../../common/v3/Link";
3+
import { Tag } from "../../../../common/v3/Tag";
34
import type { TableCellContentProps } from "./types";
45

56
export const Container = styled.div`
@@ -31,6 +32,16 @@ export const Link = styled(CommonLink)`
3132
text-decoration: underline;
3233
`;
3334

35+
export const CriticalityTag = styled(Tag)`
36+
width: 68px;
37+
max-width: 68px;
38+
`;
39+
40+
export const CriticalityLabel = styled.span`
41+
font-size: 16px;
42+
line-height: 18px;
43+
`;
44+
3445
export const Table = styled.div`
3546
width: 100%;
3647
display: flex;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import type {
22
ErrorIncidentIssue,
3-
IncidentIssue,
3+
GenericIncidentIssue,
44
InsightIncidentIssue
55
} from "../../../../../redux/services/types";
66

77
export const isInsightIncidentIssue = (
8-
issue: IncidentIssue
8+
issue: GenericIncidentIssue
99
): issue is InsightIncidentIssue => issue.type === "issue";
1010

1111
export const isErrorIncidentIssue = (
12-
issue: IncidentIssue
12+
issue: GenericIncidentIssue
1313
): issue is ErrorIncidentIssue => issue.type === "error";

src/components/Agentic/IncidentDetails/AgentFlowChart/MCPServerBlock/styles.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export const MCPServerBlock = styled.div<MCPServerBlockElementProps>`
77
display: flex;
88
align-items: center;
99
justify-content: center;
10+
box-sizing: border-box;
1011
height: ${({ $zoomLevel }) =>
1112
$zoomLevel
1213
? $zoomLevel * DEFAULT_MCP_SERVER_BLOCK_SIZE

src/components/Agentic/IncidentDetails/AgentFlowChart/index.tsx

Lines changed: 71 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -144,17 +144,25 @@ import * as s from "./styles";
144144

145145
const REFRESH_INTERVAL = 10 * 1000; // in milliseconds
146146

147-
const getFlowChartNodeData = (
148-
agent?: Agent,
149-
sideContainerPosition?: Position,
150-
selectedAgentId?: string | null,
151-
zoomLevel?: number
152-
): Partial<FlowChartNodeData> => {
147+
const getFlowChartNodeData = ({
148+
agent,
149+
sideContainerPosition,
150+
zoomLevel,
151+
isSelected,
152+
isInteractive
153+
}: {
154+
agent?: Agent;
155+
sideContainerPosition?: Position;
156+
isInteractive?: boolean;
157+
isSelected?: boolean;
158+
zoomLevel?: number;
159+
}): Partial<FlowChartNodeData> => {
153160
return agent
154161
? {
155162
label: agent.display_name,
156-
isActive: agent.name === selectedAgentId,
163+
isActive: isSelected,
157164
isRunning: agent.running,
165+
isInteractive,
158166
isDisabled: agent.status === "inactive",
159167
sideContainer: {
160168
isVisible: agent.mcp_servers.length > 0,
@@ -216,7 +224,13 @@ export const AgentFlowChart = () => {
216224
case "triager":
217225
case "infra_resolver":
218226
case "code_resolver":
219-
dispatch(setAgentId(id));
227+
{
228+
if (agents?.find((a) => a.name === id)?.status === "inactive") {
229+
break;
230+
}
231+
232+
dispatch(setAgentId(id));
233+
}
220234
break;
221235
case "validator":
222236
default:
@@ -234,12 +248,13 @@ export const AgentFlowChart = () => {
234248
id: "digma",
235249
position: { x: 0, y: -31 }, // TODO: find a way to center this
236250
data: {
237-
...getFlowChartNodeData(
238-
agents?.find((a) => a.name === "digma"),
239-
Position.Top,
240-
agentId,
241-
zoomLevel
242-
),
251+
...getFlowChartNodeData({
252+
agent: agents?.find((a) => a.name === "digma"),
253+
sideContainerPosition: Position.Top,
254+
isSelected: !agentId,
255+
zoomLevel,
256+
isInteractive: true
257+
}),
243258
orientation: "vertical",
244259
type: "input"
245260
}
@@ -248,60 +263,72 @@ export const AgentFlowChart = () => {
248263
id: "watchman",
249264
position: { x: 200, y: 0 },
250265
data: {
251-
...getFlowChartNodeData(
252-
agents?.find((a) => a.name === "watchman"),
253-
Position.Top,
254-
agentId,
255-
zoomLevel
256-
)
266+
...getFlowChartNodeData({
267+
agent: agents?.find((a) => a.name === "watchman"),
268+
sideContainerPosition: Position.Top,
269+
zoomLevel,
270+
isSelected: "watchman" === agentId,
271+
isInteractive:
272+
agents?.find((a) => a.name === "watchman")?.status !==
273+
"inactive"
274+
})
257275
}
258276
},
259277
{
260278
id: "triager",
261279
position: { x: 500, y: 0 },
262280
data: {
263-
...getFlowChartNodeData(
264-
agents?.find((a) => a.name === "triager"),
265-
Position.Top,
266-
agentId,
267-
zoomLevel
268-
)
281+
...getFlowChartNodeData({
282+
agent: agents?.find((a) => a.name === "triager"),
283+
sideContainerPosition: Position.Top,
284+
zoomLevel,
285+
isSelected: "triager" === agentId,
286+
isInteractive:
287+
agents?.find((a) => a.name === "triager")?.status !== "inactive"
288+
})
269289
}
270290
},
271291
{
272292
id: "infra_resolver",
273293
position: { x: 800, y: -50 },
274294
data: {
275-
...getFlowChartNodeData(
276-
agents?.find((a) => a.name === "infra_resolver"),
277-
Position.Top,
278-
agentId,
279-
zoomLevel
280-
)
295+
...getFlowChartNodeData({
296+
agent: agents?.find((a) => a.name === "infra_resolver"),
297+
sideContainerPosition: Position.Top,
298+
zoomLevel,
299+
isSelected: "infra_resolver" === agentId,
300+
isInteractive:
301+
agents?.find((a) => a.name === "infra_resolver")?.status !==
302+
"inactive"
303+
})
281304
}
282305
},
283306
{
284307
id: "code_resolver",
285308
position: { x: 800, y: 50 },
286309
data: {
287-
...getFlowChartNodeData(
288-
agents?.find((a) => a.name === "code_resolver"),
289-
Position.Bottom,
290-
agentId,
291-
zoomLevel
292-
)
310+
...getFlowChartNodeData({
311+
agent: agents?.find((a) => a.name === "code_resolver"),
312+
sideContainerPosition: Position.Bottom,
313+
zoomLevel,
314+
isSelected: "code_resolver" === agentId,
315+
isInteractive:
316+
agents?.find((a) => a.name === "code_resolver")?.status !==
317+
"inactive"
318+
})
293319
}
294320
},
295321
{
296322
id: "validator",
297323
position: { x: 1100, y: 0 },
298324
data: {
299-
...getFlowChartNodeData(
300-
agents?.find((a) => a.name === "validator"),
301-
Position.Top,
302-
agentId,
303-
zoomLevel
304-
),
325+
...getFlowChartNodeData({
326+
agent: agents?.find((a) => a.name === "validator"),
327+
sideContainerPosition: Position.Top,
328+
zoomLevel,
329+
isSelected: false,
330+
isInteractive: false
331+
}),
305332
type: "output"
306333
}
307334
}

src/components/Agentic/common/FlowChart/FlowChartNode/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export type FlowChartNodeData = {
2020
isActive?: boolean;
2121
isRunning?: boolean;
2222
isDisabled?: boolean;
23+
isInteractive?: boolean;
2324
sideContainer?: {
2425
element: ReactNode;
2526
isVisible: boolean;
@@ -35,6 +36,7 @@ export const FlowChartNode = ({ data }: NodeProps<FlowChartNode>) => (
3536
$orientation={data.orientation}
3637
$isActive={data.isActive}
3738
$isDisabled={data.isDisabled}
39+
$isInteractive={data.isInteractive}
3840
>
3941
{data.label && (
4042
<s.Label $orientation={data.orientation}>{data.label}</s.Label>

src/components/Agentic/common/FlowChart/FlowChartNode/styles.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ export const Node = styled.div<ContainerProps>`
2727
: $isActive
2828
? "linear-gradient(180deg, #34384C 0%, #1E2026 100%)"
2929
: "linear-gradient(180deg, #28292D 0%, #1A1B1E 100%), linear-gradient(180deg, rgb(255 255 255 / 10%) 0%, rgb(255 255 255 / 0%) 100%)"};
30+
${({ $isInteractive }) =>
31+
$isInteractive
32+
? ""
33+
: css`
34+
cursor: default;
35+
`};
3036
`;
3137

3238
export const Label = styled.span<ContainerProps>`

src/components/Agentic/common/FlowChart/FlowChartNode/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ export interface ContainerProps {
44
$orientation?: Orientation;
55
$isActive?: boolean;
66
$isDisabled?: boolean;
7+
$isInteractive?: boolean;
78
}

src/redux/services/types.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,31 +1103,32 @@ export interface GetIncidentPayload {
11031103
id: string;
11041104
}
11051105

1106-
export interface InsightIncidentIssue {
1106+
export interface IncidentIssue {
11071107
issue_id: string;
1108-
span_id: string | null;
1108+
span_uid: string | null;
1109+
type: string;
1110+
issue_type: string;
1111+
criticality: number;
1112+
}
1113+
1114+
export interface InsightIncidentIssue extends IncidentIssue {
11091115
type: "issue";
11101116
issue_type: InsightType;
1111-
criticality: number;
11121117
}
11131118

1114-
export interface ErrorIncidentIssue {
1115-
issue_id: string;
1116-
span_id: string | null;
1119+
export interface ErrorIncidentIssue extends IncidentIssue {
11171120
type: "error";
1118-
issue_type: string;
1119-
criticality: number;
11201121
}
11211122

1122-
export type IncidentIssue = InsightIncidentIssue | ErrorIncidentIssue;
1123+
export type GenericIncidentIssue = InsightIncidentIssue | ErrorIncidentIssue;
11231124

11241125
export interface GetIncidentResponse {
11251126
id: string;
11261127
name: string;
11271128
status: string;
11281129
summary: string;
11291130
active_status: IncidentActivityStatus;
1130-
related_issues: IncidentIssue[];
1131+
related_issues: GenericIncidentIssue[];
11311132
affected_services: string[];
11321133
created_at: string;
11331134
closed_at: string | null;

0 commit comments

Comments
 (0)