What does this PR do?
This PR implements the ability to invite team members via email directly from the event-type assignment dropdown. Users can now type email addresses in the assignment field, and if the person is not already in the team, they will be automatically invited with Member role.
Summary of Changes
-
Created email validation utilities (emailUtils.ts)
isValidEmail(): Validates email format using regex
parseCommaSeparatedEmails(): Parses and validates comma-separated emails
looksLikeEmail(): Quick check for email-like input
-
Modified ChildrenEventTypeSelect.tsx
- Replaced standard Select with
ReactSelectCreatable to allow free-text input
- Integrated TRPC
inviteMember mutation for automatic invitations
- Added
handleCreateOption to process email invitations
- Implemented loading states and toast notifications
- Added custom
filterOption to support email-like inputs
-
Updated EventTeamAssignmentTab.tsx
- Passed
teamId through component hierarchy to enable invitation logic
-
Fixes #13532
-
Fixes CAL-3076
Visual Demo (For contributors especially)
A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).
Video Demo (if applicable):
- Show screen recordings of the issue or feature.
- Demonstrate how to reproduce the issue, the behavior before and after the change.
Image Demo (if applicable):
- Add side-by-side screenshots of the original and updated change.
- Highlight any significant change(s).
Mandatory Tasks (DO NOT REMOVE)
- I have self-reviewed the code (A decent size PR without self-review might be rejected).
- I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
- I confirm automated tests are in place that prove my fix is effective or that my feature works.
How should this be tested?
- Are there environment variables that should be set?
- What are the minimal test data to have?
- What is expected (happy path) to have (input and output)?
- Any other important info that could help to test that PR
Checklist
- I haven’t read the contributing guide
- My code doesn’t follow the style guidelines of this project
- I haven’t commented my code, particularly in hard-to-understand areas
- I haven’t checked if my changes generate no new warnings
/claim #13532