Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Filter out only projects that are part of current org in identity project modal
Tuan Dang82bca031622a
diff --git a/frontend/src/views/Org/IdentityPage/components/IdentityProjectsSection/IdentityAddToProjectModal.tsx b/frontend/src/views/Org/IdentityPage/components/IdentityProjectsSection/IdentityAddToProjectModal.tsxindex ca51d2845c..58697afcc3 100644--- a/frontend/src/views/Org/IdentityPage/components/IdentityProjectsSection/IdentityAddToProjectModal.tsx+++ b/frontend/src/views/Org/IdentityPage/components/IdentityProjectsSection/IdentityAddToProjectModal.tsx@@ -5,7 +5,7 @@ import { z } from "zod";import { createNotification } from "@app/components/notifications";import { Button, FormControl, Modal, ModalContent, Select, SelectItem } from "@app/components/v2";-import { useWorkspace } from "@app/context";+import { useOrganization,useWorkspace } from "@app/context";import {useAddIdentityToWorkspace,useGetIdentityProjectMemberships,@@ -33,6 +33,7 @@ type Props = {};export const IdentityAddToProjectModal = ({ identityId, popUp, handlePopUpToggle }: Props) => {+ const { currentOrg } = useOrganization();const { workspaces } = useWorkspace();const { mutateAsync: addIdentityToWorkspace } = useAddIdentityToWorkspace();@@ -58,7 +59,9 @@ export const IdentityAddToProjectModal = ({ identityId, popUp, handlePopUpTogglewsWorkspaceIds.set(projectMembership.project.id, true);});- return (workspaces || []).filter(({ id }) => !wsWorkspaceIds.has(id));+ return (workspaces || []).filter(+ ({ id, orgId }) => !wsWorkspaceIds.has(id) && orgId === currentOrg?.id+ );}, [workspaces, projectMemberships]);const onFormSubmit = async ({ projectId: workspaceId, role }: FormData) => {