Skip to content

Commit b819a7c

Browse files
committed
chore: rename to "Google Gmail MCP" to match database
1 parent c82037c commit b819a7c

3 files changed

Lines changed: 21 additions & 21 deletions

File tree

src/components/AddWorker/ToolSelect.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ const ToolSelect = forwardRef<
168168
}
169169
};
170170

171-
} else if (key.toLowerCase() === 'google gmail') {
171+
} else if (key.toLowerCase() === 'google gmail mcp') {
172172
onInstall = async () => {
173173
try {
174174
const response = await fetchPost("/install/tool/google_gmail");
@@ -177,13 +177,13 @@ const ToolSelect = forwardRef<
177177
const existingConfigs = await proxyFetchGet("/api/configs");
178178
const existing = Array.isArray(existingConfigs)
179179
? existingConfigs.find((c: any) =>
180-
c.config_group?.toLowerCase() === "google gmail" &&
180+
c.config_group?.toLowerCase() === "google gmail mcp" &&
181181
c.config_name === "GOOGLE_REFRESH_TOKEN"
182182
)
183183
: null;
184184

185185
const configPayload = {
186-
config_group: "Google Gmail",
186+
config_group: "Google Gmail MCP", //According to backend config
187187
config_name: "GOOGLE_REFRESH_TOKEN",
188188
config_value: "exists",
189189
};
@@ -197,7 +197,7 @@ const ToolSelect = forwardRef<
197197
console.log("Google Gmail installed successfully");
198198
// After successful installation, add to selected tools
199199
const gmailItem = {
200-
id: 0, // Use 0 for integration items
200+
id: 1, // Use 1 for integration items
201201
key: key,
202202
name: key,
203203
description: "Google Gmail integration for managing emails and contacts",
@@ -244,7 +244,7 @@ const ToolSelect = forwardRef<
244244
? t("layout.notion-workspace-integration")
245245
: key.toLowerCase() === 'google calendar'
246246
? t("layout.google-calendar-integration")
247-
: key.toLowerCase() === 'google gmail'
247+
: key.toLowerCase() === 'google gmail mcp'
248248
? "Google Gmail integration for managing emails and contacts"
249249
: "",
250250
onInstall,
@@ -522,7 +522,7 @@ const ToolSelect = forwardRef<
522522
}
523523

524524
// Trigger instantiation for Gmail
525-
if (activeMcp.key === "Gmail") {
525+
if (activeMcp.key === "Google Gmail MCP") {
526526
console.log("[ToolSelect installMcp] Starting Gmail installation");
527527
try {
528528
const response = await fetchPost("/install/tool/google_gmail");
@@ -533,13 +533,13 @@ const ToolSelect = forwardRef<
533533
const existingConfigs = await proxyFetchGet("/api/configs");
534534
const existing = Array.isArray(existingConfigs)
535535
? existingConfigs.find((c: any) =>
536-
c.config_group?.toLowerCase() === "gmail" &&
536+
c.config_group?.toLowerCase() === "google gmail mcp" &&
537537
c.config_name === "GOOGLE_REFRESH_TOKEN"
538538
)
539539
: null;
540540

541541
const configPayload = {
542-
config_group: "Gmail",
542+
config_group: "Google Gmail MCP",
543543
config_name: "GOOGLE_REFRESH_TOKEN",
544544
config_value: "exists",
545545
};
@@ -558,7 +558,7 @@ const ToolSelect = forwardRef<
558558
key: activeMcp.key,
559559
name: activeMcp.name,
560560
description: "Gmail integration for managing emails, drafts, labels, and contacts",
561-
toolkit: "google_gmail_toolkit",
561+
toolkit: "google_gmail_native_toolkit",
562562
isLocal: true
563563
};
564564
addOption(selectedItem, true);
@@ -585,13 +585,13 @@ const ToolSelect = forwardRef<
585585
const existingConfigs = await proxyFetchGet("/api/configs");
586586
const existing = Array.isArray(existingConfigs)
587587
? existingConfigs.find((c: any) =>
588-
c.config_group?.toLowerCase() === "gmail" &&
588+
c.config_group?.toLowerCase() === "google gmail mcp" &&
589589
c.config_name === "GOOGLE_REFRESH_TOKEN"
590590
)
591591
: null;
592592

593593
const configPayload = {
594-
config_group: "Gmail",
594+
config_group: "Google Gmail MCP",
595595
config_name: "GOOGLE_REFRESH_TOKEN",
596596
config_value: "exists",
597597
};

src/hooks/useIntegrationManagement.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ export function useIntegrationManagement(items: IntegrationItem[]) {
6363
const map: { [key: string]: boolean } = {};
6464

6565
items.forEach((item) => {
66-
if (item.key === "Google Calendar") {
66+
if (item.key === "Google Calendar" || item.key === "Google Gmail MCP") {
6767
// Only mark installed when refresh token is present (auth completed)
6868
const hasRefreshToken = configs.some(
6969
(c: any) =>
70-
c.config_group?.toLowerCase() === "google calendar" &&
70+
c.config_group?.toLowerCase() === item.key.toLowerCase() &&
7171
c.config_name === "GOOGLE_REFRESH_TOKEN" &&
7272
c.config_value && String(c.config_value).length > 0
7373
);

src/pages/Setting/MCP.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ import { SelectItem, SelectItemWithButton } from "@/components/ui/select";
3030
import { Tag as TagComponent } from "@/components/ui/tag";
3131

3232
export const GMAIL_CONFIG = {
33-
"Google Gmail": {
33+
"Google Gmail MCP": {
3434
"env_vars": [
3535
"GOOGLE_CLIENT_ID",
3636
"GOOGLE_CLIENT_SECRET",
3737
"GOOGLE_REFRESH_TOKEN"
3838
],
39-
"toolkit": "google_gmail_mcp_toolkit"
39+
"toolkit": "google_gmail_native_toolkit"
4040
}
4141
}
4242

@@ -327,7 +327,7 @@ export default function SettingMCP() {
327327
);
328328
}
329329
}
330-
} else if (key.toLowerCase() === 'google gmail') {
330+
} else if (key.toLowerCase() === 'google gmail mcp') {
331331
onInstall = async () => {
332332
try {
333333
const response = await fetchPost("/install/tool/google_gmail");
@@ -336,13 +336,13 @@ export default function SettingMCP() {
336336
const existingConfigs = await proxyFetchGet("/api/configs");
337337
const existing = Array.isArray(existingConfigs)
338338
? existingConfigs.find((c: any) =>
339-
c.config_group?.toLowerCase() === "google gmail" &&
339+
c.config_group?.toLowerCase() === "google gmail mcp" &&
340340
c.config_name === "GOOGLE_REFRESH_TOKEN"
341341
)
342342
: null;
343343

344344
const configPayload = {
345-
config_group: "Google Gmail",
345+
config_group: "Google Gmail MCP",
346346
config_name: "GOOGLE_REFRESH_TOKEN",
347347
config_value: "exists",
348348
};
@@ -374,13 +374,13 @@ export default function SettingMCP() {
374374
const configs = await proxyFetchGet("/api/configs");
375375
const existing = Array.isArray(configs)
376376
? configs.find((c: any) =>
377-
c.config_group?.toLowerCase() === "google gmail" &&
377+
c.config_group?.toLowerCase() === "google gmail mcp" &&
378378
c.config_name === "GOOGLE_REFRESH_TOKEN"
379379
)
380380
: null;
381381

382382
const payload = {
383-
config_group: "Google Gmail",
383+
config_group: "Google Gmail MCP",
384384
config_name: "GOOGLE_REFRESH_TOKEN",
385385
config_value: "exists",
386386
};
@@ -436,7 +436,7 @@ export default function SettingMCP() {
436436
? t("setting.notion-workspace-integration")
437437
: key.toLowerCase() === "google calendar"
438438
? t("setting.google-calendar-integration")
439-
: key.toLowerCase() === 'google gmail'
439+
: key.toLowerCase() === 'google gmail mcp'
440440
? "Google Gmail integration for managing emails, drafts, and contacts"
441441
: "",
442442
onInstall,

0 commit comments

Comments
 (0)