Skip to content

Commit cba9caf

Browse files
committed
updated colors, error throwing in mcp modal
1 parent e69ceca commit cba9caf

File tree

2 files changed

+15
-8
lines changed
  • apps/sim/app/workspace/[workspaceId]/w
    • [workflowId]/components/panel/components/deploy/components/deploy-modal/components/mcp
    • components/sidebar/components/settings-modal/components/team-management

2 files changed

+15
-8
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/deploy/components/deploy-modal/components/mcp/mcp.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,9 @@ export function McpDeploy({
288288
onSubmittingChange?.(true)
289289
setSaveErrors([])
290290
try {
291-
const nextServerToolsMap = { ...serverToolsMap }
292291
const errors: string[] = []
292+
const addedEntries: Record<string, { tool: WorkflowMcpTool; isLoading: boolean }> = {}
293+
const removedIds: string[] = []
293294

294295
for (const serverId of toAdd) {
295296
setPendingServerChanges((prev) => new Set(prev).add(serverId))
@@ -302,7 +303,7 @@ export function McpDeploy({
302303
toolDescription: toolDescription.trim() || undefined,
303304
parameterSchema,
304305
})
305-
nextServerToolsMap[serverId] = { tool: addedTool, isLoading: false }
306+
addedEntries[serverId] = { tool: addedTool, isLoading: false }
306307
onAddedToServer?.()
307308
logger.info(`Added workflow ${workflowId} as tool to server ${serverId}`)
308309
} catch (error) {
@@ -319,7 +320,7 @@ export function McpDeploy({
319320
}
320321

321322
for (const serverId of toRemove) {
322-
const toolInfo = nextServerToolsMap[serverId]
323+
const toolInfo = serverToolsMap[serverId]
323324
if (!toolInfo?.tool) continue
324325

325326
setPendingServerChanges((prev) => new Set(prev).add(serverId))
@@ -329,7 +330,7 @@ export function McpDeploy({
329330
serverId,
330331
toolId: toolInfo.tool.id,
331332
})
332-
delete nextServerToolsMap[serverId]
333+
removedIds.push(serverId)
333334
} catch (error) {
334335
const serverName = servers.find((s) => s.id === serverId)?.name || serverId
335336
errors.push(`Failed to remove from ${serverName}`)
@@ -346,7 +347,7 @@ export function McpDeploy({
346347
if (shouldUpdateExisting) {
347348
for (const serverId of selectedServerIdsForForm) {
348349
if (toAdd.has(serverId)) continue
349-
const toolInfo = nextServerToolsMap[serverId]
350+
const toolInfo = serverToolsMap[serverId]
350351
if (!toolInfo?.tool) continue
351352

352353
try {
@@ -366,7 +367,13 @@ export function McpDeploy({
366367
}
367368
}
368369

369-
setServerToolsMap(nextServerToolsMap)
370+
setServerToolsMap((prev) => {
371+
const next = { ...prev, ...addedEntries }
372+
for (const id of removedIds) {
373+
delete next[id]
374+
}
375+
return next
376+
})
370377
if (errors.length > 0) {
371378
setSaveErrors(errors)
372379
} else {

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/team-management/team-management.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ export function TeamManagement() {
434434

435435
{/* Team Information */}
436436
<details className='group overflow-hidden rounded-[6px] border border-[var(--border-1)] bg-[var(--surface-5)]'>
437-
<summary className='flex cursor-pointer items-center justify-between px-[14px] py-[10px] font-medium text-[14px] text-[var(--text-primary)] transition-colors hover:bg-white/[0.04] group-open:rounded-b-none'>
437+
<summary className='flex cursor-pointer items-center justify-between px-[14px] py-[10px] font-medium text-[14px] text-[var(--text-primary)] hover:bg-[var(--surface-4)] group-open:rounded-b-none'>
438438
<span>Team Information</span>
439439
<svg
440440
className='h-4 w-4 transition-transform group-open:rotate-180'
@@ -473,7 +473,7 @@ export function TeamManagement() {
473473
{/* Team Billing Information (only show for Team Plan, not Enterprise) */}
474474
{hasTeamPlan && !hasEnterprisePlan && (
475475
<details className='group overflow-hidden rounded-[6px] border border-[var(--border-1)] bg-[var(--surface-5)]'>
476-
<summary className='flex cursor-pointer items-center justify-between px-[14px] py-[10px] font-medium text-[14px] text-[var(--text-primary)] transition-colors hover:bg-white/[0.04] group-open:rounded-b-none'>
476+
<summary className='flex cursor-pointer items-center justify-between px-[14px] py-[10px] font-medium text-[14px] text-[var(--text-primary)] hover:bg-[var(--surface-4)] group-open:rounded-b-none'>
477477
<span>Billing Information</span>
478478
<svg
479479
className='h-4 w-4 transition-transform group-open:rotate-180'

0 commit comments

Comments
 (0)