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

feat: let org admins change usernames #13384

Merged

Conversation

PeerRich
Copy link
Member

@PeerRich PeerRich commented Jan 24, 2024

TODO

  • Fix Avatar update bugs

havent tested but could work, unless the API needs more permission to change username, not sure

CleanShot 2024-01-24 at 12 59 34@2x

@PeerRich PeerRich linked an issue Jan 24, 2024 that may be closed by this pull request
Copy link

linear bot commented Jan 24, 2024

Copy link

vercel bot commented Jan 24, 2024

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

Name Status Preview Comments Updated (UTC)
ai ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 22, 2024 7:37am
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 22, 2024 7:37am
dev ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 22, 2024 7:37am
5 Ignored Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Feb 22, 2024 7:37am
cal-demo ⬜️ Ignored (Inspect) Visit Preview Feb 22, 2024 7:37am
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Feb 22, 2024 7:37am
qa ⬜️ Ignored (Inspect) Visit Preview Feb 22, 2024 7:37am
ui ⬜️ Ignored (Inspect) Visit Preview Feb 22, 2024 7:37am

Copy link
Contributor

github-actions bot commented Jan 24, 2024

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

Copy link
Contributor

github-actions bot commented Jan 24, 2024

📦 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! 🙌

Copy link

deploysentinel bot commented Jan 24, 2024

Current Playwright Test Results Summary

✅ 447 Passing - ⚠️ 17 Flaky

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

(Last updated on 02/22/2024 07:47:05am UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: cecbfe6

Started: 02/22/2024 07:38:15am UTC

⚠️ Flakes

📄   apps/web/playwright/change-username.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Change username on settings User can change username
Retry 1Initial Attempt
1.46% (3) 3 / 206 runs
failed over last 7 days
3.40% (7) 7 / 206 runs
flaked over last 7 days

📄   apps/web/playwright/booking/longTextQuestion.e2e.ts • 4 Flakes

Top 1 Common Error Messages

null

4 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Booking With Long Text Question and Each Other Question Booking With Long Text Question and Checkbox Group Question Long Text and Checkbox Group required
Retry 1Initial Attempt
0% (0) 0 / 210 runs
failed over last 7 days
2.86% (6) 6 / 210 runs
flaked over last 7 days
Booking With Long Text Question and Each Other Question Long Text required and Number not required
Retry 1Initial Attempt
0.48% (1) 1 / 210 run
failed over last 7 days
5.24% (11) 11 / 210 runs
flaked over last 7 days
Booking With Long Text Question and Each Other Question Booking With Long Text Question and Phone Question Long Text required and Phone not required
Retry 1Initial Attempt
0% (0) 0 / 209 runs
failed over last 7 days
5.26% (11) 11 / 209 runs
flaked over last 7 days
Booking With Long Text Question and Each Other Question Booking With Long Text Question and select Question Long Text and select required
Retry 1Initial Attempt
0% (0) 0 / 208 runs
failed over last 7 days
6.73% (14) 14 / 208 runs
flaked over last 7 days

📄   apps/web/playwright/booking/selectQuestion.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Booking With Phone Question and Each Other Question Booking With Select Question and Radio group Question Select required and Radio group required
Retry 1Initial Attempt
0% (0) 0 / 222 runs
failed over last 7 days
4.50% (10) 10 / 222 runs
flaked over last 7 days

📄   apps/web/playwright/booking/responsiveBooking.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
Booking page with no questions Booking page with 1920x1080 resolution
Retry 1Initial Attempt
0% (0) 0 / 225 runs
failed over last 7 days
8% (18) 18 / 225 runs
flaked over last 7 days
Booking page with no questions Booking page with 1280x720 resolution
Retry 1Initial Attempt
0% (0) 0 / 225 runs
failed over last 7 days
8.44% (19) 19 / 225 runs
flaked over last 7 days

📄   apps/web/playwright/login.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
user can login & logout succesfully -- future login flow user & logout using dashboard
Retry 1Initial Attempt
0.47% (1) 1 / 215 run
failed over last 7 days
43.26% (93) 93 / 215 runs
flaked over last 7 days
Login and logout tests -- future Login flow validations -- legacy Should warn when user does not exist
Retry 1Initial Attempt
0% (0) 0 / 215 runs
failed over last 7 days
1.40% (3) 3 / 215 runs
flaked over last 7 days

📄   apps/web/playwright/booking/radioGroupQuestion.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Booking With Radio Question and Each Other Question Booking With Radio Question and Address Question Booking With Radio Question and multiselect Question Radio and multiselect text not required
Retry 1Initial Attempt
0% (0) 0 / 227 runs
failed over last 7 days
5.73% (13) 13 / 227 runs
flaked over last 7 days

📄   apps/web/playwright/booking/phoneQuestion.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Booking With Phone Question and Each Other Question Booking With Phone Question and Address Question Booking With Phone Question and select Question Phone required and select not required
Retry 1Initial Attempt
0% (0) 0 / 229 runs
failed over last 7 days
4.80% (11) 11 / 229 runs
flaked over last 7 days

📄   apps/web/playwright/booking/addressQuestione2e/addressQuestion.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
Booking With Address Question and Each Other Question Booking With Address Question and Long text Question Address and Long Text not required
Retry 1Initial Attempt
0% (0) 0 / 220 runs
failed over last 7 days
6.82% (15) 15 / 220 runs
flaked over last 7 days
Booking With Address Question and Each Other Question Booking With Address Question and Multi email Question Address and Multi email not required
Retry 1Initial Attempt
0% (0) 0 / 220 runs
failed over last 7 days
5.45% (12) 12 / 220 runs
flaked over last 7 days

📄   apps/web/playwright/integrations-stripe.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Stripe integration Pending payment booking should not be confirmed by default
Retry 2Retry 1Initial Attempt
1.36% (3) 3 / 220 runs
failed over last 7 days
20.45% (45) 45 / 220 runs
flaked over last 7 days

📄   apps/web/playwright/reschedule.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
Reschedule Tests Unpaid rescheduling should go to payment page
Retry 1Initial Attempt
0.87% (2) 2 / 230 runs
failed over last 7 days
0.87% (2) 2 / 230 runs
flaked over last 7 days
Reschedule Tests Paid rescheduling should go to success page
Retry 1Initial Attempt
0.87% (2) 2 / 230 runs
failed over last 7 days
0.43% (1) 1 / 230 run
flaked over last 7 days

View Detailed Build Results


Copy link
Contributor

@keithwillcode keithwillcode left a comment

Choose a reason for hiding this comment

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

Type checks are failing

@PeerRich
Copy link
Member Author

Type checks are failing

likely more failing, havent tested locally at all yet 🙏

@keithwillcode keithwillcode marked this pull request as draft January 24, 2024 22:02
@Ryukemeister
Copy link
Contributor

Type checks are failing

should fix the type checks now

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.

packages/trpc/server/routers/viewer/organizations/updateUser.handler.ts doesn't update username

Screenshot 2024-01-29 at 5 18 42 PM

@Udit-takkar
Copy link
Contributor

Udit-takkar commented Feb 17, 2024

Fixed:- Username Updation

Screen.Recording.2024-02-17.at.1.21.35.PM.mov

Copy link
Member

@sean-brydon sean-brydon left a comment

Choose a reason for hiding this comment

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

CleanShot 2024-02-19 at 08 44 00

I tried updating this test user "test-example" to "pro" but got a unique constraint error

No users in this org have this name either

@Udit-takkar
Copy link
Contributor

I tried updating this test user "test-example" to "pro" but got a unique constraint error

No users in this org have this name either

Okay let me try to replicate this bug.

@Udit-takkar
Copy link
Contributor

@sean-brydon Works fine for me. There is user with 'pro' username in the DB but not in the org

Screen.Recording.2024-02-19.at.4.09.17.PM.mov

Copy link
Contributor

@joeauyeung joeauyeung left a comment

Choose a reason for hiding this comment

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

This is working as expected. Left a small nit

const hasUsernameUpdated = input.username !== requestedMember.user.username;

if (input.username && hasUsernameUpdated && user.profile.organization?.slug) {
const checkRegularUsernameRes = await checkRegularUsername(
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: I noticed that checkRegularUsername is used only within an org context. Should we rename this function so it's more obvious when reading the function name? @hariombalhara thoughts?

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 Medium priority Created by Linear-GitHub Sync organizations area: organizations, orgs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-3010] Org admins should be able to change usernames
6 participants