From 29227e5b79b0ced85d45ed4664bcda7014821c72 Mon Sep 17 00:00:00 2001 From: Scott Wilson Date: Mon, 17 Nov 2025 16:01:22 -0800 Subject: [PATCH 1/3] improvement: add invite members link to nav bar to improve discovery --- .../components/NavBar/Navbar.tsx | 34 ++++++++++++++----- .../OrgMembersSection/OrgMembersSection.tsx | 29 +++++++++++++--- 2 files changed, 49 insertions(+), 14 deletions(-) diff --git a/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx b/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx index 4025ecc17..6d238ac70 100644 --- a/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx +++ b/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx @@ -21,6 +21,7 @@ import { import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { useQuery, useQueryClient } from "@tanstack/react-query"; import { Link, useLocation, useNavigate, useRouter, useRouterState } from "@tanstack/react-router"; +import { UserPlusIcon } from "lucide-react"; import { twMerge } from "tailwind-merge"; import { Mfa } from "@app/components/auth/Mfa"; @@ -567,15 +568,30 @@ export const Navbar = () => { )} - {user.superAdmin && !location.pathname.startsWith("/admin") && ( - - - Server Console - - )} + {/* eslint-disable-next-line no-nested-ternary */} + {!location.pathname.startsWith("/admin") ? ( + user.superAdmin ? ( + + + Server Console + + ) : ( + + + Invite Members + + ) + ) : null}
diff --git a/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/OrgMembersSection.tsx b/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/OrgMembersSection.tsx index 0b71dea25..cc25591cf 100644 --- a/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/OrgMembersSection.tsx +++ b/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/OrgMembersSection.tsx @@ -1,7 +1,8 @@ -import { useState } from "react"; -import { faPlus, faTrash } from "@fortawesome/free-solid-svg-icons"; +import { useEffect, useState } from "react"; +import { faTrash } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { BanIcon } from "lucide-react"; +import { useNavigate, useSearch } from "@tanstack/react-router"; +import { BanIcon, UserPlusIcon } from "lucide-react"; import { twMerge } from "tailwind-merge"; import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal"; @@ -16,6 +17,7 @@ import { Tooltip } from "@app/components/v2"; import { Badge, DocumentationLinkBadge } from "@app/components/v3"; +import { ROUTE_PATHS } from "@app/const/routes"; import { OrgPermissionActions, OrgPermissionSubjects, @@ -35,6 +37,7 @@ import { OrgMembersTable } from "./OrgMembersTable"; export const OrgMembersSection = () => { const { subscription } = useSubscription(); const { currentOrg, isSubOrganization } = useOrganization(); + const navigate = useNavigate(); const orgId = currentOrg?.id ?? ""; const { user } = useUser(); const userId = user?.id || ""; @@ -55,6 +58,22 @@ export const OrgMembersSection = () => { const [selectedMemberIds, setSelectedMemberIds] = useState([]); + const urlAction = useSearch({ + from: ROUTE_PATHS.Organization.AccessControlPage.id, + select: (el) => el.action, + structuralSharing: true + }); + + useEffect(() => { + if (urlAction === "invite-members") { + handlePopUpOpen("addMember"); + navigate({ + to: ".", + search: ({ action, ...search }) => search + }); + } + }, []); + const { mutateAsync: deleteMutateAsync } = useDeleteOrgMembership(); const { mutateAsync: deleteBatchMutateAsync } = useDeleteOrgMembershipBatch(); const { mutateAsync: updateOrgMembership } = useUpdateOrgMembership(); @@ -194,13 +213,13 @@ export const OrgMembersSection = () => { )} From 187740aff21e7cb16dd7c9c6fe887b094e1d49ff Mon Sep 17 00:00:00 2001 From: Scott Wilson Date: Mon, 17 Nov 2025 16:07:52 -0800 Subject: [PATCH 2/3] fix: add missing effect dependency --- .../components/OrgMembersSection/OrgMembersSection.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/OrgMembersSection.tsx b/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/OrgMembersSection.tsx index cc25591cf..42c1e5b2a 100644 --- a/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/OrgMembersSection.tsx +++ b/frontend/src/pages/organization/AccessManagementPage/components/OrgMembersTab/components/OrgMembersSection/OrgMembersSection.tsx @@ -72,7 +72,7 @@ export const OrgMembersSection = () => { search: ({ action, ...search }) => search }); } - }, []); + }, [urlAction]); const { mutateAsync: deleteMutateAsync } = useDeleteOrgMembership(); const { mutateAsync: deleteBatchMutateAsync } = useDeleteOrgMembershipBatch(); From 23369600eb62a3ddbdd3e64d80976f41cffaa938 Mon Sep 17 00:00:00 2001 From: Scott Wilson Date: Tue, 18 Nov 2025 09:11:01 -0800 Subject: [PATCH 3/3] feat: add additional link to invite members and only render if permission viable --- .../components/NavBar/Navbar.tsx | 60 +++++++++++++++---- 1 file changed, 47 insertions(+), 13 deletions(-) diff --git a/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx b/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx index 6d238ac70..6be963e2b 100644 --- a/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx +++ b/frontend/src/layouts/OrganizationLayout/components/NavBar/Navbar.tsx @@ -16,6 +16,8 @@ import { faSignOut, faToolbox, faUser, + faUserCog, + faUserPlus, faUsers } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; @@ -26,6 +28,7 @@ import { twMerge } from "tailwind-merge"; import { Mfa } from "@app/components/auth/Mfa"; import { createNotification } from "@app/components/notifications"; +import { OrgPermissionCan } from "@app/components/permissions"; import SecurityClient from "@app/components/utilities/SecurityClient"; import { BreadcrumbContainer, @@ -45,7 +48,13 @@ import { } from "@app/components/v2"; import { Badge, InstanceIcon, OrgIcon, SubOrgIcon } from "@app/components/v3"; import { envConfig } from "@app/config/env"; -import { useOrganization, useSubscription, useUser } from "@app/context"; +import { + OrgPermissionActions, + OrgPermissionSubjects, + useOrganization, + useSubscription, + useUser +} from "@app/context"; import { isInfisicalCloud } from "@app/helpers/platform"; import { useToggle } from "@app/hooks"; import { @@ -579,17 +588,23 @@ export const Navbar = () => { Server Console ) : ( - - - Invite Members - + + {(isAllowed) => + isAllowed ? ( + + + Invite Members + + ) : null + } + ) ) : null} @@ -673,8 +688,27 @@ export const Navbar = () => {
- Personal Settings + }> + Personal Settings + + + {(isAllowed) => + isAllowed ? ( + + }> + Invite Members + + + ) : null + } +