feat(react, examples): add service hook, container, and example apps#161
Open
rax7389 wants to merge 3 commits intofeat/mm-invitations-componentsfrom
Open
feat(react, examples): add service hook, container, and example apps#161rax7389 wants to merge 3 commits intofeat/mm-invitations-componentsfrom
rax7389 wants to merge 3 commits intofeat/mm-invitations-componentsfrom
Conversation
7b93170 to
bf603bf
Compare
2d3d1df to
312a1ae
Compare
bf603bf to
e29c388
Compare
b1ad377 to
1755393
Compare
1333dcb to
abd498c
Compare
1755393 to
abd498c
Compare
abd498c to
1397fc9
Compare
dd0358c to
89fff00
Compare
1397fc9 to
3fef17b
Compare
89fff00 to
f5d3f6e
Compare
3fef17b to
2b6461e
Compare
f5d3f6e to
2880189
Compare
9f53be5 to
e9c796d
Compare
4184f90 to
d1e9fd7
Compare
a831fdd to
53b1407
Compare
d1e9fd7 to
5b79311
Compare
| } from '@/types/my-organization/member-management/organization-member-management-types'; | ||
|
|
||
| export const memberManagementQueryKeys = { | ||
| all: ['member-management'] as const, |
Contributor
There was a problem hiding this comment.
this can be moved to core
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Summary: Adds the central
useOrganizationMemberManagementhook for state management, a service layer hook for API abstraction, theOrganizationMemberManagementcontainer component connecting the hook to the view layer, and example app integration with sidebar navigation.Why: The presentational components from PR 3 are purely prop-driven. This PR provides the orchestration layer — a single hook that manages all invitation state (fetching, mutations, pagination, sorting, filtering, modals) and a container component that wires everything together. Separating the hook from the UI components keeps business logic testable and the view layer thin.
What:
useMemberManagementServiceHook (Service Layer)Abstraction layer for member management API calls, encapsulating all invitation CRUD operations via TanStack Query. This separates API concerns from UI state management.
useOrganizationMemberManagementHookCentral hook managing all invitation lifecycle state:
useMemberManagementServicefor queries and mutations.useCheckpointPagination(from PR 2) for token stack management.created_at→created-at).useRefrequest ID tracking for details fetch to discard stale responses.OrganizationMemberManagementContainer ComponentConnects the hook to the view layer with tab-based navigation (Members / Invitations), renders the invitation table and all modals (create, details, revoke, revoke-resend). Supports theming via
getComponentStyles,readOnlymode,hideHeader, and custom CSS classes.Example App Integration
/member-managementpage to all example apps (next-rwa,react-spa-npm,react-spa-shadcn).Usersicon.Exports
OrganizationMemberManagementtocomponents/index.tsuseOrganizationMemberManagementtohooks/index.tsReferences
Part of the member management invitations feature.
Testing
Integration tests are in PR 5.
Checklist