Skip to content
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

fix: hubspot signup form issue when user is invited #5317

Open
wants to merge 5 commits into
base: next
Choose a base branch
from

Conversation

jainpawan21
Copy link
Member

@jainpawan21 jainpawan21 commented Mar 19, 2024

What change does this PR introduce?

  1. Add new API to update user profile data (firstName, lastName and jobTitle)
  2. Fix the bug of hubspot form not showing up when new user is invited to join the org

Why was this change needed?

Other information (Screenshots)

Copy link

netlify bot commented Mar 19, 2024

Deploy Preview for dev-web-novu ready!

Name Link
🔨 Latest commit 5b3704b
🔍 Latest deploy log https://app.netlify.com/sites/dev-web-novu/deploys/65f9b0893bb5440008f53c8f
😎 Deploy Preview https://deploy-preview-5317--dev-web-novu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@LetItRock LetItRock left a comment

Choose a reason for hiding this comment

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

hey @jainpawan21 👋

Please make sure to verify these cases:

  1. Invited the existing user (registered by email) that is currently logged, the form should not be shown.
  2. Invited the existing user (registered by email) that is not logged in, the form should not be shown.
  3. Invited the existing user (registered by GH) that is currently logged, the form should not be shown.
  4. Invited the existing user (registered by GH) that is not logged in, the form should not be shown.
  5. Invited the new user register by email, the form should be shown.
  6. Invited the new user register by GH, the form should be shown.

The case number four is failing, attaching the video.

Screen.Recording.2024-03-21.at.11.12.17.mov

I would appreciate if you can cover the new logic with Cypress E2E tests, as far as I see we are lucking tests for the invitation logic, but it would be much appreciated if we can add them. Excluding GH flow as it's complex and requires account confirmation in E2E tests.

@@ -45,7 +45,7 @@ export default function InvitationPage() {
useEffect(() => {
// auto accept invitation when logged in as invited user
if (isLoggedInAsInvitedUser) {
submitToken(tokensRef.current.token as string, tokensRef.current.invitationToken as string, true);
submitToken(tokensRef.current.token as string, tokensRef.current.invitationToken as string, true, false);
Copy link
Contributor

Choose a reason for hiding this comment

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

it's hard to understand what are there true/false arguments, please change it to the object, which will improve readability

}
}
}, [token, navigate, isFromVercel, startVercelSetup]);

return () => {};
Copy link
Contributor

Choose a reason for hiding this comment

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

not needed


const { isLoading, mutateAsync, error, isError } = useMutation<string, IResponseError, string>((tokenItem) =>
api.post(`/v1/invites/${tokenItem}/accept`, {})
);

const submitToken = useCallback(
async (token: string, invitationToken: string, refetch = false) => {
async (token: string, invitationToken: string, refetch = false, isSignUp = true) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

by default isSignUp should be false, we only have it set to true in one place - sign up form

@@ -77,9 +77,7 @@ export function SignUpForm({ invitationToken, email }: SignUpFormProps) {
applyToken(token);

if (invitationToken) {
submitToken(token, invitationToken);

return true;
Copy link
Contributor

Choose a reason for hiding this comment

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

why did we remove this return statement?

@github-actions github-actions bot added the stale Pull Request that needs to be reviewed label Apr 4, 2024
@scopsy
Copy link
Contributor

scopsy commented Apr 7, 2024

@jainpawan21 can we push to merge or close this PR? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@novu/api @novu/web stale Pull Request that needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants