-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefill workspace invitation email (#7174) #8826
Prefill workspace invitation email (#7174) #8826
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR implements email prefilling for workspace invitations, replacing the generic sign-in prefill state with a more specific developer default state.
- Added email prefilling from invitation links in
useSignInUpForm.ts
by reading URL search params - Modified
workspace-invitation.service.ts
to include email parameter in invitation links - Replaced
isSignInPrefilledState
withisDeveloperDefaultSignInPrefilledState
for development/testing purposes - Simplified
WorkspaceInviteTeam
component by removing redundanthandleKeyDown
handler - Updated auth tests to reflect new state management approach
💡 (3/5) Reply to the bot's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!
8 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile
const isDeveloperDefaultSignInPrefilled = useRecoilValue( | ||
isDeveloperDefaultSignInPrefilledState, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: consider using object destructuring with useRecoilValue to improve readability and reduce line count
const setisDeveloperDefaultSignInPrefilled = useSetRecoilState( | ||
isDeveloperDefaultSignInPrefilledState, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: camelCase naming convention not followed for 'setisDeveloperDefaultSignInPrefilled' - first word should be capitalized
link.searchParams.set('inviteToken', invitation.value.appToken.value); | ||
link.searchParams.set('email', invitation.value.email); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Consider URL encoding the email parameter value to prevent potential URL injection issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice UX improvement! 🙏
I noticed a small typo, and as I mentioned in the issue, the last point remains during my test."
@@ -20,7 +20,9 @@ export const ClientConfigProviderEffect = () => { | |||
const setIsDebugMode = useSetRecoilState(isDebugModeState); | |||
const setIsAnalyticsEnabled = useSetRecoilState(isAnalyticsEnabledState); | |||
|
|||
const setIsSignInPrefilled = useSetRecoilState(isSignInPrefilledState); | |||
const setisDeveloperDefaultSignInPrefilled = useSetRecoilState( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const setisDeveloperDefaultSignInPrefilled = useSetRecoilState( | |
const setIsDeveloperDefaultSignInPrefilled = useSetRecoilState( |
packages/twenty-front/src/modules/client-config/components/ClientConfigProviderEffect.tsx
Outdated
Show resolved
Hide resolved
…entConfigProviderEffect.tsx Co-authored-by: Antoine Moreaux <[email protected]>
I think the error might have to do with clicking twice on the button? If it's too slow users tend to click twice. Could be a wrong lead. Let's close the PR like this and you can fix the item (3) in another PR @eliasylonen? |
Thanks @eliasylonen for your contribution! |
Prefill workspace invitation email, fixes #7174