Skip to content

Commit 490b077

Browse files
committed
Merge branch 'main' into feature/directives
2 parents 20c11e5 + a7e9595 commit 490b077

File tree

25 files changed

+285
-123
lines changed

25 files changed

+285
-123
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22
1+
24

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ To set environment variables use .env file
5454
| API_BASE_URL | string | - | Base URL to proxy Digma API requests (for dev server) |
5555
| AUTH_API_BASE_URL | string | - | Base URL to proxy auth API requests (for dev server) |
5656
| API_TOKEN | string | - | API token (for dev server) |
57-
| USERNAME | string | - | User login (for dev server) |
57+
| LOGIN | string | - | User login (for dev server) |
5858
| PASSWORD | string | - | User password (for dev server) |
5959
| IS_JAEGER_ENABLED | boolean | false | Enable links to Jaeger |
6060
| JAEGER_UI_PATH | string | - | Path to custom Jaeger UI build |

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "digma-ui",
3-
"version": "15.3.0-alpha.7",
3+
"version": "16.0.0",
44
"description": "Digma UI",
55
"scripts": {
66
"lint:eslint": "eslint --cache .",

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

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@ const getFlowChartNodeData = ({
6464
? {
6565
label: agent.display_name,
6666
isActive: isSelected,
67-
isRunning: agent.running,
67+
isRunning: agent.status === "running",
68+
isPending: agent.status === "pending",
6869
isInteractive,
69-
isDisabled: agent.status === "inactive",
70+
isDisabled: agent.status === "skipped",
7071
sideContainers: [
7172
{
7273
isVisible: Boolean(agent.mcp_servers.length > 0 || isEditMode),
@@ -104,8 +105,7 @@ export const AgentFlowChart = ({
104105
name: "digma",
105106
display_name: "Digma",
106107
description: "Digma",
107-
running: false,
108-
status: "active",
108+
status: "waiting",
109109
mcp_servers: []
110110
},
111111
...agents.map((agent) => ({
@@ -118,8 +118,7 @@ export const AgentFlowChart = ({
118118
name: "validator",
119119
display_name: "Validator",
120120
description: "Validator",
121-
running: false,
122-
status: "active",
121+
status: "waiting",
123122
mcp_servers: []
124123
}
125124
];
@@ -138,7 +137,7 @@ export const AgentFlowChart = ({
138137
case "code_resolver":
139138
{
140139
if (
141-
extendedAgents?.find((a) => a.name === id)?.status === "inactive"
140+
extendedAgents?.find((a) => a.name === id)?.status === "skipped"
142141
) {
143142
break;
144143
}
@@ -175,7 +174,7 @@ export const AgentFlowChart = ({
175174
isSelected: "watchman" === selectedAgentId,
176175
isInteractive:
177176
extendedAgents?.find((a) => a.name === "watchman")?.status !==
178-
"inactive",
177+
"skipped",
179178
isEditMode,
180179
onAddMCPServer,
181180
onEditMCPServer,
@@ -192,7 +191,7 @@ export const AgentFlowChart = ({
192191
isSelected: "triager" === selectedAgentId,
193192
isInteractive:
194193
extendedAgents?.find((a) => a.name === "triager")?.status !==
195-
"inactive",
194+
"skipped",
196195
isEditMode,
197196
onAddMCPServer,
198197
onEditMCPServer,
@@ -209,7 +208,7 @@ export const AgentFlowChart = ({
209208
isSelected: "infra_resolver" === selectedAgentId,
210209
isInteractive:
211210
extendedAgents?.find((a) => a.name === "infra_resolver")?.status !==
212-
"inactive",
211+
"skipped",
213212
isEditMode,
214213
onAddMCPServer,
215214
onEditMCPServer,
@@ -226,7 +225,7 @@ export const AgentFlowChart = ({
226225
isSelected: "code_resolver" === selectedAgentId,
227226
isInteractive:
228227
extendedAgents?.find((a) => a.name === "code_resolver")?.status !==
229-
"inactive",
228+
"skipped",
230229
isEditMode,
231230
onAddMCPServer,
232231
onEditMCPServer,

src/components/Agentic/IncidentDetails/AgentFlowChart/mockData.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@ export const mockedAgents: Agent[] = [
55
name: "digma",
66
display_name: "Digma",
77
description: "Digma",
8-
running: false,
9-
status: "active",
8+
status: "waiting",
109
mcp_servers: []
1110
},
1211
{
1312
name: "watchman",
1413
display_name: "Watchman",
1514
description: "Watchman",
16-
running: true,
17-
status: "active",
15+
status: "waiting",
1816
mcp_servers: [
1917
{
2018
name: "github",
@@ -37,7 +35,6 @@ export const mockedAgents: Agent[] = [
3735
name: "triager",
3836
display_name: "Triage",
3937
description: "Triage",
40-
running: false,
4138
status: "pending",
4239
mcp_servers: [
4340
{
@@ -61,7 +58,6 @@ export const mockedAgents: Agent[] = [
6158
name: "infra_resolver",
6259
display_name: "Infra Resolution",
6360
description: "Infra Resolution",
64-
running: false,
6561
status: "pending",
6662
mcp_servers: [
6763
{
@@ -85,8 +81,7 @@ export const mockedAgents: Agent[] = [
8581
name: "code_resolver",
8682
display_name: "Code Resolution",
8783
description: "Code Resolution",
88-
running: false,
89-
status: "inactive",
84+
status: "skipped",
9085
mcp_servers: [
9186
{
9287
name: "github",
@@ -109,7 +104,6 @@ export const mockedAgents: Agent[] = [
109104
name: "validator",
110105
display_name: "Validator",
111106
description: "Validator",
112-
running: false,
113107
status: "pending",
114108
mcp_servers: [
115109
{

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ export const AgentSummary = () => {
3737
);
3838

3939
const isAgentRunning = useMemo(
40-
() => Boolean(agentsData?.agents.find((x) => x.name === agentId)?.running),
40+
() =>
41+
Boolean(
42+
agentsData?.agents.find((x) => x.name === agentId)?.status === "running"
43+
),
4144
[agentsData, agentId]
4245
);
4346

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

Lines changed: 72 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { format } from "date-fns";
22
import { useMemo } from "react";
33
import { useParams } from "react-router";
4+
import { useAgenticDispatch } from "../../../../containers/Agentic/hooks";
45
import { useGetIncidentQuery } from "../../../../redux/services/digma";
6+
import { setIncidentToClose } from "../../../../redux/slices/incidentsSlice";
57
import { Tooltip } from "../../../common/v3/Tooltip";
68
import { Divider } from "./Divider";
79
import * as s from "./styles";
@@ -13,6 +15,7 @@ const REFRESH_INTERVAL = 10 * 1000; // in milliseconds
1315
export const IncidentMetaData = () => {
1416
const params = useParams();
1517
const incidentId = params.id;
18+
const dispatch = useAgenticDispatch();
1619

1720
const { data } = useGetIncidentQuery(
1821
{ id: incidentId ?? "" },
@@ -32,52 +35,83 @@ export const IncidentMetaData = () => {
3235
[data]
3336
);
3437

38+
const handleCloseButtonClick = () => {
39+
if (!incidentId) {
40+
return;
41+
}
42+
43+
dispatch(setIncidentToClose(incidentId));
44+
};
45+
3546
if (!data) {
3647
return <s.Container />;
3748
}
3849

3950
return (
4051
<s.Container>
41-
<s.DateAttribute>
42-
<s.DateLabel>Incident start time:</s.DateLabel>
43-
<Tooltip title={new Date(data.created_at).toString()}>
44-
<s.DateValue>{format(data.created_at, DATE_FORMAT)}</s.DateValue>
45-
</Tooltip>
46-
</s.DateAttribute>
47-
{data.closed_at && (
48-
<>
49-
<s.DividerContainer>
50-
<Divider color={"currentColor"} />
51-
</s.DividerContainer>
52-
<s.DateAttribute>
53-
<s.DateLabel>Incident close time:</s.DateLabel>
54-
<Tooltip title={new Date(data.closed_at).toString()}>
55-
<s.DateValue>{format(data.closed_at, DATE_FORMAT)}</s.DateValue>
52+
<s.AttributesList>
53+
{data.status_timestamps.active && (
54+
<s.Attribute>
55+
<s.AttributeLabel>Incident start time:</s.AttributeLabel>
56+
<Tooltip title={new Date(data.status_timestamps.active).toString()}>
57+
<s.AttributeValue>
58+
{format(data.status_timestamps.active, DATE_FORMAT)}
59+
</s.AttributeValue>
5660
</Tooltip>
57-
</s.DateAttribute>
58-
</>
59-
)}
60-
{data.affected_services.length > 0 && (
61-
<>
62-
<s.DividerContainer>
63-
<Divider color={"currentColor"} />
64-
</s.DividerContainer>
65-
<s.ServicesContainer>
66-
<span>Affected services:</span>
67-
{serviceTagsToShow.map((x) => (
68-
<Tooltip key={x} title={x}>
69-
<s.ServiceTag>{x}</s.ServiceTag>
70-
</Tooltip>
71-
))}
72-
{hiddenServices.length > 0 && (
73-
<Tooltip title={hiddenServices.join(", ")}>
74-
<s.HiddenServicesCountTag>
75-
+{hiddenServices.length}
76-
</s.HiddenServicesCountTag>
61+
</s.Attribute>
62+
)}
63+
{data.status_timestamps.closed && (
64+
<>
65+
<s.DividerContainer>
66+
<Divider color={"currentColor"} />
67+
</s.DividerContainer>
68+
<s.Attribute>
69+
<s.AttributeLabel>Incident close time:</s.AttributeLabel>
70+
<Tooltip
71+
title={new Date(data.status_timestamps.closed).toString()}
72+
>
73+
<s.AttributeValue>
74+
{format(data.status_timestamps.closed, DATE_FORMAT)}
75+
</s.AttributeValue>
7776
</Tooltip>
78-
)}
79-
</s.ServicesContainer>
80-
</>
77+
</s.Attribute>
78+
</>
79+
)}
80+
{data.affected_services.length > 0 && (
81+
<>
82+
<s.DividerContainer>
83+
<Divider color={"currentColor"} />
84+
</s.DividerContainer>
85+
<s.ServicesContainer>
86+
<span>Affected services:</span>
87+
{serviceTagsToShow.map((x) => (
88+
<Tooltip key={x} title={x}>
89+
<s.ServiceTag>{x}</s.ServiceTag>
90+
</Tooltip>
91+
))}
92+
{hiddenServices.length > 0 && (
93+
<Tooltip title={hiddenServices.join(", ")}>
94+
<s.HiddenServicesCountTag>
95+
+{hiddenServices.length}
96+
</s.HiddenServicesCountTag>
97+
</Tooltip>
98+
)}
99+
</s.ServicesContainer>
100+
</>
101+
)}
102+
<s.DividerContainer>
103+
<Divider color={"currentColor"} />
104+
</s.DividerContainer>
105+
<s.Attribute>
106+
<s.AttributeLabel>Status:</s.AttributeLabel>
107+
<s.AttributeValue>{data.status}</s.AttributeValue>
108+
</s.Attribute>
109+
</s.AttributesList>
110+
{data.status === "pending" && (
111+
<s.CloseIncidentButton
112+
label={"Close incident"}
113+
onClick={handleCloseButtonClick}
114+
/>
81115
)}
82116
</s.Container>
83117
);

src/components/Agentic/IncidentDetails/IncidentMetaData/styles.ts

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
import styled from "styled-components";
22
import { subheading1RegularTypography } from "../../../common/App/typographies";
3+
import { NewButton } from "../../../common/v3/NewButton";
34

45
export const Container = styled.div`
56
display: flex;
6-
align-items: center;
77
padding-top: 24px;
8-
height: 51px;
8+
min-height: 51px;
99
flex-shrink: 0;
10+
align-items: start;
11+
`;
12+
13+
export const AttributesList = styled.div`
14+
display: flex;
15+
flex-wrap: wrap;
16+
align-items: center;
1017
`;
1118

1219
export const DividerContainer = styled.div`
@@ -15,22 +22,33 @@ export const DividerContainer = styled.div`
1522
display: flex;
1623
`;
1724

18-
export const DateAttribute = styled.div`
25+
export const CloseIncidentButton = styled(NewButton)`
26+
flex-shrink: 0;
27+
margin-top: 12px;
28+
margin-left: auto;
29+
margin-right: 16px;
30+
`;
31+
32+
export const Attribute = styled.div`
1933
${subheading1RegularTypography}
2034
display: flex;
2135
gap: 12px;
2236
align-items: center;
2337
padding: 16px;
2438
`;
2539

26-
export const DateLabel = styled.span`
40+
export const AttributeLabel = styled.span`
2741
color: ${({ theme }) => theme.colors.v3.text.tertiary};
2842
`;
2943

30-
export const DateValue = styled.span`
44+
export const AttributeValue = styled.span`
3145
color: ${({ theme }) => theme.colors.v3.text.primary};
3246
`;
3347

48+
export const StatusAttributeValue = styled(AttributeValue)`
49+
text-transform: capitalize;
50+
`;
51+
3452
export const ServicesContainer = styled.div`
3553
${subheading1RegularTypography}
3654
display: flex;

src/components/Agentic/IncidentDetails/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export const IncidentDetails = () => {
9191
return null;
9292
}
9393

94-
const incidentStatus = incidentData?.status;
94+
const incidentStatus = incidentData?.status_description;
9595

9696
const agentName = agentsData?.agents.find(
9797
(agent) => agent.name === agentId

0 commit comments

Comments
 (0)