Skip to content

Commit 762a621

Browse files
committed
Fix custom MCP icons
1 parent 5031941 commit 762a621

File tree

6 files changed

+24
-17
lines changed

6 files changed

+24
-17
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ export const MCPServerIcon = ({
1313
server
1414
}: MCPServerIconProps) => {
1515
if (server.icon) {
16-
return <s.CustomImage $size={size} src={server.icon.url} />;
16+
return (
17+
<s.CustomImage
18+
$size={size}
19+
src={server.icon.url}
20+
$isActive={server.active}
21+
/>
22+
);
1723
}
1824

1925
if (server.isEditable) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ export const CustomImage = styled.img<CustomImageProps>`
55
width: ${({ $size }) => $size}px;
66
height: ${({ $size }) => $size}px;
77
object-fit: contain;
8+
opacity: ${({ $isActive }) => ($isActive ? 1 : 0.14)};
89
`;

src/components/Agentic/IncidentDetails/AgentFlowChart/MCPServerIcon/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ export interface MCPServerIconProps {
77

88
export interface CustomImageProps {
99
$size: number;
10+
$isActive?: boolean;
1011
}

src/components/Agentic/IncidentTemplate/MCPServerDialog/ToolsStep/index.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import axios from "axios";
2-
import { useEffect, useState, type ChangeEvent } from "react";
2+
import { useState, type ChangeEvent } from "react";
33
import { useDropzone } from "react-dropzone";
44
import { useFormDataRequest } from "../../../../../hooks/useFormDataRequest";
55
import type { MCPServerIcon } from "../../../../../redux/services/types";
@@ -184,7 +184,8 @@ export const ToolsStep = ({
184184
);
185185
const areAllSelected = tools.every((x) => selectedTools.includes(x));
186186

187-
const isSaveButtonEnabled = selectedTools.length > 0 && !isLoading;
187+
const isSaveButtonEnabled =
188+
selectedTools.length > 0 && !isLoading && !isSending;
188189

189190
const handleRemoveFile = () => {
190191
if (isSending) {
@@ -195,15 +196,6 @@ export const ToolsStep = ({
195196
setDropzoneError(undefined);
196197
};
197198

198-
useEffect(() => {
199-
if (icon?.id) {
200-
setFileToUpload(null);
201-
setIconId(icon.id);
202-
} else {
203-
setIconId(null);
204-
}
205-
}, [icon?.id]);
206-
207199
const formattedFileSize = fileDetails
208200
? fileDetails.size >= MAX_ICON_FILE_SIZE
209201
? `${roundTo(fileDetails.size / 1024 / 1024, 0)} MB`

src/components/Agentic/IncidentTemplate/index.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ export const IncidentTemplate = () => {
9292
};
9393

9494
const handleEditMCPServer = (agentId: string, serverName: string) => {
95-
const serverId = mcpServers?.mcps.find((x) => x.name === serverName)?.uid;
95+
const serverId = mcpServers?.mcps.find(
96+
(x) => x.name === serverName && x.agents.includes(agentId)
97+
)?.uid;
9698

9799
if (!serverId) {
98100
return;
@@ -102,8 +104,10 @@ export const IncidentTemplate = () => {
102104
setMCPServerIdToUpdate(serverId);
103105
};
104106

105-
const handleDeleteMCPServer = (_: string, serverName: string) => {
106-
const serverId = mcpServers?.mcps.find((x) => x.name === serverName)?.uid;
107+
const handleDeleteMCPServer = (agentId: string, serverName: string) => {
108+
const serverId = mcpServers?.mcps.find(
109+
(x) => x.name === serverName && x.agents.includes(agentId)
110+
)?.uid;
107111

108112
if (!serverId) {
109113
return;

src/components/Agentic/Sidebar/styles.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,19 @@ export const IncidentsListContainer = styled.div`
5151
display: flex;
5252
flex-direction: column;
5353
gap: 16px;
54-
padding: 24px;
54+
padding: 24px 0;
5555
border-radius: 8px;
5656
border: 1px solid ${({ theme }) => theme.colors.v3.stroke.primary};
5757
background: ${({ theme }) => theme.colors.v3.surface.primary};
5858
flex-grow: 1;
59+
overflow: auto;
5960
`;
6061

6162
export const IncidentsListHeader = styled.div`
6263
display: flex;
6364
justify-content: space-between;
6465
align-items: center;
66+
padding: 0 24px;
6567
`;
6668

6769
export const IncidentsListTitle = styled.div`
@@ -74,7 +76,8 @@ export const IncidentsList = styled.ul`
7476
flex-direction: column;
7577
gap: 4px;
7678
margin: 0;
77-
padding: 0;
79+
padding: 0 24px;
80+
overflow: auto;
7881
`;
7982

8083
export const IncidentItem = styled.li<IncidentItemProps>`

0 commit comments

Comments
 (0)