feat(core, react): add service types and invitation components#160
Open
rax7389 wants to merge 9 commits intofeat/mm-invitations-core-typesfrom
Open
feat(core, react): add service types and invitation components#160rax7389 wants to merge 9 commits intofeat/mm-invitations-core-typesfrom
rax7389 wants to merge 9 commits intofeat/mm-invitations-core-typesfrom
Conversation
d32ea46 to
a3edf1e
Compare
7b93170 to
bf603bf
Compare
a3edf1e to
038ed92
Compare
bf603bf to
e29c388
Compare
038ed92 to
27b3080
Compare
1397fc9 to
3fef17b
Compare
a6cfe0d to
2b6461e
Compare
3fef17b to
2b6461e
Compare
9f53be5 to
e9c796d
Compare
a831fdd to
53b1407
Compare
NaveenChand755
requested changes
Apr 13, 2026
| return ( | ||
| <div className={className ?? 'mb-4 flex items-center justify-end gap-2'}> | ||
| <Select value={filters?.roleId ?? 'all'} onValueChange={handleRoleFilterChange}> | ||
| <SelectTrigger className="w-auto min-w-[180px]"> |
Contributor
There was a problem hiding this comment.
aria-label here would improve accessibility
| } | ||
|
|
||
| /** OrganizationInvitationTab translation messages. */ | ||
| export interface OrganizationInvitationTabMessages { |
Contributor
There was a problem hiding this comment.
shouldnt this be defined in core ?
| /** | ||
| * Organization member ID type. | ||
| */ | ||
| export type OrgMemberId = MyOrganization.OrgMemberId; |
Contributor
There was a problem hiding this comment.
we previously did replace all org to organization, should we apply the same here
Contributor
Author
There was a problem hiding this comment.
good observation let me raise this with API/SDK
| invitationPagination: InvitationPaginationState; | ||
| invitationFilters: InvitationFilterState; | ||
| invitationSortConfig: InvitationSortConfig; | ||
| showCreateModal: boolean; |
Contributor
There was a problem hiding this comment.
can we simplify this
// 2. UI State is now a single source of truth
activeModal: 'create' | 'details' | 'revoke' | 'resend' | null;
selectedInvitation: MemberInvitation | null;
// 3. Consolidated Handlers
setActiveTab: (tab: ActiveTab) => void;
/** Opens any modal and optionally sets the target invitation */
openModal: (type: 'create' | 'details' | 'revoke' | 'resend', invitation?: MemberInvitation) => void;
/** Clears activeModal and selectedInvitation in one go */
closeModal: () => void;
/** Unified submission for create/revoke/resend based on activeModal */
onConfirm: (data?: CreateInvitationInput) => void;
| invitationData.inviter = { name: inviterName }; | ||
| } | ||
|
|
||
| onCreate(invitationData); |
Contributor
There was a problem hiding this comment.
bulk invite is not supported ?
Contributor
Author
There was a problem hiding this comment.
it is there but API is still in development, but let me check sdk signature once
| e.preventDefault(); | ||
|
|
||
| // Add any remaining input to emails | ||
| const finalEmails = emailChips.map((chip) => chip.value); |
Contributor
There was a problem hiding this comment.
can we do
const finalEmails = [...new Set([
...emailChips.map((chip) => chip.value),
...(trimmedInput ? [trimmedInput] : []),
])];
// 3. Early Exit
if (finalEmails.length === 0) {
setEmailError(t('invitation.create.email_required_error'));
return;
}
// 4. Construct Base Data once
// Using conditional spread keeps the object definition atomic and clean.
const baseInvitation = {
roles: selectedRoles.length > 0 ? selectedRoles : undefined,
identity_provider_id: selectedProvider,
...(inviterName && { inviter: { name: inviterName } }),
};
|
|
||
| if (!trimmedEmail) return; | ||
|
|
||
| if (emailChips.length >= validationConfig.maxEmails) { |
Contributor
There was a problem hiding this comment.
i feel this function can be simplified further
NaveenChand755
requested changes
Apr 15, 2026
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 MyOrg-dependent service types (
@auth0/myorganization-jstype aliases), React types/utilities that depend onMemberInvitation, and all presentational invitation components — details modal, revoke modal, table with actions, create modal with multi-email input, and search filter. All components are prop-driven and fully translatable.Why: This PR bridges types to the actual
@auth0/myorganization-jsSDK and provides the complete set of presentational UI components needed for the invitation management flow. React types that depend onMemberInvitationare co-located here with the core type definitions. Separating components (this PR) from the orchestrating hook (PR 4) keeps the review focused.What:
Core Service Types (
member-management-types.ts)Type aliases mapping internal types to
@auth0/myorganization-jsSDK types for members and invitations.React Types (moved from PR 2)
organization-invitation-table-types.ts— Core entity and component prop types:organization-member-management-types.ts— Top-level management types including service layer types:Utilities (react)
member-management-utils.ts—getInvitationStatus()helper that computes status fromexpires_atwhen no explicit status is set.Presentational Components
isRevokeAndResendprop.DataPagination, role filtering viaSearchFilter, and the actions column above.TextFieldGroupwith chips), multi-role selection (Combobox), identity provider dropdown (Select), and Zod-powered validation.Other
package.json: Updated@auth0/myorganization-jsdependencypnpm-lock.yaml: Lock file updatesReferences
Part of the member management invitations feature.
Testing
Component tests are in PR 5. These are presentational components receiving all data via props.
Checklist