cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

Enable apps for managed event types & other team event types

Open joeauyeung opened this issue 2 years ago • 3 comments

What does this PR do?

This PR does the following:

  • Enable apps for managed event types
  • Share credentials for team event types without having the event type owner present in the booking

I did not make changes to Rainbow as it is now depreciated

For apps like ga4 & Fathom, there are no access tokens that are needed; we can assume any team admins can enable these apps for event types types. Although for Stripe since an access token is needed we use the team owner's credentials for all event types.

Follow up

  • For video apps, all team members still need to have the app installed. I think we should give the option of using a single video credential for all bookings created under the team event type or allow team members to set it themselves
  • When handling Stripe credentials a lot of them are hard coded for Stripe. Should we handle payment credentials under the PaymentService?
  • Tests should be made under each app folder to ensure that this behaviour is acting as expected

Fixes # (issue)

Environment: Staging(main branch) / Production

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

How should this be tested?

  • See enabled apps on team event types (not including Stripe)

    • Create a team and invite another admin
    • Create a managed event type
    • Install and enable some or all of the event type apps except Stripe & Rainbow
    • Now, visit that event type as the other team admin. Even if the admin does not have the apps installed, they should still see them enabled on the team event type.
    • Still, as the admin go to one of the user's event types. The uninstalled apps should not appear on the event type apps page.
    • In the managed event type, assign the event type to a team member
    • Under the child event type go to the apps tab. The apps should not be editable.
  • Enable Stripe for team events

    • Create any team event as the team owner
    • Install Stripe
    • Enable Stripe and set the payment option to collect money on booking
    • Assign the event type to members that are not the owner
    • Create a booking. The payment should go through without the team owner present in the booking
    • Repeat the above steps for no-show fee bookings
    • Visit the event type as a team admin. You should not be able to edit any Stripe fields
    • As the team owner, uninstall Stripe. It should disappear from any team events

Checklist

  • I haven't added tests that prove my fix is effective or that my feature works
  • I haven't checked if new and existing unit tests pass locally with my changes

joeauyeung avatar Apr 25 '23 22:04 joeauyeung

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

Name Status Preview Comments Updated (UTC)
cal ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 16, 2023 2:11am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
ui ⬜️ Ignored (Inspect) Visit Preview May 16, 2023 2:11am

vercel[bot] avatar Apr 25 '23 22:04 vercel[bot]

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

github-actions[bot] avatar Apr 25 '23 22:04 github-actions[bot]

Current Playwright Test Results Summary

✅ 112 Passing - ⚠️ 2 Flaky

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

(Last updated on 05/16/2023 02:16:34am UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: d7aba155bdd7e62ae0da9f2f274d03b94795cf95

Started: 05/16/2023 02:07:02am UTC

⚠️ Flakes

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

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Booking with Seats -- new-booker Reschedule for booking with seats -- old-booker Should reschedule booking with seats and if everyone rescheduled it should be deleted
Retry 1Initial Attempt
0% (0) 0 / 316 runs
failed over last 7 days
75.95% (240) 240 / 316 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/action-based.test.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Popup Tests should be able to reschedule
Retry 2Retry 1Initial Attempt
10.53% (16) 16 / 152 runs
failed over last 7 days
53.29% (81) 81 / 152 runs
flaked over last 7 days

View Detailed Build Results


deploysentinel[bot] avatar Apr 25 '23 22:04 deploysentinel[bot]

@joeauyeung I will be focusing on testing this tomorrow, sorry for the delay, workflows for MET took longer than expected.

I think you can focus on adding tests for this in the meantime, as we discussed not adding functionality without tests anymore 😅

BTW, are we still getting pressure to have this implemented with the quick solution instead of the other sustainable long-term solution we discussed? I still think it should be the way to go, considering Orgs work.

leog avatar May 16 '23 02:05 leog

Closing this PR as the time urgency is gone. We will use parts of this PR and its ideas when implementing organizations.

joeauyeung avatar May 18 '23 03:05 joeauyeung