diff --git a/.agent-marketplace.json b/.agent-marketplace.json index 70d1c959e36..6adf8885d9c 100644 --- a/.agent-marketplace.json +++ b/.agent-marketplace.json @@ -25,7 +25,7 @@ }, "category": "productivity", "source": "./plugins/linear", - "version": "1.5.2" + "version": "1.5.3" }, { "name": "notion", diff --git a/apps/api/src/app/api/github/install/route.ts b/apps/api/src/app/api/github/install/route.ts index 1d30cb56147..72702337273 100644 --- a/apps/api/src/app/api/github/install/route.ts +++ b/apps/api/src/app/api/github/install/route.ts @@ -1,3 +1,4 @@ +import { organizationSyncsNow } from "@superset/trpc/sync-policy"; import { env } from "@/env"; import { beginOAuthFlow, STATE_COOKIES } from "@/lib/integrations/oauthFlow"; import { requireOrgMember } from "@/lib/integrations/requireOrgMember"; @@ -6,6 +7,10 @@ export async function GET(request: Request) { const member = await requireOrgMember(request); if (member instanceof Response) return member; + if (!(await organizationSyncsNow(member.organizationId))) { + return Response.redirect(`${env.NEXT_PUBLIC_WEB_URL}/settings/billing`); + } + if (!env.GH_APP_ID) { return Response.json( { error: "GitHub App not configured" }, diff --git a/apps/api/src/app/api/integrations/jobs/suspend/route.ts b/apps/api/src/app/api/integrations/jobs/suspend/route.ts index ae565add39a..f4bdf6e656d 100644 --- a/apps/api/src/app/api/integrations/jobs/suspend/route.ts +++ b/apps/api/src/app/api/integrations/jobs/suspend/route.ts @@ -137,6 +137,7 @@ async function linearPass(deadline: number) { .where( and( eq(connections.connector, "linear"), + eq(connections.authMethod, "oauth2"), isNull(connections.disconnectedAt), not(organizationSyncs(connections.organizationId)), ), diff --git a/apps/api/src/app/api/integrations/linear/callback/route.ts b/apps/api/src/app/api/integrations/linear/callback/route.ts index 25118f29eab..7e8c04b7997 100644 --- a/apps/api/src/app/api/integrations/linear/callback/route.ts +++ b/apps/api/src/app/api/integrations/linear/callback/route.ts @@ -67,7 +67,12 @@ export async function GET(request: Request) { user: { id: viewer.id, label: viewer.displayName }, }, }); - if (result.conflict) return fail("workspace_already_linked"); + if (result.conflict) { + const owner = result.conflict.ownerEmail + ? `&owner=${encodeURIComponent(result.conflict.ownerEmail)}` + : ""; + return exit(`${settingsUrl}?error=workspace_already_linked${owner}`); + } // The person who connected is the one Linear account we know for certain // belongs to a Superset user, so link it. Linear user ids are scoped to diff --git a/apps/api/src/app/api/integrations/linear/connect/route.ts b/apps/api/src/app/api/integrations/linear/connect/route.ts index 2e7794be672..797a8f66ef4 100644 --- a/apps/api/src/app/api/integrations/linear/connect/route.ts +++ b/apps/api/src/app/api/integrations/linear/connect/route.ts @@ -1,3 +1,4 @@ +import { organizationSyncsNow } from "@superset/trpc/sync-policy"; import { env } from "@/env"; import { beginOAuthFlow, STATE_COOKIES } from "@/lib/integrations/oauthFlow"; import { requireOrgMember } from "@/lib/integrations/requireOrgMember"; @@ -6,6 +7,10 @@ export async function GET(request: Request) { const member = await requireOrgMember(request); if (member instanceof Response) return member; + if (!(await organizationSyncsNow(member.organizationId))) { + return Response.redirect(`${env.NEXT_PUBLIC_WEB_URL}/settings/billing`); + } + return beginOAuthFlow({ cookie: STATE_COOKIES.linear, payload: { organizationId: member.organizationId, userId: member.userId }, diff --git a/apps/web/src/app/(app)/(page)/integrations/components/IntegrationErrorHandler/IntegrationErrorHandler.tsx b/apps/web/src/app/(app)/(page)/integrations/components/IntegrationErrorHandler/IntegrationErrorHandler.tsx index b4f019ce8d4..2392d5d6f65 100644 --- a/apps/web/src/app/(app)/(page)/integrations/components/IntegrationErrorHandler/IntegrationErrorHandler.tsx +++ b/apps/web/src/app/(app)/(page)/integrations/components/IntegrationErrorHandler/IntegrationErrorHandler.tsx @@ -44,7 +44,8 @@ type CallbackKeys = { | "missing_params" | "oauth_denied" | "token_exchange_failed" - | "unauthorized"; + | "unauthorized" + | "workspace_already_linked"; warning: "sync_queued_failed"; }; "microsoft-teams": { @@ -147,30 +148,37 @@ export function IntegrationErrorHandler

({ const success = searchParams.get("success"); if (!error && !warning && !success) return; - // Toast first: replacing the URL re-runs this effect through Next's - // patched history, and a deferred toast can be cleaned up before it shows. - if (error) { - const message = (messages as Record)[error]; - toast.error(resolveMessage(message, searchParams)); - } else if (warning) { - toast.warning( - (warnings as Record | undefined)?.[warning] ?? - i18n._( - msg({ - message: "Warning occurred.", - }), - ), - ); - } else if (success) { - toast.success( - (successes as Record | undefined)?.[success] ?? - i18n._( - msg({ - message: "Success!", - }), - ), - ); - } + const show = () => { + const id = `integration-callback-${provider}`; + if (error) { + const message = (messages as Record)[error]; + toast.error(resolveMessage(message, searchParams), { id }); + } else if (warning) { + toast.warning( + (warnings as Record | undefined)?.[warning] ?? + i18n._( + msg({ + message: "Warning occurred.", + }), + ), + { id }, + ); + } else if (success) { + toast.success( + (successes as Record | undefined)?.[success] ?? + i18n._( + msg({ + message: "Success!", + }), + ), + { id }, + ); + } + }; + // The root layout's Toaster subscribes in its own effect, which runs after + // this one and drops anything published before it. Never cancelled: the + // replaceState below re-runs this effect, and its cleanup would drop the toast. + setTimeout(show, 0); window.history.replaceState({}, "", `/integrations/${provider}`); }, [searchParams, provider, messages, warnings, successes]); diff --git a/apps/web/src/app/(app)/(page)/integrations/linear/page.tsx b/apps/web/src/app/(app)/(page)/integrations/linear/page.tsx index d38c3ce6707..72bb57affba 100644 --- a/apps/web/src/app/(app)/(page)/integrations/linear/page.tsx +++ b/apps/web/src/app/(app)/(page)/integrations/linear/page.tsx @@ -44,6 +44,22 @@ export default async function LinearIntegrationPage() { message: "You are not authorized to perform this action.", }), ), + workspace_already_linked: { + param: "owner", + withParam: i18n._({ + ...msg({ + message: + "This Linear workspace is already connected by {owner}. Ask them to disconnect first.", + }), + values: { owner: "{owner}" }, + }), + withoutParam: i18n._( + msg({ + message: + "This Linear workspace is already connected by another Superset organization.", + }), + ), + }, }; const CALLBACK_WARNINGS = { sync_queued_failed: i18n._( diff --git a/apps/web/src/app/(app)/(page)/integrations/microsoft-teams/page.tsx b/apps/web/src/app/(app)/(page)/integrations/microsoft-teams/page.tsx index 3e5756274fe..c267dc4a97b 100644 --- a/apps/web/src/app/(app)/(page)/integrations/microsoft-teams/page.tsx +++ b/apps/web/src/app/(app)/(page)/integrations/microsoft-teams/page.tsx @@ -62,12 +62,13 @@ export default async function MicrosoftTeamsIntegrationPage() { ), tenant_already_linked: { param: "detail", - withParam: i18n._( - msg({ + withParam: i18n._({ + ...msg({ message: "This Microsoft tenant is already connected by {detail}. Ask them to disconnect first.", }), - ), + values: { detail: "{detail}" }, + }), withoutParam: i18n._( msg({ message: diff --git a/apps/web/src/app/(app)/(page)/integrations/slack/page.tsx b/apps/web/src/app/(app)/(page)/integrations/slack/page.tsx index d8bd1051809..b84104b98b3 100644 --- a/apps/web/src/app/(app)/(page)/integrations/slack/page.tsx +++ b/apps/web/src/app/(app)/(page)/integrations/slack/page.tsx @@ -50,12 +50,13 @@ export default async function SlackIntegrationPage() { ), workspace_already_linked: { param: "owner", - withParam: i18n._( - msg({ + withParam: i18n._({ + ...msg({ message: "This Slack workspace is already connected by {owner}. Ask them to disconnect first.", }), - ), + values: { owner: "{owner}" }, + }), withoutParam: i18n._( msg({ message: diff --git a/packages/i18n/locales/cs/messages.po b/packages/i18n/locales/cs/messages.po index 2e2c853a40b..d9c815ca1c2 100644 --- a/packages/i18n/locales/cs/messages.po +++ b/packages/i18n/locales/cs/messages.po @@ -16119,6 +16119,12 @@ msgstr "Trvá to déle než obvykle. Pracovní prostor už možná je připraven msgid "This issue link is invalid." msgstr "Tento odkaz na issue je neplatný." +msgid "This Linear workspace is already connected by {owner}. Ask them to disconnect first." +msgstr "Tento Linear workspace už připojil {owner}. Požádejte je, ať ho nejdřív odpojí." + +msgid "This Linear workspace is already connected by another Superset organization." +msgstr "Tento Linear workspace už připojila jiná organizace Superset." + msgid "This looks like a binary file. Opening it as text may show garbled output or freeze the editor for large files." msgstr "Vypadá to na binární soubor. Otevření jako text může zobrazit nesmyslný výstup nebo u velkých souborů zamrznout editor." diff --git a/packages/i18n/locales/de/messages.po b/packages/i18n/locales/de/messages.po index c32b5e5f956..349b02aa1a2 100644 --- a/packages/i18n/locales/de/messages.po +++ b/packages/i18n/locales/de/messages.po @@ -15999,7 +15999,7 @@ msgid "Thirty" msgstr "Dreißig" msgid "This {plugin} account is already connected by {owner}. Ask them to disconnect first." -msgstr "Das {plugin}-Konto ist bereits von {owner} verbunden. Bitte sie oder ihn, es zuerst zu trennen." +msgstr "Das {plugin}-Konto wurde bereits von {owner} verbunden. Bitte sie oder ihn, es zuerst zu trennen." msgid "This {plugin} account is already connected by another Superset organization." msgstr "Dieses {plugin}-Konto ist bereits mit einer anderen Superset-Organisation verbunden." @@ -16119,6 +16119,12 @@ msgstr "Das dauert länger als sonst. Der Arbeitsbereich ist womöglich schon be msgid "This issue link is invalid." msgstr "Dieser Issue-Link ist ungültig." +msgid "This Linear workspace is already connected by {owner}. Ask them to disconnect first." +msgstr "Dieser Linear-Workspace wurde bereits von {owner} verbunden. Bitte diese Person, die Verbindung zuerst zu trennen." + +msgid "This Linear workspace is already connected by another Superset organization." +msgstr "Dieser Linear-Workspace ist bereits mit einer anderen Superset-Organisation verbunden." + msgid "This looks like a binary file. Opening it as text may show garbled output or freeze the editor for large files." msgstr "Das sieht nach einer Binärdatei aus. Sie als Text zu öffnen, kann zu Zeichensalat führen oder den Editor bei großen Dateien einfrieren." @@ -16126,7 +16132,7 @@ msgid "This Mac" msgstr "Dieser Mac" msgid "This Microsoft tenant is already connected by {detail}. Ask them to disconnect first." -msgstr "Dieser Microsoft-Tenant ist bereits von {detail} verbunden. Bitte diese Person, die Verbindung zuerst zu trennen." +msgstr "Dieser Microsoft-Tenant wurde bereits von {detail} verbunden. Bitte diese Person, die Verbindung zuerst zu trennen." msgid "This Microsoft tenant is already connected by another Superset organization." msgstr "Dieser Microsoft-Tenant ist bereits mit einer anderen Superset-Organisation verbunden." @@ -16219,7 +16225,7 @@ msgid "This screen doesn't exist" msgstr "Diesen Bildschirm gibt es nicht" msgid "This Slack workspace is already connected by {owner}. Ask them to disconnect first." -msgstr "Dieser Slack-Workspace ist bereits von {owner} verbunden. Bitte diese Person, die Verbindung zuerst zu trennen." +msgstr "Dieser Slack-Workspace wurde bereits von {owner} verbunden. Bitte diese Person, die Verbindung zuerst zu trennen." msgid "This Slack workspace is already connected by another Superset organization." msgstr "Dieser Slack-Workspace ist bereits mit einer anderen Superset-Organisation verbunden." diff --git a/packages/i18n/locales/en/messages.po b/packages/i18n/locales/en/messages.po index cd151b71491..e32058886d0 100644 --- a/packages/i18n/locales/en/messages.po +++ b/packages/i18n/locales/en/messages.po @@ -16119,6 +16119,12 @@ msgstr "This is taking longer than usual. The workspace may already be ready — msgid "This issue link is invalid." msgstr "This issue link is invalid." +msgid "This Linear workspace is already connected by {owner}. Ask them to disconnect first." +msgstr "This Linear workspace is already connected by {owner}. Ask them to disconnect first." + +msgid "This Linear workspace is already connected by another Superset organization." +msgstr "This Linear workspace is already connected by another Superset organization." + msgid "This looks like a binary file. Opening it as text may show garbled output or freeze the editor for large files." msgstr "This looks like a binary file. Opening it as text may show garbled output or freeze the editor for large files." diff --git a/packages/i18n/locales/es/messages.po b/packages/i18n/locales/es/messages.po index 52aec262ebe..bd951795ba1 100644 --- a/packages/i18n/locales/es/messages.po +++ b/packages/i18n/locales/es/messages.po @@ -16119,6 +16119,12 @@ msgstr "Está tardando más de lo normal. Puede que el espacio de trabajo ya est msgid "This issue link is invalid." msgstr "Este enlace de issue no es válido." +msgid "This Linear workspace is already connected by {owner}. Ask them to disconnect first." +msgstr "Este espacio de trabajo de Linear ya está conectado por {owner}. Pídele que lo desconecte primero." + +msgid "This Linear workspace is already connected by another Superset organization." +msgstr "Este espacio de trabajo de Linear ya está conectado por otra organización de Superset." + msgid "This looks like a binary file. Opening it as text may show garbled output or freeze the editor for large files." msgstr "Esto parece un archivo binario. Abrirlo como texto puede mostrar caracteres ilegibles o congelar el editor si es grande." diff --git a/packages/i18n/locales/fr/messages.po b/packages/i18n/locales/fr/messages.po index 6b1413d495b..ec060625d13 100644 --- a/packages/i18n/locales/fr/messages.po +++ b/packages/i18n/locales/fr/messages.po @@ -16119,6 +16119,12 @@ msgstr "Cela prend plus de temps que d'habitude. L'espace de travail est peut-ê msgid "This issue link is invalid." msgstr "Ce lien d'issue est invalide." +msgid "This Linear workspace is already connected by {owner}. Ask them to disconnect first." +msgstr "Cet espace de travail Linear est déjà connecté par {owner}. Demandez-lui de le déconnecter d'abord." + +msgid "This Linear workspace is already connected by another Superset organization." +msgstr "Cet espace de travail Linear est déjà connecté par une autre organisation Superset." + msgid "This looks like a binary file. Opening it as text may show garbled output or freeze the editor for large files." msgstr "Ce fichier semble binaire. L'ouvrir comme du texte peut afficher une sortie illisible ou figer l'éditeur pour les gros fichiers." diff --git a/packages/i18n/locales/id/messages.po b/packages/i18n/locales/id/messages.po index ae41ceb520e..75c2f194297 100644 --- a/packages/i18n/locales/id/messages.po +++ b/packages/i18n/locales/id/messages.po @@ -16119,6 +16119,12 @@ msgstr "Ini lebih lama dari biasanya. Workspace-nya mungkin sudah siap — memua msgid "This issue link is invalid." msgstr "Tautan issue ini tidak valid." +msgid "This Linear workspace is already connected by {owner}. Ask them to disconnect first." +msgstr "Workspace Linear ini sudah terhubung oleh {owner}. Minta mereka memutuskannya dulu." + +msgid "This Linear workspace is already connected by another Superset organization." +msgstr "Workspace Linear ini sudah terhubung oleh organisasi Superset lain." + msgid "This looks like a binary file. Opening it as text may show garbled output or freeze the editor for large files." msgstr "Ini tampak seperti file biner. Membukanya sebagai teks bisa menampilkan output kacau atau membekukan editor untuk file besar." diff --git a/packages/i18n/locales/it/messages.po b/packages/i18n/locales/it/messages.po index 2fd6fa1df93..bd419fb8bc3 100644 --- a/packages/i18n/locales/it/messages.po +++ b/packages/i18n/locales/it/messages.po @@ -16119,6 +16119,12 @@ msgstr "Ci sta mettendo più del solito. Il workspace potrebbe essere già pront msgid "This issue link is invalid." msgstr "Questo link alla issue non è valido." +msgid "This Linear workspace is already connected by {owner}. Ask them to disconnect first." +msgstr "Questo workspace Linear è già collegato da {owner}. Chiedi di scollegarlo prima." + +msgid "This Linear workspace is already connected by another Superset organization." +msgstr "Questo workspace Linear è già collegato da un'altra organizzazione Superset." + msgid "This looks like a binary file. Opening it as text may show garbled output or freeze the editor for large files." msgstr "Sembra un file binario. Aprirlo come testo può mostrare output illeggibile o bloccare l'editor con file grandi." diff --git a/packages/i18n/locales/ja/messages.po b/packages/i18n/locales/ja/messages.po index 607c1b549f4..166994c4649 100644 --- a/packages/i18n/locales/ja/messages.po +++ b/packages/i18n/locales/ja/messages.po @@ -16119,6 +16119,12 @@ msgstr "通常より時間がかかっています。ワークスペースはす msgid "This issue link is invalid." msgstr "このissueリンクは無効です。" +msgid "This Linear workspace is already connected by {owner}. Ask them to disconnect first." +msgstr "このLinearワークスペースは{owner}がすでに接続しています。先に接続を解除してもらってください。" + +msgid "This Linear workspace is already connected by another Superset organization." +msgstr "このLinearワークスペースは別のSuperset組織がすでに接続しています。" + msgid "This looks like a binary file. Opening it as text may show garbled output or freeze the editor for large files." msgstr "バイナリファイルのようです。テキストとして開くと文字化けしたり、大きなファイルではエディタが固まる可能性があります。" diff --git a/packages/i18n/locales/ko/messages.po b/packages/i18n/locales/ko/messages.po index 5410f48bfa4..7a18f5ea44c 100644 --- a/packages/i18n/locales/ko/messages.po +++ b/packages/i18n/locales/ko/messages.po @@ -16119,6 +16119,12 @@ msgstr "평소보다 오래 걸리고 있습니다. 워크스페이스가 이미 msgid "This issue link is invalid." msgstr "이 이슈 링크가 올바르지 않습니다." +msgid "This Linear workspace is already connected by {owner}. Ask them to disconnect first." +msgstr "이 Linear 워크스페이스는 이미 {owner}이(가) 연결했습니다. 먼저 연결을 해제해 달라고 요청하세요." + +msgid "This Linear workspace is already connected by another Superset organization." +msgstr "이 Linear 워크스페이스는 이미 다른 Superset 조직이 연결했습니다." + msgid "This looks like a binary file. Opening it as text may show garbled output or freeze the editor for large files." msgstr "바이너리 파일로 보입니다. 텍스트로 열면 깨진 내용이 표시되거나, 파일이 크면 에디터가 멈출 수 있습니다." diff --git a/packages/i18n/locales/nl/messages.po b/packages/i18n/locales/nl/messages.po index 7b2b41da040..b49d0aeab4c 100644 --- a/packages/i18n/locales/nl/messages.po +++ b/packages/i18n/locales/nl/messages.po @@ -16119,6 +16119,12 @@ msgstr "Dit duurt langer dan gewoonlijk. De werkruimte is mogelijk al klaar — msgid "This issue link is invalid." msgstr "Deze link naar een issue is ongeldig." +msgid "This Linear workspace is already connected by {owner}. Ask them to disconnect first." +msgstr "Deze Linear-werkruimte is al gekoppeld door {owner}. Vraag hen om eerst los te koppelen." + +msgid "This Linear workspace is already connected by another Superset organization." +msgstr "Deze Linear-werkruimte is al gekoppeld door een andere Superset-organisatie." + msgid "This looks like a binary file. Opening it as text may show garbled output or freeze the editor for large files." msgstr "Dit lijkt een binair bestand. Als tekst openen kan onleesbare uitvoer geven of de editor bij grote bestanden laten vastlopen." diff --git a/packages/i18n/locales/pl/messages.po b/packages/i18n/locales/pl/messages.po index 601d0b2dccc..ffe9d39af8c 100644 --- a/packages/i18n/locales/pl/messages.po +++ b/packages/i18n/locales/pl/messages.po @@ -16119,6 +16119,12 @@ msgstr "Trwa to dłużej niż zwykle. Obszar roboczy może już być gotowy — msgid "This issue link is invalid." msgstr "Ten link do zgłoszenia jest nieprawidłowy." +msgid "This Linear workspace is already connected by {owner}. Ask them to disconnect first." +msgstr "Ten obszar roboczy Lineara jest już połączony przez {owner}. Poproś o rozłączenie." + +msgid "This Linear workspace is already connected by another Superset organization." +msgstr "Ten obszar roboczy Lineara jest już połączony z inną organizacją Superset." + msgid "This looks like a binary file. Opening it as text may show garbled output or freeze the editor for large files." msgstr "To wygląda na plik binarny. Otwarcie go jako tekst może pokazać śmieci albo zawiesić edytor przy dużych plikach." diff --git a/packages/i18n/locales/pt-BR/messages.po b/packages/i18n/locales/pt-BR/messages.po index af8ba7ec80a..4d7e260771b 100644 --- a/packages/i18n/locales/pt-BR/messages.po +++ b/packages/i18n/locales/pt-BR/messages.po @@ -16119,6 +16119,12 @@ msgstr "Está demorando mais que o normal. A área de trabalho pode já estar pr msgid "This issue link is invalid." msgstr "Este link de issue é inválido." +msgid "This Linear workspace is already connected by {owner}. Ask them to disconnect first." +msgstr "Este workspace do Linear já está conectado por {owner}. Peça para essa pessoa desconectar primeiro." + +msgid "This Linear workspace is already connected by another Superset organization." +msgstr "Este workspace do Linear já está conectado a outra organização do Superset." + msgid "This looks like a binary file. Opening it as text may show garbled output or freeze the editor for large files." msgstr "Isto parece ser um arquivo binário. Abri-lo como texto pode mostrar caracteres estranhos ou travar o editor em arquivos grandes." diff --git a/packages/i18n/locales/ru/messages.po b/packages/i18n/locales/ru/messages.po index 5dbd85c35eb..00f43e16862 100644 --- a/packages/i18n/locales/ru/messages.po +++ b/packages/i18n/locales/ru/messages.po @@ -16119,6 +16119,12 @@ msgstr "Это занимает больше времени, чем обычно msgid "This issue link is invalid." msgstr "Эта ссылка на задачу недействительна." +msgid "This Linear workspace is already connected by {owner}. Ask them to disconnect first." +msgstr "Это рабочее пространство Linear уже подключено пользователем {owner}. Попросите отключить его." + +msgid "This Linear workspace is already connected by another Superset organization." +msgstr "Это рабочее пространство Linear уже подключено другой организацией Superset." + msgid "This looks like a binary file. Opening it as text may show garbled output or freeze the editor for large files." msgstr "Похоже, это бинарный файл. Открытие его как текста может показать мусор или подвесить редактор на больших файлах." @@ -16126,7 +16132,7 @@ msgid "This Mac" msgstr "Этот Mac" msgid "This Microsoft tenant is already connected by {detail}. Ask them to disconnect first." -msgstr "Этот тенант Microsoft уже подключён {detail}. Попросите отключить его." +msgstr "Этот тенант Microsoft уже подключён пользователем {detail}. Попросите отключить его." msgid "This Microsoft tenant is already connected by another Superset organization." msgstr "Этот тенант Microsoft уже подключён другой организацией Superset." @@ -16219,7 +16225,7 @@ msgid "This screen doesn't exist" msgstr "Такого экрана нет" msgid "This Slack workspace is already connected by {owner}. Ask them to disconnect first." -msgstr "Это рабочее пространство Slack уже подключено {owner}. Попросите отключить его." +msgstr "Это рабочее пространство Slack уже подключено пользователем {owner}. Попросите отключить его." msgid "This Slack workspace is already connected by another Superset organization." msgstr "Это рабочее пространство Slack уже подключено другой организацией Superset." diff --git a/packages/i18n/locales/tr/messages.po b/packages/i18n/locales/tr/messages.po index b55f15517d2..a946fc47ef1 100644 --- a/packages/i18n/locales/tr/messages.po +++ b/packages/i18n/locales/tr/messages.po @@ -16119,6 +16119,12 @@ msgstr "Bu normalden uzun sürüyor. Çalışma alanı zaten hazır olabilir — msgid "This issue link is invalid." msgstr "Bu issue bağlantısı geçersiz." +msgid "This Linear workspace is already connected by {owner}. Ask them to disconnect first." +msgstr "Bu Linear çalışma alanı {owner} tarafından zaten bağlanmış. Önce bağlantıyı kesmesini isteyin." + +msgid "This Linear workspace is already connected by another Superset organization." +msgstr "Bu Linear çalışma alanı başka bir Superset kuruluşu tarafından zaten bağlanmış." + msgid "This looks like a binary file. Opening it as text may show garbled output or freeze the editor for large files." msgstr "Bu bir ikili dosyaya benziyor. Metin olarak açmak bozuk çıktı gösterebilir veya büyük dosyalarda düzenleyiciyi dondurabilir." diff --git a/packages/i18n/locales/vi/messages.po b/packages/i18n/locales/vi/messages.po index 236ff2f4421..95edae65d10 100644 --- a/packages/i18n/locales/vi/messages.po +++ b/packages/i18n/locales/vi/messages.po @@ -16119,6 +16119,12 @@ msgstr "Việc này lâu hơn bình thường. Workspace có thể đã sẵn s msgid "This issue link is invalid." msgstr "Liên kết issue này không hợp lệ." +msgid "This Linear workspace is already connected by {owner}. Ask them to disconnect first." +msgstr "Workspace Linear này đã được {owner} kết nối. Hãy nhờ họ ngắt kết nối trước." + +msgid "This Linear workspace is already connected by another Superset organization." +msgstr "Workspace Linear này đã được một tổ chức Superset khác kết nối." + msgid "This looks like a binary file. Opening it as text may show garbled output or freeze the editor for large files." msgstr "Đây có vẻ là tệp nhị phân. Mở dưới dạng văn bản có thể hiện ra ký tự lỗi hoặc làm treo trình soạn thảo với tệp lớn." diff --git a/packages/i18n/locales/zh-CN/messages.po b/packages/i18n/locales/zh-CN/messages.po index 6d230968e68..54e760d3c84 100644 --- a/packages/i18n/locales/zh-CN/messages.po +++ b/packages/i18n/locales/zh-CN/messages.po @@ -16119,6 +16119,12 @@ msgstr "这比平时耗时更久。工作区可能已经就绪 — 重新加载 msgid "This issue link is invalid." msgstr "此议题链接无效。" +msgid "This Linear workspace is already connected by {owner}. Ask them to disconnect first." +msgstr "这个Linear工作区已被{owner}连接。请让对方先断开连接。" + +msgid "This Linear workspace is already connected by another Superset organization." +msgstr "这个Linear工作区已被另一个Superset组织连接。" + msgid "This looks like a binary file. Opening it as text may show garbled output or freeze the editor for large files." msgstr "这看起来是二进制文件。以文本方式打开可能显示乱码,文件较大时还可能让编辑器卡死。" diff --git a/packages/i18n/locales/zh-TW/messages.po b/packages/i18n/locales/zh-TW/messages.po index a060a710fa5..b2a123ec6ac 100644 --- a/packages/i18n/locales/zh-TW/messages.po +++ b/packages/i18n/locales/zh-TW/messages.po @@ -16119,6 +16119,12 @@ msgstr "這比平時耗時更久。工作區可能已經就緒 — 重新載入 msgid "This issue link is invalid." msgstr "此議題連結無效。" +msgid "This Linear workspace is already connected by {owner}. Ask them to disconnect first." +msgstr "這個Linear工作區已被{owner}連線。請讓對方先斷開連線。" + +msgid "This Linear workspace is already connected by another Superset organization." +msgstr "這個Linear工作區已被另一個Superset組織連線。" + msgid "This looks like a binary file. Opening it as text may show garbled output or freeze the editor for large files." msgstr "這看起來是二進位檔案。以文字方式開啟可能顯示亂碼,檔案較大時還可能讓編輯器卡死。" diff --git a/packages/shared/src/connectors/connectors.json b/packages/shared/src/connectors/connectors.json index fe5f064c916..6df2a78e5ec 100644 --- a/packages/shared/src/connectors/connectors.json +++ b/packages/shared/src/connectors/connectors.json @@ -139,6 +139,72 @@ } ] }, + "linear_mcp": { + "displayName": "Linear", + "icon": "linear", + "category": "Productivity", + "scope": "user", + "methods": [ + { + "type": "oauth2", + "label": "OAuth 2.0", + "client": "dynamic", + "authorization_url": "https://mcp.linear.app/mcp", + "scopes": ["read", "write"], + "identity": { + "mcp": "https://mcp.linear.app/mcp", + "tool": "get_user", + "arguments": { "query": "me" }, + "account": { + "id": "$.id", + "label": "$.email" + }, + "user": { + "id": "$.id", + "label": "$.name" + } + }, + "bind": { + "headers": { + "Authorization": "Bearer ${config.access_token}" + } + } + }, + { + "type": "api_key", + "label": "Personal API key", + "credential_input": "api_key", + "inputs": [ + { + "name": "api_key", + "label": "Linear API key", + "placeholder": "lin_api_\u2026", + "description": "Linear \u2192 Settings \u2192 Security & access \u2192 Personal API keys", + "required": true, + "secret": true + } + ], + "identity": { + "mcp": "https://mcp.linear.app/mcp", + "tool": "get_user", + "arguments": { "query": "me" }, + "account": { + "id": "$.id", + "label": "$.email" + }, + "user": { + "id": "$.id", + "label": "$.name" + } + }, + "bind": { + "headers": { + "Authorization": "Bearer ${config.access_token}" + } + } + } + ] + }, "notion": { "displayName": "Notion", "icon": "notion", diff --git a/packages/shared/src/plugins/manifests.generated.ts b/packages/shared/src/plugins/manifests.generated.ts index 08d323ead09..fb8f823fa35 100644 --- a/packages/shared/src/plugins/manifests.generated.ts +++ b/packages/shared/src/plugins/manifests.generated.ts @@ -55,7 +55,7 @@ export const FIRST_PARTY_MANIFESTS = { "linear": { "$schema": "https://superset.sh/schemas/plugin/1.0.0.json", "name": "linear", - "version": "1.5.2", + "version": "1.5.3", "description": "Plan and build products: create, search, and update Linear issues.", "author": { "name": "Superset", @@ -78,7 +78,7 @@ export const FIRST_PARTY_MANIFESTS = { "icon": "linear" }, "connector": { - "slug": "linear" + "slug": "linear_mcp" }, "mcp": { "type": "streamable-http", diff --git a/packages/trpc/src/router/integration/integration.ts b/packages/trpc/src/router/integration/integration.ts index f8ca674af67..15bb1f68f81 100644 --- a/packages/trpc/src/router/integration/integration.ts +++ b/packages/trpc/src/router/integration/integration.ts @@ -3,6 +3,7 @@ import { connections } from "@superset/db/schema"; import type { TRPCRouterRecord } from "@trpc/server"; import { eq } from "drizzle-orm"; import { z } from "zod"; +import { organizationSyncsNow } from "../../lib/sync-policy/syncPolicy"; import { protectedProcedure } from "../../trpc"; import { connectionStatusProcedure } from "./connection-status"; import { githubRouter } from "./github"; @@ -28,6 +29,13 @@ export const integrationRouter = { /** Which providers are connected, for the trigger editor. */ connectionStatus: connectionStatusProcedure, + syncAllowed: protectedProcedure + .input(z.object({ organizationId: z.uuid() })) + .query(async ({ ctx, input }) => { + await verifyOrgMembership(ctx.session.user.id, input.organizationId); + return organizationSyncsNow(input.organizationId); + }), + list: protectedProcedure .input(z.object({ organizationId: z.uuid() })) .query(async ({ ctx, input }) => { diff --git a/plugins/linear/plugin.json b/plugins/linear/plugin.json index e60ff78decb..b7d8e1e5cbb 100644 --- a/plugins/linear/plugin.json +++ b/plugins/linear/plugin.json @@ -1,7 +1,7 @@ { "$schema": "https://superset.sh/schemas/plugin/1.0.0.json", "name": "linear", - "version": "1.5.2", + "version": "1.5.3", "description": "Plan and build products: create, search, and update Linear issues.", "author": { "name": "Superset", @@ -19,7 +19,7 @@ "icon": "linear" }, "connector": { - "slug": "linear" + "slug": "linear_mcp" }, "mcp": { "type": "streamable-http",