π OpenHands: AI-Driven Development
fix: treat Integrations Hub as a cross-app route (#15324)
Rohit Malhotra93c0871951f9
diff --git a/frontend/src/routes.ts b/frontend/src/routes.tsindex 8e01cc0677..aaf5be9f29 100644--- a/frontend/src/routes.ts+++ b/frontend/src/routes.ts@@ -13,6 +13,9 @@ export default [route("canvas/*", "routes/cross-app-redirect.tsx", {id: "routes/canvas-cross-app-redirect",}),+ route("integrations-hub/*", "routes/cross-app-redirect.tsx", {+ id: "routes/integrations-hub-cross-app-redirect",+ }),layout("routes/root-layout.tsx", [index("routes/home.tsx"),route("accept-tos", "routes/accept-tos.tsx"),diff --git a/frontend/src/utils/cross-app-redirect.test.ts b/frontend/src/utils/cross-app-redirect.test.tsindex e519f3b9b7..79dd6298f9 100644--- a/frontend/src/utils/cross-app-redirect.test.ts+++ b/frontend/src/utils/cross-app-redirect.test.ts@@ -14,12 +14,23 @@ describe("isCrossAppPath", () => {expect(isCrossAppPath("/canvas/conversations/abc")).toBe(true);});+ it("detects Integrations Hub app routes", () => {+ expect(isCrossAppPath("/integrations-hub")).toBe(true);+ expect(isCrossAppPath("/integrations-hub/integrations")).toBe(true);+ expect(+ isCrossAppPath("/integrations-hub/integrations?login_method=github"),+ ).toBe(true);+ });+it("does not match similarly-prefixed main app routes", () => {expect(isCrossAppPath("/automation")).toBe(false);expect(isCrossAppPath("/automations-old")).toBe(false);expect(isCrossAppPath("/canvases")).toBe(false);+ expect(isCrossAppPath("/integrations")).toBe(false);+ expect(isCrossAppPath("/integrations-hub-old")).toBe(false);expect(isCrossAppPath("/settings?returnTo=/automations")).toBe(false);expect(isCrossAppPath("/settings?returnTo=/canvas")).toBe(false);+ expect(isCrossAppPath("/settings?returnTo=/integrations-hub")).toBe(false);});it("does not treat off-origin targets as cross-app paths", () => {diff --git a/frontend/src/utils/cross-app-redirect.ts b/frontend/src/utils/cross-app-redirect.tsindex 52412b9476..ac78eb488b 100644--- a/frontend/src/utils/cross-app-redirect.ts+++ b/frontend/src/utils/cross-app-redirect.ts@@ -1,6 +1,10 @@import type { NavigateFunction, NavigateOptions } from "react-router";-const CROSS_APP_PATH_PREFIXES = ["/automations", "/canvas"] as const;+const CROSS_APP_PATH_PREFIXES = [+ "/automations",+ "/canvas",+ "/integrations-hub",+] as const;export function isCrossAppPath(destination: string): boolean {if (!destination.startsWith("/") || destination.startsWith("//")) {