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: Correctly prefill username in case of non-org email invite in an org #12854

Conversation

hariombalhara
Copy link
Member

@hariombalhara hariombalhara commented Dec 18, 2023

What does this PR do?

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Tests (Unit/Integration/E2E or any other test)

How should this be tested?

See #12774 (comment) for more details.

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

Copy link

vercel bot commented Dec 18, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 18, 2023 6:43pm
dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 18, 2023 6:43pm
5 Ignored Deployments
Name Status Preview Comments Updated (UTC)
ai ⬜️ Ignored (Inspect) Visit Preview Dec 18, 2023 6:43pm
cal ⬜️ Ignored (Inspect) Visit Preview Dec 18, 2023 6:43pm
cal-demo ⬜️ Ignored (Inspect) Visit Preview Dec 18, 2023 6:43pm
qa ⬜️ Ignored (Inspect) Visit Preview Dec 18, 2023 6:43pm
ui ⬜️ Ignored (Inspect) Visit Preview Dec 18, 2023 6:43pm

@hariombalhara
Copy link
Member Author

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

Copy link
Contributor

github-actions bot commented Dec 18, 2023

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

@@ -74,7 +74,8 @@ const PremiumTextfield = (props: ICustomUsernameProps) => {
const debouncedApiCall = useMemo(
() =>
debounce(async (username: string) => {
const { data } = await fetchUsername(username);
// TODO: Support orgSlug
const { data } = await fetchUsername(username, null);
Copy link
Member Author

Choose a reason for hiding this comment

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

We should read the orgSlug here from the correct place and pass that on.

Copy link
Contributor

github-actions bot commented Dec 18, 2023

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@hariombalhara hariombalhara force-pushed the 12-18-fix_Correctly_prefill_username_in_case_of_non-org_email_invite_in_an_org branch from f15b504 to 6cbe72f Compare December 18, 2023 14:53
@hariombalhara hariombalhara force-pushed the 12-18-fix_Correctly_prefill_username_in_case_of_non-org_email_invite_in_an_org branch from 6cbe72f to 37c297f Compare December 18, 2023 14:56
Copy link
Member Author

@hariombalhara hariombalhara left a comment

Choose a reason for hiding this comment

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

Self review done

// Detect if the team is an org by either the metadata flag or if it has a parent team
const isOrganization = tokenTeam.metadata?.isOrganization || tokenTeam?.parentId !== null;
Copy link
Member Author

Choose a reason for hiding this comment

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

Better naming

@@ -632,7 +637,14 @@ export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
prepopulateFormValues: !isOrgInviteByLink
? {
email: verificationToken.identifier,
username: slugify(username),
username: isOrganizationOrATeamInOrganization
Copy link
Member Author

Choose a reason for hiding this comment

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

It fixes the prefilling issue.

@hariombalhara hariombalhara marked this pull request as ready for review December 18, 2023 15:03
Copy link

deploysentinel bot commented Dec 18, 2023

Current Playwright Test Results Summary

✅ 341 Passing - ❌ 2 Failing - ⚠️ 12 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 12/18/2023 03:17:06pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 37c297f

Started: 12/18/2023 03:07:12pm UTC

❌ Failures

📄   apps/web/playwright/organization/organization-invitation.e2e.ts • 1 Failure

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Organization Email matching orgAutoAcceptEmail and a Verified Organization Org Invitation
Retry 2Retry 1Initial Attempt
Error: Test timeout of 60000ms exceeded.
Test timeout of 60000ms exceeded.
-100% (-5) -5 / 5 runs
failed over last 7 days
120% (6) 6 / 5 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 1 Failure

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Popup Tests should be able to reschedule
Retry 2Retry 1Initial Attempt
Error: Timed out 30000ms waiting for expect(received).toBeVisible()...
Timed out 30000ms waiting for expect(received).toBeVisible()
Call log:
  - expect.toBeVisible with timeout 30000ms
  - waiting for locator('[data-testid=success-page]')
  - waiting for locator('[data-testid=success-page]')

13.70% (37) 37 / 270 runs
failed over last 7 days
80.37% (217) 217 / 270 runs
flaked over last 7 days

⚠️ Flakes

📄   apps/web/playwright/organization/organization-invitation.e2e.ts • 2 Flakes

Top 1 Common Error Messages

null

2 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Organization Email not matching orgAutoAcceptEmail Org Invitation
Retry 2Retry 1Initial Attempt
-112.50% (-9) -9 / 8 runs
failed over last 7 days
112.50% (9) 9 / 8 runs
flaked over last 7 days
Organization Email not matching orgAutoAcceptEmail Team invitation
Retry 2Retry 1Initial Attempt
-62.50% (-5) -5 / 8 runs
failed over last 7 days
100% (8) 8 / 8 runs
flaked over last 7 days

📄   apps/web/playwright/team/team-invitation.e2e.ts • 2 Flakes

Top 1 Common Error Messages

null

2 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Team Invitation (non verified)
Retry 2Retry 1Initial Attempt
3.77% (10) 10 / 265 runs
failed over last 7 days
93.58% (248) 248 / 265 runs
flaked over last 7 days
Team Invitation (verified)
Retry 1Initial Attempt
0% (0) 0 / 265 runs
failed over last 7 days
94.72% (251) 251 / 265 runs
flaked over last 7 days

📄   apps/web/playwright/teams.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Teams - Org Can create teams via Wizard
Retry 1Initial Attempt
1.50% (4) 4 / 267 runs
failed over last 7 days
14.98% (40) 40 / 267 runs
flaked over last 7 days

📄   apps/web/playwright/login.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
user can login & logout succesfully login flow user & logout using dashboard
Retry 1Initial Attempt
0.37% (1) 1 / 267 run
failed over last 7 days
23.22% (62) 62 / 267 runs
flaked over last 7 days

📄   apps/web/playwright/settings/upload-avatar.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
UploadAvatar can upload an image
Retry 1Initial Attempt
0.37% (1) 1 / 268 run
failed over last 7 days
5.22% (14) 14 / 268 runs
flaked over last 7 days

📄   apps/web/playwright/oauth-provider.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
OAuth Provider should create valid access toke & refresh token for team
Retry 1Initial Attempt
0.36% (1) 1 / 274 run
failed over last 7 days
46.72% (128) 128 / 274 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/preview.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Preview Preview - embed-core should load
Retry 1Initial Attempt
0% (0) 0 / 267 runs
failed over last 7 days
23.22% (62) 62 / 267 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 3 Flakes

Top 1 Common Error Messages

null

3 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Popup Tests should open embed iframe on click - Configured with light theme
Retry 1Initial Attempt
1.11% (3) 3 / 270 runs
failed over last 7 days
61.11% (165) 165 / 270 runs
flaked over last 7 days
Popup Tests Floating Button Popup Pro User - Configured in App with default setting of system theme should open embed iframe according to system theme when no theme is configured through Embed API
Retry 1Initial Attempt
0.37% (1) 1 / 270 run
failed over last 7 days
83.70% (226) 226 / 270 runs
flaked over last 7 days
Popup Tests should open Routing Forms embed on click
Retry 1Initial Attempt
0.37% (1) 1 / 270 run
failed over last 7 days
50.37% (136) 136 / 270 runs
flaked over last 7 days

View Detailed Build Results


Copy link
Contributor

@Udit-takkar Udit-takkar left a comment

Choose a reason for hiding this comment

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

LGTM

@Udit-takkar Udit-takkar enabled auto-merge (squash) December 18, 2023 18:36
@Udit-takkar Udit-takkar merged commit 4b16860 into main Dec 19, 2023
23 checks passed
@Udit-takkar Udit-takkar deleted the 12-18-fix_Correctly_prefill_username_in_case_of_non-org_email_invite_in_an_org branch December 19, 2023 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core area: core, team members only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants