feat(admin): list and revoke pending invites from organization members - #1862
feat(admin): list and revoke pending invites from organization members#1862Shreyag02 wants to merge 12 commits into
Conversation
panel and extract org role fetching into useOrganizationRoles
…s-pending-invites
…s-pending-invites
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe change centralizes organization-role loading and adds invitation retrieval, display, expiry formatting, and removal flows for organization members and user detail panels. ChangesOrganization invitation flows
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c5ddb944-9e6a-49ab-b1dc-2266b50a17c5
📒 Files selected for processing (11)
web/sdk/admin/hooks/useOrganizationRoles.tsweb/sdk/admin/utils/connect-timestamp.tsweb/sdk/admin/views/organizations/details/index.tsxweb/sdk/admin/views/organizations/details/members/index.tsxweb/sdk/admin/views/organizations/details/members/invited-members-columns.tsxweb/sdk/admin/views/organizations/details/members/invited-members-dialog.tsxweb/sdk/admin/views/organizations/details/members/members.module.cssweb/sdk/admin/views/organizations/details/members/remove-invite-dialog.tsxweb/sdk/admin/views/users/details/layout/membership-dropdown.tsxweb/sdk/admin/views/users/details/layout/side-panel-invitation.tsxweb/sdk/admin/views/users/details/layout/side-panel.tsx
Coverage Report for CI Build 31430567552Coverage remained the same at 48.097%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
…h to email - the list API returns lapsed invites, so "N Pending invite" overstated the count; the trigger now reads "N Invites" and Status labels each row - log a failed invitations fetch instead of silently hiding the trigger - exclude the action column from the client global filter, which otherwise matched invite ids
Summary
Adds a way to view and manage an organization's pending invites from the Members page.
An "N Invites" button sits next to Display in the members toolbar and opens a modal
listing every invitation sent for that org, where an invite can be revoked.
Changes
useOrganizationRoles(added in feat(admin): list pending invites in user details side panel #1847) now takes anenabledoption and is reused byorganization details
Technical Details
DataTable.Filters+DataTable.DisplayControlsrather thanDataTable.Toolbar, which accepts no children — the design places the invites trigger tothe left of Display. Visibility matches the rule
DataTable.Toolbarapplies internally.(
DataView.Toolbardoes take children, but this table is onDataTable.)mode="client".ListOrganizationInvitationstakes no queryparameters and returns every row, so there's no server-side search or pagination to hook
into. Search is TanStack's global filter; it lands on email only, because the default
getColumnCanGlobalFilteradmits string/number cells and role ids (array) and thetimestamp columns aren't, while the action column is opted out explicitly — its
idaccessor would otherwise make invite uuids searchable.
expires_at— the API doesn't filter lapsedinvites, so both Pending and Expired rows come back and are labelled client-side.
For the same reason the trigger reads "N Invites", not "N Pending": the count covers
every row in the modal, and Status distinguishes them. Both derive
isExpiredat render,so neither ticks over on its own when an invite lapses mid-session.
DeleteOrganizationInvitationand invalidates the list query, whichrefreshes both the modal table and the toolbar count. The confirmation wording differs for
live vs expired invites.
needs the count before the modal mounts. The trigger is the count, so a failed fetch
leaves nothing to label — it stays hidden and logs, rather than carrying its own error
surface.
useOrganizationRolesneeds theenabledoption because the org-roles half already gatesitself on
orgIdbut the platform-defaults half doesn't; the option keeps that fetch gatedas organization details had it.
Not included, both blocked rather than skipped:
recoverable by joining the
organization.invitedaudit record, which needs a backend change.expired address creates a second row. Needs a product decision first.
Test Plan
tsc --noEmit: 0 errors in the files this PR touches; the remainder are pre-existing andin untouched files
eslintclean on the touched files apart from a pre-existinguserToRemoveunused-argwarning in
members/index.tsx;pnpm buildsucceeds inweb/sdkSQL Safety (if your PR touches
*_repository.goorgoqu.*)Not applicable — frontend only, no Go or query changes.