Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix(web): correct integration status and settings escape handling

Tin66ce78ee4e6e
diff --git a/apps/web/src/components/project/integrations/get-integration-status.test.ts b/apps/web/src/components/project/integrations/get-integration-status.test.ts
index 012fb9518..e3ac98c93 100644
--- a/apps/web/src/components/project/integrations/get-integration-status.test.ts
+++ b/apps/web/src/components/project/integrations/get-integration-status.test.ts
@@ -6,6 +6,22 @@ import {
} from "@/components/project/integrations/get-integration-status";
describe("getIntegrationStatus", () => {
+ it("does not report pending or failed requests as disconnected", () => {
+ expect(
+ getIntegrationStatus({ queryStatus: "pending", configured: false }),
+ ).toEqual({ state: "loading" });
+ expect(
+ getIntegrationStatus({ queryStatus: "error", configured: false }),
+ ).toEqual({ state: "unavailable" });
+ expect(
+ getIntegrationStatus({
+ queryStatus: "error",
+ configured: true,
+ detail: "stale",
+ }),
+ ).toEqual({ state: "unavailable" });
+ });
+
it("is disconnected until the integration is configured", () => {
expect(
getIntegrationStatus({ configured: false, isActive: true, detail: "x" }),
diff --git a/apps/web/src/components/project/integrations/get-integration-status.ts b/apps/web/src/components/project/integrations/get-integration-status.ts
index 54a47bcb9..dd8c6959f 100644
--- a/apps/web/src/components/project/integrations/get-integration-status.ts
+++ b/apps/web/src/components/project/integrations/get-integration-status.ts
@@ -1,4 +1,9 @@
-export type IntegrationState = "connected" | "paused" | "disconnected";
+export type IntegrationState =
+ | "connected"
+ | "paused"
+ | "disconnected"
+ | "loading"
+ | "unavailable";
export type IntegrationStatus = {
state: IntegrationState;
@@ -6,16 +11,20 @@ export type IntegrationStatus = {
};
type IntegrationStatusInput = {
+ queryStatus?: "pending" | "error" | "success";
configured: boolean;
isActive?: boolean | null;
detail?: string | null;
};
export function getIntegrationStatus({
+ queryStatus = "success",
configured,
isActive,
detail,
}: IntegrationStatusInput): IntegrationStatus {
+ if (queryStatus === "pending") return { state: "loading" };
+ if (queryStatus === "error") return { state: "unavailable" };
if (!configured) return { state: "disconnected" };
return {
diff --git a/apps/web/src/components/project/integrations/integration-row.test.tsx b/apps/web/src/components/project/integrations/integration-row.test.tsx
new file mode 100644
index 000000000..2b76cbedd
--- /dev/null
+++ b/apps/web/src/components/project/integrations/integration-row.test.tsx
@@ -0,0 +1,124 @@
+import { cleanup, fireEvent, render, screen } from "@testing-library/react";
+import { afterEach, describe, expect, it, vi } from "vite-plus/test";
+import type { IntegrationDefinition } from "@/components/project/integrations/integration-definitions";
+import { IntegrationRow } from "@/components/project/integrations/integration-row";
+
+vi.mock("react-i18next", () => ({
+ useTranslation: () => ({ t: (key: string) => key }),
+}));
+const integration: IntegrationDefinition = {
+ id: "github",
+ name: "GitHub",
+ category: "code",
+ descriptionKey: "settings:projectIntegrations.githubSectionSubtitle",
+ icon: () => <svg />,
+ iconClassName: "",
+ Settings: () => <p>Integration settings</p>,
+};
+afterEach(cleanup);
+
+describe("IntegrationRow", () => {
+ it.each([undefined, { state: "loading" as const }])(
+ "does not offer Connect before status is known",
+ (status) => {
+ render(
+ <IntegrationRow
+ integration={integration}
+ projectId="p1"
+ status={status}
+ onRetry={vi.fn()}
+ />,
+ );
+ const trigger = screen.getByRole("button", {
+ name: "common:empty.loading",
+ });
+ expect(trigger).toHaveAttribute("aria-disabled", "true");
+ fireEvent.click(trigger);
+ expect(
+ screen.queryByRole("button", {
+ name: "settings:projectIntegrations.connect",
+ }),
+ ).toBeNull();
+ expect(screen.queryByText("Integration settings")).toBeNull();
+ },
+ );
+ it("offers a retry after a failed read instead of a connection form", () => {
+ const onRetry = vi.fn();
+ render(
+ <IntegrationRow
+ integration={integration}
+ projectId="p1"
+ status={{ state: "unavailable" }}
+ onRetry={onRetry}
+ />,
+ );
+ expect(screen.getByRole("status")).toHaveTextContent("common:error.title");
+ fireEvent.click(
+ screen.getByRole("button", { name: "common:error.tryAgain" }),
+ );
+ expect(onRetry).toHaveBeenCalledOnce();
+ expect(screen.queryByText("Integration settings")).toBeNull();
+ });
+ it("keeps an open panel mounted after a background status failure", () => {
+ const props = { integration, projectId: "p1", onRetry: vi.fn() };
+ const { rerender } = render(
+ <IntegrationRow {...props} status={{ state: "connected" }} />,
+ );
+ fireEvent.click(
+ screen.getByRole("button", {
+ name: "settings:projectIntegrations.configure",
+ }),
+ );
+ const panel = screen.getByText("Integration settings");
+ rerender(<IntegrationRow {...props} status={{ state: "unavailable" }} />);
+ expect(screen.getByText("Integration settings")).toBe(panel);
+ fireEvent.click(
+ screen.getByRole("button", { name: "settings:projectIntegrations.done" }),
+ );
+ expect(
+ screen.getByRole("button", { name: "common:error.tryAgain" }),
+ ).toBeEnabled();
+ });
+
+ it("offers Connect after a successful unconfigured status read", () => {
+ render(
+ <IntegrationRow
+ integration={integration}
+ projectId="p1"
+ status={{ state: "disconnected" }}
+ onRetry={vi.fn()}
+ />,
+ );
+ fireEvent.click(
+ screen.getByRole("button", {
+ name: "settings:projectIntegrations.connect",
+ }),
+ );
+ expect(screen.getByText("Integration settings")).toBeVisible();
+ });
+ it.each(["connected", "paused"] as const)(
+ "shows configuration for a %s integration",
+ (state) => {
+ render(
+ <IntegrationRow
+ integration={integration}
+ projectId="p1"
+ status={{ state, detail: "acme/web" }}
+ onRetry={vi.fn()}
+ />,
+ );
+ expect(screen.getByText("acme/web")).toBeVisible();
+ fireEvent.click(
+ screen.getByRole("button", {
+ name: "settings:projectIntegrations.configure",
+ }),
+ );
+ expect(screen.getByText("Integration settings")).toBeVisible();
+ expect(
+ screen.getByRole("button", {
+ name: "settings:projectIntegrations.done",
+ }),
+ ).toBeEnabled();
+ },
+ );
+});
diff --git a/apps/web/src/components/project/integrations/integration-row.tsx b/apps/web/src/components/project/integrations/integration-row.tsx
index de861f116..7182ce82a 100644
--- a/apps/web/src/components/project/integrations/integration-row.tsx
+++ b/apps/web/src/components/project/integrations/integration-row.tsx
@@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next";
import type { IntegrationStatus } from "@/components/project/integrations/get-integration-status";
import type { IntegrationDefinition } from "@/components/project/integrations/integration-definitions";
import { IntegrationStatusBadge } from "@/components/project/integrations/integration-status-badge";
-import { buttonVariants } from "@/components/ui/button";
+import { Button, buttonVariants } from "@/components/ui/button";
import {
Collapsible,
CollapsiblePanel,
@@ -12,6 +12,7 @@ import {
import { cn } from "@/lib/cn";
type IntegrationRowProps = {
+ onRetry: () => void;
integration: IntegrationDefinition;
projectId: string;
status: IntegrationStatus | undefined;
@@ -19,6 +20,7 @@ type IntegrationRowProps = {
export function IntegrationRow({
integration,
+ onRetry,
projectId,
status,
}: IntegrationRowProps) {
@@ -28,8 +30,8 @@ export function IntegrationRow({
typeof integration.name === "string"
? integration.name
: t(integration.name.key);
- const state = status?.state ?? "disconnected";
- const isSetUp = state !== "disconnected";
+ const state = status?.state ?? "loading";
+ const isSetUp = state === "connected" || state === "paused";
return (
<Collapsible open={open} onOpenChange={setOpen}>
@@ -55,19 +57,34 @@ export function IntegrationRow({
</p>
)}
</div>
- <CollapsibleTrigger
- className={buttonVariants({
- variant: "outline",
- size: "sm",
- className: "w-24 shrink-0",
- })}
- >
- {open
- ? t("settings:projectIntegrations.done")
- : isSetUp
- ? t("settings:projectIntegrations.configure")
- : t("settings:projectIntegrations.connect")}
- </CollapsibleTrigger>
+ {state === "unavailable" && !open ? (
+ <Button
+ className="w-24 shrink-0"
+ onClick={onRetry}
+ size="sm"
+ type="button"
+ variant="outline"
+ >
+ {t("common:error.tryAgain")}
+ </Button>
+ ) : (
+ <CollapsibleTrigger
+ disabled={state === "loading" && !open}
+ className={buttonVariants({
+ variant: "outline",
+ size: "sm",
+ className: "w-24 shrink-0",
+ })}
+ >
+ {open
+ ? t("settings:projectIntegrations.done")
+ : state === "loading"
+ ? t("common:empty.loading")
+ : isSetUp
+ ? t("settings:projectIntegrations.configure")
+ : t("settings:projectIntegrations.connect")}
+ </CollapsibleTrigger>
+ )}
</div>
<CollapsiblePanel>
<div className="border-t border-border bg-muted/40 p-4">
diff --git a/apps/web/src/components/project/integrations/integration-status-badge.tsx b/apps/web/src/components/project/integrations/integration-status-badge.tsx
index ebe121cc3..0d8b677a6 100644
--- a/apps/web/src/components/project/integrations/integration-status-badge.tsx
+++ b/apps/web/src/components/project/integrations/integration-status-badge.tsx
@@ -9,7 +9,14 @@ type IntegrationStatusBadgeProps = {
export function IntegrationStatusBadge({ state }: IntegrationStatusBadgeProps) {
const { t } = useTranslation();
- if (state === "disconnected") return null;
+ if (state === "disconnected" || state === "loading") return null;
+ if (state === "unavailable") {
+ return (
+ <span className="text-xs text-muted-foreground" role="status">
+ {t("common:error.title")}
+ </span>
+ );
+ }
const connected = state === "connected";
diff --git a/apps/web/src/components/project/integrations/integrations-group.tsx b/apps/web/src/components/project/integrations/integrations-group.tsx
index 039d3838b..d72a27b40 100644
--- a/apps/web/src/components/project/integrations/integrations-group.tsx
+++ b/apps/web/src/components/project/integrations/integrations-group.tsx
@@ -7,6 +7,7 @@ import { IntegrationRow } from "@/components/project/integrations/integration-ro
import { SettingsSectionHeader } from "@/components/settings/settings-section-header";
type IntegrationsGroupProps = {
+ onRetry: (id: IntegrationId) => void;
title: string;
integrations: IntegrationDefinition[];
projectId: string;
@@ -15,6 +16,7 @@ type IntegrationsGroupProps = {
export function IntegrationsGroup({
title,
+ onRetry,
integrations,
projectId,
statuses,
@@ -29,6 +31,7 @@ export function IntegrationsGroup({
integration={integration}
projectId={projectId}
status={statuses[integration.id]}
+ onRetry={() => onRetry(integration.id)}
/>
))}
</div>
diff --git a/apps/web/src/components/project/integrations/use-integration-statuses.test.tsx b/apps/web/src/components/project/integrations/use-integration-statuses.test.tsx
new file mode 100644
index 000000000..c771cae3a
--- /dev/null
+++ b/apps/web/src/components/project/integrations/use-integration-statuses.test.tsx
@@ -0,0 +1,142 @@
+import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+import { act, cleanup, renderHook, waitFor } from "@testing-library/react";
+import type { ReactNode } from "react";
+import {
+ afterEach,
+ beforeEach,
+ describe,
+ expect,
+ it,
+ vi,
+} from "vite-plus/test";
+import { useIntegrationStatuses } from "@/components/project/integrations/use-integration-statuses";
+const fetchers = vi.hoisted(() => ({
+ github: vi.fn(),
+ gitea: vi.fn(),
+ gitlab: vi.fn(),
+ slack: vi.fn(),
+ discord: vi.fn(),
+ mattermost: vi.fn(),
+ telegram: vi.fn(),
+ webhook: vi.fn(),
+}));
+vi.mock("@/fetchers/github-integration/get-github-integration", () => ({
+ default: fetchers.github,
+}));
+vi.mock("@/fetchers/gitea-integration/get-gitea-integration", () => ({
+ default: fetchers.gitea,
+}));
+vi.mock("@/fetchers/gitlab-integration/get-gitlab-integration", () => ({
+ default: fetchers.gitlab,
+}));
+vi.mock("@/fetchers/slack-integration/get-slack-integration", () => ({
+ default: fetchers.slack,
+}));
+vi.mock("@/fetchers/discord-integration/get-discord-integration", () => ({
+ default: fetchers.discord,
+}));
+vi.mock("@/fetchers/mattermost-integration/get-mattermost-integration", () => ({
+ default: fetchers.mattermost,
+}));
+vi.mock("@/fetchers/telegram-integration/get-telegram-integration", () => ({
+ default: fetchers.telegram,
+}));
+vi.mock(
+ "@/fetchers/generic-webhook-integration/get-generic-webhook-integration",
+ () => ({ default: fetchers.webhook }),
+);
+
+let client: QueryClient;
+function wrapper({ children }: { children: ReactNode }) {
+ return <QueryClientProvider client={client}>{children}</QueryClientProvider>;
+}
+beforeEach(() => {
+ client = new QueryClient({ defaultOptions: { queries: { retry: false } } });
+ for (const fetcher of Object.values(fetchers))
+ fetcher.mockReset().mockResolvedValue(null);
+});
+afterEach(() => {
+ cleanup();
+ client.clear();
+});
+describe("useIntegrationStatuses", () => {
+ it("reads all integrations without a management permission gate", async () => {
+ fetchers.slack.mockResolvedValue({
+ webhookConfigured: true,
+ channelName: "general",
+ isActive: true,
+ });
+ const { result } = renderHook(() => useIntegrationStatuses("p1"), {
+ wrapper,
+ });
+ await waitFor(() =>
+ expect(result.current.statuses.slack).toEqual({
+ state: "connected",
+ detail: "#general",
+ }),
+ );
+ for (const fetcher of Object.values(fetchers))
+ expect(fetcher).toHaveBeenCalledWith("p1");
+ expect(result.current.statuses.github.state).toBe("disconnected");
+ });
+ it("keeps pending requests unknown until configuration arrives", async () => {
+ let resolve!: (value: unknown) => void;
+ fetchers.github.mockReturnValue(
+ new Promise((done) => {
+ resolve = done;
+ }),
+ );
+ const { result } = renderHook(() => useIntegrationStatuses("p1"), {
+ wrapper,
+ });
+ expect(result.current.statuses.github.state).toBe("loading");
+ await act(async () => {
+ resolve({
+ repositoryOwner: "acme",
+ repositoryName: "web",
+ isActive: true,
+ });
+ });
+ await waitFor(() =>
+ expect(result.current.statuses.github).toEqual({
+ state: "connected",
+ detail: "acme/web",
+ }),
+ );
+ });
+ it("retries only the failed integration and recovers", async () => {
+ fetchers.github
+ .mockRejectedValueOnce(new Error("Network unavailable"))
+ .mockResolvedValue(null);
+ const { result } = renderHook(() => useIntegrationStatuses("p1"), {
+ wrapper,
+ });
+ await waitFor(() =>
+ expect(result.current.statuses.github.state).toBe("unavailable"),
+ );
+ act(() => result.current.retry("github"));
+ await waitFor(() =>
+ expect(result.current.statuses.github.state).toBe("disconnected"),
+ );
+ expect(fetchers.github).toHaveBeenCalledTimes(2);
+ for (const [id, fetcher] of Object.entries(fetchers))
+ if (id !== "github") expect(fetcher).toHaveBeenCalledOnce();
+ });
+ it("starts with an unknown status when switching projects", async () => {
+ fetchers.github.mockImplementation((projectId: string) =>
+ projectId === "p1"
+ ? Promise.resolve({ repositoryOwner: "acme", repositoryName: "web" })
+ : new Promise(() => {}),
+ );
+ const { result, rerender } = renderHook(
+ ({ projectId }) => useIntegrationStatuses(projectId),
+ { initialProps: { projectId: "p1" }, wrapper },
+ );
+ await waitFor(() =>
+ expect(result.current.statuses.github.state).toBe("connected"),
+ );
+ rerender({ projectId: "p2" });
+ expect(result.current.statuses.github.state).toBe("loading");
+ expect(result.current.statuses.github.detail).toBeUndefined();
+ });
+});
diff --git a/apps/web/src/components/project/integrations/use-integration-statuses.ts b/apps/web/src/components/project/integrations/use-integration-statuses.ts
index 1dff81aa9..d8e1d3ed2 100644
--- a/apps/web/src/components/project/integrations/use-integration-statuses.ts
+++ b/apps/web/src/components/project/integrations/use-integration-statuses.ts
@@ -2,7 +2,6 @@ import {
formatChannel,
formatRepository,
getIntegrationStatus,
- type IntegrationStatus,
} from "@/components/project/integrations/get-integration-status";
import type { IntegrationId } from "@/components/project/integrations/integration-definitions";
import useGetDiscordIntegration from "@/hooks/queries/discord-integration/use-get-discord-integration";
@@ -16,61 +15,86 @@ import useGetTelegramIntegration from "@/hooks/queries/telegram-integration/use-
// Shares query keys with the per-integration settings panels, so opening a
// panel reuses what the list already loaded.
-export function useIntegrationStatuses(
- projectId: string,
- enabled: boolean,
-): Partial<Record<IntegrationId, IntegrationStatus>> {
- const options = { enabled };
- const { data: github } = useGetGithubIntegration(projectId, options);
- const { data: gitea } = useGetGiteaIntegration(projectId, options);
- const { data: gitlab } = useGetGitlabIntegration(projectId, options);
- const { data: slack } = useGetSlackIntegration(projectId, options);
- const { data: discord } = useGetDiscordIntegration(projectId, options);
- const { data: mattermost } = useGetMattermostIntegration(projectId, options);
- const { data: telegram } = useGetTelegramIntegration(projectId, options);
- const { data: webhook } = useGetGenericWebhookIntegration(projectId, options);
+export function useIntegrationStatuses(projectId: string) {
+ const github = useGetGithubIntegration(projectId);
+ const gitea = useGetGiteaIntegration(projectId);
+ const gitlab = useGetGitlabIntegration(projectId);
+ const slack = useGetSlackIntegration(projectId);
+ const discord = useGetDiscordIntegration(projectId);
+ const mattermost = useGetMattermostIntegration(projectId);
+ const telegram = useGetTelegramIntegration(projectId);
+ const webhook = useGetGenericWebhookIntegration(projectId);
- if (!enabled) return {};
-
- return {
+ const statuses = {
github: getIntegrationStatus({
- configured: Boolean(github),
- isActive: github?.isActive,
- detail: formatRepository(github?.repositoryOwner, github?.repositoryName),
+ queryStatus: github.status,
+ configured: Boolean(github.data),
+ isActive: github.data?.isActive,
+ detail: formatRepository(
+ github.data?.repositoryOwner,
+ github.data?.repositoryName,
+ ),
}),
gitea: getIntegrationStatus({
- configured: Boolean(gitea),
- isActive: gitea?.isActive,
- detail: formatRepository(gitea?.repositoryOwner, gitea?.repositoryName),
+ queryStatus: gitea.status,
+ configured: Boolean(gitea.data),
+ isActive: gitea.data?.isActive,
+ detail: formatRepository(
+ gitea.data?.repositoryOwner,
+ gitea.data?.repositoryName,
+ ),
}),
gitlab: getIntegrationStatus({
- configured: Boolean(gitlab),
- isActive: gitlab?.isActive,
- detail: gitlab?.projectPath,
+ queryStatus: gitlab.status,
+ configured: Boolean(gitlab.data),
+ isActive: gitlab.data?.isActive,
+ detail: gitlab.data?.projectPath,
}),
slack: getIntegrationStatus({
- configured: Boolean(slack?.webhookConfigured),
- isActive: slack?.isActive,
- detail: formatChannel(slack?.channelName),
+ queryStatus: slack.status,
+ configured: Boolean(slack.data?.webhookConfigured),
+ isActive: slack.data?.isActive,
+ detail: formatChannel(slack.data?.channelName),
}),
discord: getIntegrationStatus({
- configured: Boolean(discord?.webhookConfigured),
- isActive: discord?.isActive,
- detail: formatChannel(discord?.channelName),
+ queryStatus: discord.status,
+ configured: Boolean(discord.data?.webhookConfigured),
+ isActive: discord.data?.isActive,
+ detail: formatChannel(discord.data?.channelName),
}),
mattermost: getIntegrationStatus({
- configured: Boolean(mattermost?.webhookConfigured),
- isActive: mattermost?.isActive,
- detail: formatChannel(mattermost?.channelName),
+ queryStatus: mattermost.status,
+ configured: Boolean(mattermost.data?.webhookConfigured),
+ isActive: mattermost.data?.isActive,
+ detail: formatChannel(mattermost.data?.channelName),
}),
telegram: getIntegrationStatus({
- configured: Boolean(telegram?.botTokenConfigured),
- isActive: telegram?.isActive,
- detail: telegram?.chatLabel,
+ queryStatus: telegram.status,
+ configured: Boolean(telegram.data?.botTokenConfigured),
+ isActive: telegram.data?.isActive,
+ detail: telegram.data?.chatLabel,
}),
webhook: getIntegrationStatus({
- configured: Boolean(webhook?.webhookConfigured),
- isActive: webhook?.isActive,
+ queryStatus: webhook.status,
+ configured: Boolean(webhook.data?.webhookConfigured),
+ isActive: webhook.data?.isActive,
}),
};
+ const queries = {
+ github,
+ gitea,
+ gitlab,
+ slack,
+ discord,
+ mattermost,
+ telegram,
+ webhook,
+ };
+
+ return {
+ statuses,
+ retry: (id: IntegrationId) => {
+ void queries[id].refetch();
+ },
+ };
}
diff --git a/apps/web/src/components/settings/nav/should-leave-on-escape.test.ts b/apps/web/src/components/settings/nav/should-leave-on-escape.test.ts
index fd8d32117..d919b5008 100644
--- a/apps/web/src/components/settings/nav/should-leave-on-escape.test.ts
+++ b/apps/web/src/components/settings/nav/should-leave-on-escape.test.ts
@@ -56,6 +56,37 @@ describe("shouldLeaveOnEscape", () => {
);
});
+ it.each(["toast-popup", "tooltip-popup"])("ignores a visible %s", (slot) => {
+ const popup = document.createElement("div");
+ popup.dataset.slot = slot;
+ document.body.append(popup);
+
+ expect(shouldLeaveOnEscape(escapeFrom(document.body), document)).toBe(true);
+ });
+
+ it.each([
+ "dialog-popup",
+ "alert-dialog-popup",
+ "sheet-popup",
+ "menu-popup",
+ "select-popup",
+ "combobox-popup",
+ "autocomplete-popup",
+ "popover-popup",
+ "command-dialog-popup",
+ "preview-card-content",
+ ])("leaves Escape to an open %s", (slot) => {
+ const popup = document.createElement("div");
+ popup.dataset.slot = slot;
+ document.body.append(popup);
+
+ expect(shouldLeaveOnEscape(escapeFrom(document.body), document)).toBe(
+ false,
+ );
+ popup.setAttribute("data-closed", "");
+ expect(shouldLeaveOnEscape(escapeFrom(document.body), document)).toBe(true);
+ });
+
it("ignores popups that stay mounted after closing", () => {
const positioner = document.createElement("div");
positioner.hidden = true;
diff --git a/apps/web/src/components/settings/nav/should-leave-on-escape.ts b/apps/web/src/components/settings/nav/should-leave-on-escape.ts
index ccf787c82..c5f753034 100644
--- a/apps/web/src/components/settings/nav/should-leave-on-escape.ts
+++ b/apps/web/src/components/settings/nav/should-leave-on-escape.ts
@@ -6,7 +6,16 @@ const OVERLAY_SELECTOR = [
'[role="dialog"]',
'[role="alertdialog"]',
'[role="menu"]',
- '[data-slot$="-popup"]',
+ '[data-slot="dialog-popup"]',
+ '[data-slot="alert-dialog-popup"]',
+ '[data-slot="sheet-popup"]',
+ '[data-slot="menu-popup"]',
+ '[data-slot="select-popup"]',
+ '[data-slot="combobox-popup"]',
+ '[data-slot="autocomplete-popup"]',
+ '[data-slot="popover-popup"]',
+ '[data-slot="command-dialog-popup"]',
+ '[data-slot="preview-card-content"]',
].join(",");
function hasOpenOverlay(root: ParentNode) {
diff --git a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/projects/$projectId/integrations.tsx b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/projects/$projectId/integrations.tsx
index 98500b6e9..54440e16a 100644
--- a/apps/web/src/routes/_layout/_authenticated/dashboard/settings/projects/$projectId/integrations.tsx
+++ b/apps/web/src/routes/_layout/_authenticated/dashboard/settings/projects/$projectId/integrations.tsx
@@ -5,7 +5,6 @@ import { INTEGRATIONS } from "@/components/project/integrations/integration-defi
import { IntegrationsGroup } from "@/components/project/integrations/integrations-group";
import { useIntegrationStatuses } from "@/components/project/integrations/use-integration-statuses";
import { SettingsPage } from "@/components/settings/settings-page";
-import { useWorkspacePermission } from "@/hooks/use-workspace-permission";
export const Route = createFileRoute(
"/_layout/_authenticated/dashboard/settings/projects/$projectId/integrations",
@@ -16,8 +15,7 @@ export const Route = createFileRoute(
function RouteComponent() {
const { t } = useTranslation();
const { projectId } = Route.useParams();
- const { canManageSettings } = useWorkspacePermission();
- const statuses = useIntegrationStatuses(projectId, canManageSettings());
+ const { statuses, retry } = useIntegrationStatuses(projectId);
return (
<>
@@ -33,6 +31,7 @@ function RouteComponent() {
)}
projectId={projectId}
statuses={statuses}
+ onRetry={retry}
/>
<IntegrationsGroup
title={t("settings:projectIntegrations.chatTitle")}
@@ -41,6 +40,7 @@ function RouteComponent() {
)}
projectId={projectId}
statuses={statuses}
+ onRetry={retry}
/>
</SettingsPage>
</>