From b819a7c2e7c052e35adee06fd606a371675bb5a0 Mon Sep 17 00:00:00 2001 From: a7m-1st Date: Wed, 7 Jan 2026 02:03:26 +0300 Subject: [PATCH] chore: rename to "Google Gmail MCP" to match database --- src/components/AddWorker/ToolSelect.tsx | 22 +++++++++++----------- src/hooks/useIntegrationManagement.ts | 4 ++-- src/pages/Setting/MCP.tsx | 16 ++++++++-------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/components/AddWorker/ToolSelect.tsx b/src/components/AddWorker/ToolSelect.tsx index d18d0a4c..d0f3a553 100644 --- a/src/components/AddWorker/ToolSelect.tsx +++ b/src/components/AddWorker/ToolSelect.tsx @@ -168,7 +168,7 @@ const ToolSelect = forwardRef< } }; - } else if (key.toLowerCase() === 'google gmail') { + } else if (key.toLowerCase() === 'google gmail mcp') { onInstall = async () => { try { const response = await fetchPost("/install/tool/google_gmail"); @@ -177,13 +177,13 @@ const ToolSelect = forwardRef< const existingConfigs = await proxyFetchGet("/api/configs"); const existing = Array.isArray(existingConfigs) ? existingConfigs.find((c: any) => - c.config_group?.toLowerCase() === "google gmail" && + c.config_group?.toLowerCase() === "google gmail mcp" && c.config_name === "GOOGLE_REFRESH_TOKEN" ) : null; const configPayload = { - config_group: "Google Gmail", + config_group: "Google Gmail MCP", //According to backend config config_name: "GOOGLE_REFRESH_TOKEN", config_value: "exists", }; @@ -197,7 +197,7 @@ const ToolSelect = forwardRef< console.log("Google Gmail installed successfully"); // After successful installation, add to selected tools const gmailItem = { - id: 0, // Use 0 for integration items + id: 1, // Use 1 for integration items key: key, name: key, description: "Google Gmail integration for managing emails and contacts", @@ -244,7 +244,7 @@ const ToolSelect = forwardRef< ? t("layout.notion-workspace-integration") : key.toLowerCase() === 'google calendar' ? t("layout.google-calendar-integration") - : key.toLowerCase() === 'google gmail' + : key.toLowerCase() === 'google gmail mcp' ? "Google Gmail integration for managing emails and contacts" : "", onInstall, @@ -522,7 +522,7 @@ const ToolSelect = forwardRef< } // Trigger instantiation for Gmail - if (activeMcp.key === "Gmail") { + if (activeMcp.key === "Google Gmail MCP") { console.log("[ToolSelect installMcp] Starting Gmail installation"); try { const response = await fetchPost("/install/tool/google_gmail"); @@ -533,13 +533,13 @@ const ToolSelect = forwardRef< const existingConfigs = await proxyFetchGet("/api/configs"); const existing = Array.isArray(existingConfigs) ? existingConfigs.find((c: any) => - c.config_group?.toLowerCase() === "gmail" && + c.config_group?.toLowerCase() === "google gmail mcp" && c.config_name === "GOOGLE_REFRESH_TOKEN" ) : null; const configPayload = { - config_group: "Gmail", + config_group: "Google Gmail MCP", config_name: "GOOGLE_REFRESH_TOKEN", config_value: "exists", }; @@ -558,7 +558,7 @@ const ToolSelect = forwardRef< key: activeMcp.key, name: activeMcp.name, description: "Gmail integration for managing emails, drafts, labels, and contacts", - toolkit: "google_gmail_toolkit", + toolkit: "google_gmail_native_toolkit", isLocal: true }; addOption(selectedItem, true); @@ -585,13 +585,13 @@ const ToolSelect = forwardRef< const existingConfigs = await proxyFetchGet("/api/configs"); const existing = Array.isArray(existingConfigs) ? existingConfigs.find((c: any) => - c.config_group?.toLowerCase() === "gmail" && + c.config_group?.toLowerCase() === "google gmail mcp" && c.config_name === "GOOGLE_REFRESH_TOKEN" ) : null; const configPayload = { - config_group: "Gmail", + config_group: "Google Gmail MCP", config_name: "GOOGLE_REFRESH_TOKEN", config_value: "exists", }; diff --git a/src/hooks/useIntegrationManagement.ts b/src/hooks/useIntegrationManagement.ts index 92d6eec2..6b03e881 100644 --- a/src/hooks/useIntegrationManagement.ts +++ b/src/hooks/useIntegrationManagement.ts @@ -63,11 +63,11 @@ export function useIntegrationManagement(items: IntegrationItem[]) { const map: { [key: string]: boolean } = {}; items.forEach((item) => { - if (item.key === "Google Calendar") { + if (item.key === "Google Calendar" || item.key === "Google Gmail MCP") { // Only mark installed when refresh token is present (auth completed) const hasRefreshToken = configs.some( (c: any) => - c.config_group?.toLowerCase() === "google calendar" && + c.config_group?.toLowerCase() === item.key.toLowerCase() && c.config_name === "GOOGLE_REFRESH_TOKEN" && c.config_value && String(c.config_value).length > 0 ); diff --git a/src/pages/Setting/MCP.tsx b/src/pages/Setting/MCP.tsx index 2c631f64..cd46e484 100644 --- a/src/pages/Setting/MCP.tsx +++ b/src/pages/Setting/MCP.tsx @@ -30,13 +30,13 @@ import { SelectItem, SelectItemWithButton } from "@/components/ui/select"; import { Tag as TagComponent } from "@/components/ui/tag"; export const GMAIL_CONFIG = { - "Google Gmail": { + "Google Gmail MCP": { "env_vars": [ "GOOGLE_CLIENT_ID", "GOOGLE_CLIENT_SECRET", "GOOGLE_REFRESH_TOKEN" ], - "toolkit": "google_gmail_mcp_toolkit" + "toolkit": "google_gmail_native_toolkit" } } @@ -327,7 +327,7 @@ export default function SettingMCP() { ); } } - } else if (key.toLowerCase() === 'google gmail') { + } else if (key.toLowerCase() === 'google gmail mcp') { onInstall = async () => { try { const response = await fetchPost("/install/tool/google_gmail"); @@ -336,13 +336,13 @@ export default function SettingMCP() { const existingConfigs = await proxyFetchGet("/api/configs"); const existing = Array.isArray(existingConfigs) ? existingConfigs.find((c: any) => - c.config_group?.toLowerCase() === "google gmail" && + c.config_group?.toLowerCase() === "google gmail mcp" && c.config_name === "GOOGLE_REFRESH_TOKEN" ) : null; const configPayload = { - config_group: "Google Gmail", + config_group: "Google Gmail MCP", config_name: "GOOGLE_REFRESH_TOKEN", config_value: "exists", }; @@ -374,13 +374,13 @@ export default function SettingMCP() { const configs = await proxyFetchGet("/api/configs"); const existing = Array.isArray(configs) ? configs.find((c: any) => - c.config_group?.toLowerCase() === "google gmail" && + c.config_group?.toLowerCase() === "google gmail mcp" && c.config_name === "GOOGLE_REFRESH_TOKEN" ) : null; const payload = { - config_group: "Google Gmail", + config_group: "Google Gmail MCP", config_name: "GOOGLE_REFRESH_TOKEN", config_value: "exists", }; @@ -436,7 +436,7 @@ export default function SettingMCP() { ? t("setting.notion-workspace-integration") : key.toLowerCase() === "google calendar" ? t("setting.google-calendar-integration") - : key.toLowerCase() === 'google gmail' + : key.toLowerCase() === 'google gmail mcp' ? "Google Gmail integration for managing emails, drafts, and contacts" : "", onInstall,