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: Managed children event listing for organization members #13722

Merged
merged 3 commits into from
Feb 16, 2024

Conversation

hariombalhara
Copy link
Member

@hariombalhara hariombalhara commented Feb 16, 2024

What does this PR do?

Fixes managed event-types listing in dashboard for organization members.

The root cause is that the profileId is wrongly set for children event-types.

Fixes #13723

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How should this be tested?

  1. Login to acme using owner1-acme
  2. Create a managed event-type for Team1
  3. Assign it to two members - Member1 and Member2
  4. Notice that owner1-acme is seeing the event-types 2 more times.(Bug)
  5. Login as member1 and notice that there is no event-type in there.(Bug)

Mandatory Tasks

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

Checklist

  • I haven't added tests that prove my fix is effective or that my feature works

Copy link

vercel bot commented Feb 16, 2024

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

4 Ignored Deployments
Name Status Preview Comments Updated (UTC)
ai ⬜️ Ignored (Inspect) Visit Preview Feb 16, 2024 0:08am
cal ⬜️ Ignored (Inspect) Visit Preview Feb 16, 2024 0:08am
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Feb 16, 2024 0:08am
qa ⬜️ Ignored (Inspect) Visit Preview Feb 16, 2024 0:08am

Copy link
Contributor

github-actions bot commented Feb 16, 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 Feb 16, 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 Feb 16, 2024

Current Playwright Test Results Summary

✅ 447 Passing - ⚠️ 9 Flaky

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

(Last updated on 02/16/2024 12:21:54pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: cbaed91

Started: 02/16/2024 12:16:24pm UTC

⚠️ Flakes

📄   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 Number Question Select and Number not required
Retry 1Initial Attempt
0% (0) 0 / 234 runs
failed over last 7 days
5.13% (12) 12 / 234 runs
flaked over last 7 days

📄   apps/web/playwright/booking/longTextQuestion.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 Long Text Question and Each Other Question Booking With Long Text Question and Multiple email Question Long Text and Multiple email required
Retry 1Initial Attempt
0% (0) 0 / 231 runs
failed over last 7 days
4.76% (11) 11 / 231 runs
flaked over last 7 days
Booking With Long Text Question and Each Other Question Booking With Long Text Question and Radio group Question Long Text and Radio group required
Retry 1Initial Attempt
0% (0) 0 / 230 runs
failed over last 7 days
7.39% (17) 17 / 230 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 -- future login flow user & logout using dashboard
Retry 1Initial Attempt
0.42% (1) 1 / 236 run
failed over last 7 days
44.92% (106) 106 / 236 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Booking With no questions Booking with 1280x720 resolution and no questions
Retry 1Initial Attempt
0% (0) 0 / 235 runs
failed over last 7 days
0.43% (1) 1 / 235 run
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Update Profile Can update a users email (verification enabled)
Retry 2Retry 1Initial Attempt
11.81% (30) 30 / 254 runs
failed over last 7 days
51.57% (131) 131 / 254 runs
flaked over last 7 days

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Webhook tests FORM_SUBMITTED on submitting team form, triggers team webhook
Retry 1Initial Attempt
4.44% (11) 11 / 248 runs
failed over last 7 days
16.53% (41) 41 / 248 runs
flaked over last 7 days

📄   apps/web/playwright/event-types.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Event Types tests -- future user Different Locations Tests can select 'display on booking page' option when multiple organizer input type are present
Retry 1Initial Attempt
0% (0) 0 / 244 runs
failed over last 7 days
4.10% (10) 10 / 244 runs
flaked over last 7 days

📄   apps/web/playwright/organization/across-org/across-org.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
user1NotMemberOfOrg1 is part of team1MemberOfOrg1 EventTypes listing should show correct link for user events and team1MemberOfOrg1's events
Retry 1Initial Attempt
0% (0) 0 / 246 runs
failed over last 7 days
15.45% (38) 38 / 246 runs
flaked over last 7 days

View Detailed Build Results


@alishaz-polymath alishaz-polymath changed the title Fetch event-types by userId for childEvents and filter out those even… fix:Fetch event-types by userId for childEvents and filter out those even… Feb 16, 2024
@alishaz-polymath alishaz-polymath changed the title fix:Fetch event-types by userId for childEvents and filter out those even… fix: Fetch event-types by userId for childEvents and filter out those even… Feb 16, 2024
@github-actions github-actions bot added teams area: teams, round robin, collective, managed event-types Urgent Created by Linear-GitHub Sync 🐛 bug Something isn't working labels Feb 16, 2024
@hariombalhara hariombalhara force-pushed the fix-event-types-in-org branch 2 times, most recently from aa51559 to 53a961d Compare February 16, 2024 12:01
@hariombalhara hariombalhara self-assigned this Feb 16, 2024
@hariombalhara hariombalhara marked this pull request as ready for review February 16, 2024 12:01
@graphite-app graphite-app bot requested a review from a team February 16, 2024 12:01
@hariombalhara hariombalhara marked this pull request as draft February 16, 2024 12:03
Copy link

graphite-app bot commented Feb 16, 2024

Graphite Automations

A Graphite automation took an action on this PR • (02/16/24)

1 reviewer was added based on Keith Williams's automation, 'Add consumer team as reviewer'

@hariombalhara hariombalhara changed the title fix: Fetch event-types by userId for childEvents and filter out those even… fix: Managed children event listing for organization members Feb 16, 2024
@hariombalhara hariombalhara marked this pull request as ready for review February 16, 2024 12:07
@@ -156,6 +156,13 @@ export class EventTypeRepository {
{
profileId,
},
// Fetch children event-types by userId because profileId is wrong
Copy link
Member Author

Choose a reason for hiding this comment

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

profileId is wrong for children event-types. Will open a separate PR to fix that and add a migration to fix existing data.

const isAChildEvent = eventType.parentId;
// A child event only has one user
const childEventAssignee = eventType.users[0];
if (isAChildEvent && childEventAssignee.id != ctx.user.id) {
Copy link
Member Author

Choose a reason for hiding this comment

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

If there is a childEvent that doesn't belong to the user remove that.

Copy link
Member

@alishaz-polymath alishaz-polymath left a comment

Choose a reason for hiding this comment

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

🚀
Works as a hotfix, awesome work 🙏

@alishaz-polymath alishaz-polymath requested a review from a team February 16, 2024 12:29
@keithwillcode keithwillcode merged commit f29f663 into main Feb 16, 2024
38 of 39 checks passed
@keithwillcode keithwillcode deleted the fix-event-types-in-org branch February 16, 2024 12:32
keithwillcode pushed a commit that referenced this pull request Feb 16, 2024
* Fetch event-types by userId for childEvents and filter out those events that dont belong to the user

* Add test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working consumer core area: core, team members only teams area: teams, round robin, collective, managed event-types Urgent Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-3154] Managed Event-types Dashboard listing issue
3 participants