Skip to content

feat(admin): list and revoke pending invites from organization members - #1862

Open
Shreyag02 wants to merge 2 commits into
mainfrom
feat/org-details-pending-invites
Open

feat(admin): list and revoke pending invites from organization members#1862
Shreyag02 wants to merge 2 commits into
mainfrom
feat/org-details-pending-invites

Conversation

@Shreyag02

@Shreyag02 Shreyag02 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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

  • Members toolbar: "N Invites" trigger, shown only when the org has invites
  • "Invited members" modal listing email, role, status, invited on and expiry, with search
  • Remove action per invite, behind a confirmation dialog
  • "Invite member" button in the modal, reusing the existing invite dialog
  • useOrganizationRoles (added in feat(admin): list pending invites in user details side panel #1847) takes an enabled option and is reused by organization details

Technical Details

  • Toolbar is rebuilt from DataTable.Filters + DataTable.DisplayControls, since DataTable.Toolbar accepts no children and the design puts the trigger left of Display.
  • Table runs in mode="client": ListOrganizationInvitations takes no query params and returns every row, so there is no server-side search or pagination to hook into. Search is scoped to email; the action column is opted out so invite uuids aren't matched.
  • Status and expiry are derived from expires_at at render, as the API returns lapsed invites too. The trigger reads "N Invites", not "N Pending", because the count covers every row and Status distinguishes them. Expiry uses the default foreground — Status already signals expired.
  • Removal calls DeleteOrganizationInvitation and invalidates the list query, refreshing both the table and the count. Confirmation wording differs for live vs expired invites.
  • Invitations are fetched on the members page, not in the modal, because the toolbar needs the count first. The trigger is the count, so a failed fetch stays hidden and logs.

Test Plan

  • Manual testing completed
    • Count appears with invites, hidden without, and matches the modal's rows
    • Search filters by email; a pasted invite id matches nothing
    • Remove revokes the invite and updates both list and count, with expired wording for lapsed ones
    • Invite member opens the existing dialog and the new invite appears
  • Build and type checking passes
    • tsc --noEmit and eslint clean on the touched files, apart from 3 pre-existing unused-arg warnings
    • pnpm build succeeds in web/sdk

SQL Safety (if your PR touches *_repository.go or goqu.*)

Not applicable — frontend only, no Go or query changes.

@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontier Ready Ready Preview Aug 11, 2026 12:18pm

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b455ae5d-ed89-48e1-920e-1fb97ed36316

📥 Commits

Reviewing files that changed from the base of the PR and between 99025f3 and 62d1125.

📒 Files selected for processing (1)
  • web/sdk/admin/views/organizations/details/members/invited-members-columns.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/sdk/admin/views/organizations/details/members/invited-members-columns.tsx

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added an organization invitation view for members, including searchable and sortable invitation details.
    • Display invitation emails, assigned roles, status, invitation and expiry dates, and available row actions.
    • Added an invitation dialog with empty, loading, and error states.
    • Added the ability to open the invite-users flow and remove pending or expired invitations with confirmation.
    • Added success and error notifications for invitation removal.
    • Consolidated organization role loading for more consistent role information across organization details.

Walkthrough

The change centralizes organization-role loading and adds invitation management to the organization members view. Administrators can view searchable and sortable invitations, open the invitation flow, and remove pending or expired invitations.

Changes

Organization roles and invitations

Layer / File(s) Summary
Shared organization-role loading
web/sdk/admin/hooks/useOrganizationRoles.ts, web/sdk/admin/views/organizations/details/index.tsx
The new hook combines default and organization-specific roles. The organization details view uses the combined roles and loading state.
Invitation listing and display
web/sdk/admin/views/organizations/details/members/index.tsx, web/sdk/admin/views/organizations/details/members/invited-members-columns.tsx, web/sdk/admin/views/organizations/details/members/invited-members-dialog.tsx, web/sdk/admin/views/organizations/details/members/members.module.css
The members view loads organization invitations and opens a searchable, sortable dialog with role, status, and timestamp columns.
Invitation removal
web/sdk/admin/views/organizations/details/members/remove-invite-dialog.tsx
The removal dialog deletes invitations, handles mutation errors, shows toasts, closes on success, and invalidates invitation data.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • raystack/frontier#1664: Both changes modify the organization members view, but this change handles invitations while that PR handles role updates.
  • raystack/frontier#1847: Both changes use useOrganizationRoles for default and organization-specific role loading.

Suggested reviewers: paansinghcoder, rohanchkrabrty

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between c294c5f and 91a64ee.

📒 Files selected for processing (11)
  • web/sdk/admin/hooks/useOrganizationRoles.ts
  • web/sdk/admin/utils/connect-timestamp.ts
  • web/sdk/admin/views/organizations/details/index.tsx
  • web/sdk/admin/views/organizations/details/members/index.tsx
  • web/sdk/admin/views/organizations/details/members/invited-members-columns.tsx
  • web/sdk/admin/views/organizations/details/members/invited-members-dialog.tsx
  • web/sdk/admin/views/organizations/details/members/members.module.css
  • web/sdk/admin/views/organizations/details/members/remove-invite-dialog.tsx
  • web/sdk/admin/views/users/details/layout/membership-dropdown.tsx
  • web/sdk/admin/views/users/details/layout/side-panel-invitation.tsx
  • web/sdk/admin/views/users/details/layout/side-panel.tsx

Comment thread web/sdk/admin/views/organizations/details/members/index.tsx
@coveralls

coveralls commented Aug 7, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 31490525595

Coverage remained the same at 48.097%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 39919
Covered Lines: 19200
Line Coverage: 48.1%
Coverage Strength: 15.37 hits per line

💛 - Coveralls

@Shreyag02 Shreyag02 changed the title org details pending invites feat(admin): list and revoke pending invites from organization members Aug 10, 2026
Add a pending-invites section to the organization details members view,
with a dialog to browse invites and revoke them.
- invited-members table lists invites with role titles and expiry
- remove-invite dialog handles revocation
- useOrganizationRoles gains an optional `enabled` flag so callers can
  defer both role fetches until an org id is known
- expiry no longer renders in danger red; matches the Status column
- Menu.Content gets align="end", as the SDK members list does
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants