Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

make "deploy new relay" open the modal

x0322054c1b13d9594f
diff --git a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/DeployGatewayModal.tsx b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/DeployGatewayModal.tsx
index 9a98ce4b16..010126a41c 100644
--- a/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/DeployGatewayModal.tsx
+++ b/frontend/src/pages/organization/NetworkingPage/components/GatewayTab/components/DeployGatewayModal.tsx
@@ -166,7 +166,7 @@ export const DeployGatewayModal = ({ isOpen, onOpenChange }: Props) => {
onChange={(newValue) => {
if ((newValue as SingleValue<{ id: string }>)?.id === "_create") {
navigate({
- search: { selectedTab: "relays" }
+ search: (prev) => ({ ...prev, selectedTab: "relays", action: "deploy-relay" })
});
return;
}
diff --git a/frontend/src/pages/organization/NetworkingPage/components/RelayTab/RelayTab.tsx b/frontend/src/pages/organization/NetworkingPage/components/RelayTab/RelayTab.tsx
index e731aab425..8c62bae1c5 100644
--- a/frontend/src/pages/organization/NetworkingPage/components/RelayTab/RelayTab.tsx
+++ b/frontend/src/pages/organization/NetworkingPage/components/RelayTab/RelayTab.tsx
@@ -1,4 +1,4 @@
-import { useState } from "react";
+import { useEffect, useState } from "react";
import {
faArrowUpRightFromSquare,
faBookOpen,
@@ -12,6 +12,7 @@ import {
faTrash
} from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+import { useNavigate, useSearch } from "@tanstack/react-router";
import { formatRelative } from "date-fns";
import { createNotification } from "@app/components/notifications";
@@ -36,6 +37,7 @@ import {
Tooltip,
Tr
} from "@app/components/v2";
+import { ROUTE_PATHS } from "@app/const/routes";
import {
OrgPermissionSubjects,
OrgRelayPermissionActions
@@ -75,6 +77,25 @@ export const RelayTab = withPermission(
"deployRelay"
] as const);
+ const action = useSearch({
+ from: ROUTE_PATHS.Organization.NetworkingPage.id,
+ select: (s) => s.action
+ });
+
+ const navigate = useNavigate({
+ from: ROUTE_PATHS.Organization.NetworkingPage.path
+ });
+
+ useEffect(() => {
+ if (action === "deploy-relay") {
+ handlePopUpOpen("deployRelay");
+ navigate({
+ search: (prev) => ({ ...prev, action: undefined }),
+ replace: true
+ });
+ }
+ }, [action]);
+
const deleteRelayById = useDeleteRelayById();
const handleDeleteRelay = async () => {
diff --git a/frontend/src/pages/organization/NetworkingPage/route.tsx b/frontend/src/pages/organization/NetworkingPage/route.tsx
index 433647476d..fb81e3725e 100644
--- a/frontend/src/pages/organization/NetworkingPage/route.tsx
+++ b/frontend/src/pages/organization/NetworkingPage/route.tsx
@@ -5,7 +5,8 @@ import { z } from "zod";
import { NetworkingPage } from "./NetworkingPage";
const NetworkingPageQueryParams = z.object({
- selectedTab: z.string().catch("gateways")
+ selectedTab: z.string().catch("gateways"),
+ action: z.string().optional()
});
export const Route = createFileRoute(