Skip to content

Conversation

@TinsFox
Copy link

@TinsFox TinsFox commented Aug 16, 2025

Added a function for generating an invitation link and joining the team through the link, making collaboration more convenient.

image image

@vercel
Copy link

vercel bot commented Aug 16, 2025

@TinsFox is attempting to deploy a commit to the umami-software Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR implements a comprehensive team invitation and joining system for the Umami analytics platform. The feature allows team administrators to generate invitation links containing access codes that can be shared with potential team members, streamlining the team collaboration process.

The implementation includes several key components:

  1. Team Invitation Generation: The existing TeamEditForm component now displays a read-only invitation link field that combines the current hostname with /invite?accessCode= and the team's access code. This gives administrators an easy way to generate and share invitation URLs.

  2. Dedicated Invitation Page: A new /invite route is created with InvitePage and supporting components that handle the invitation workflow. When users visit an invitation link, they land on a dedicated page with a pre-populated form.

  3. Pre-filled Join Form: The InviteForm component extracts the access code from URL search parameters and automatically fills in the join form, reducing friction for new team members. The form uses the same /teams/join API endpoint as the existing TeamJoinForm.

  4. Internationalization Support: New localization keys are added to support the invitation link label across different languages, maintaining the platform's multilingual capabilities.

The feature integrates well with the existing team management infrastructure, reusing established API endpoints and following similar patterns to the existing TeamJoinForm component. The invitation workflow creates a more user-friendly alternative to manually sharing access codes, as users can simply click a link to join a team rather than copying and pasting access codes.

Confidence score: 1/5

  • This PR has critical localization and implementation issues that will cause immediate problems in production
  • Score reflects a critical localization bug where Chinese text appears in English UI, plus several functional issues in the invitation form
  • Pay close attention to src/lang/en-US.json for the localization error and src/app/(main)/invite/InviteForm.tsx for the non-functional cancel button and missing navigation logic

8 files reviewed, 5 comments

Edit Code Review Bot Settings | Greptile

<Button type="submit" variant="primary">
{formatMessage(labels.join)}
</Button>
<Button onClick={() => {}}>{formatMessage(labels.cancel)}</Button>
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Cancel button has empty onClick handler - users cannot actually cancel or navigate away

Comment on lines +20 to +25
const handleSubmit = async (data: any) => {
mutate(data, {
onSuccess: async () => {
touch('teams:members');
},
});
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: No navigation or user feedback after successful team join - users may not know the operation completed

<FormRow label={formatMessage(labels.invitationLink)}>
<Flexbox gap={10}>
<TextField
value={`${window.location.host}/invite?accessCode=${accessCode}`}
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Using window.location.host in a Next.js component can cause hydration errors since window is undefined during server-side rendering. Consider using useEffect to set this value client-side only.

Comment on lines +74 to +82
<FormRow label={formatMessage(labels.invitationLink)}>
<Flexbox gap={10}>
<TextField
value={`${window.location.host}/invite?accessCode=${accessCode}`}
readOnly
allowCopy
/>
</Flexbox>
</FormRow>
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: The invitation link is shown regardless of cloudMode or allowEdit permissions, while the access code field above is conditionally rendered. Consider if this should have similar conditional logic.

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.

1 participant