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: Provide event rescheduling option before the event end time #15150

Merged
merged 12 commits into from
Jun 28, 2024

Conversation

anikdhabal
Copy link
Contributor

@anikdhabal anikdhabal commented May 21, 2024

What does this PR do?

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected)
  • N/A - I have added a Docs issue here if this PR makes changes that would require a documentation change
  • N/A - I have added or modified automated tests that prove my fix is effective or that my feature works (PRs might be rejected if logical changes are not properly tested)

How should this be tested?

  • Are there environment variables that should be set?
  • What are the minimal test data to have?
  • What is expected (happy path) to have (input and output)?
  • Any other important info that could help to test that PR

Checklist

  • I haven't read the contributing guide
  • My code doesn't follow the style guidelines of this project
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my changes generate no new warnings

Copy link

vercel bot commented May 21, 2024

@anikdhabal is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added booking-page area: booking page, public booking page, booker Medium priority Created by Linear-GitHub Sync ✨ feature New feature or request labels May 21, 2024
Copy link
Contributor

github-actions bot commented May 21, 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 May 21, 2024

📦 Next.js Bundle Analysis for @calcom/web

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

Eighty-six Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/[user] 107.28 KB 335.87 KB 95.96% (🟢 -2.10%)
/[user]/[type] 412.12 KB 640.7 KB 183.06% (🟢 -0.29%)
/[user]/[type]/embed 412.12 KB 640.71 KB 183.06% (🟢 -0.29%)
/[user]/embed 107.29 KB 335.87 KB 95.96% (🟢 -2.09%)
/apps 279.16 KB 507.74 KB 145.07% (🟢 -0.56%)
/apps/[slug] 296.66 KB 525.24 KB 150.07% (🟢 -0.56%)
/apps/[slug]/[...pages] 587.64 KB 816.22 KB 233.21% (🟢 -0.58%)
/apps/categories 256.89 KB 485.48 KB 138.71% (🟢 -0.57%)
/apps/categories/[category] 261.24 KB 489.82 KB 139.95% (🟢 -0.56%)
/apps/installed/[category] 280.43 KB 509.01 KB 145.43% (🟢 -0.56%)
/auth/platform/authorize 87.24 KB 315.82 KB 90.23% (🟢 -0.26%)
/availability 427.88 KB 656.46 KB 187.56% (🟢 -0.57%)
/availability/[schedule] 411.63 KB 640.21 KB 182.92% (🟢 -0.57%)
/booking/[uid] 226.16 KB 454.74 KB 129.93% (🟢 -2.02%)
/booking/[uid]/embed 226.17 KB 454.75 KB 129.93% (🟢 -2.02%)
/bookings/[status] 324.71 KB 553.3 KB 158.08% (🟢 -0.56%)
/d/[link]/[slug] 411.93 KB 640.51 KB 183.00% (🟢 -0.28%)
/enterprise 256.95 KB 485.53 KB 138.72% (🟢 -0.56%)
/event-types 556.63 KB 785.21 KB 224.35% (🟢 -0.58%)
/event-types/[type] 436.53 KB 665.11 KB 190.03% (🟢 -0.57%)
/insights 475.86 KB 704.44 KB 201.27% (🟢 -0.56%)
/more 256.46 KB 485.04 KB 138.58% (🟢 -0.56%)
/org/[orgSlug]/[user]/[type] 412.32 KB 640.9 KB 183.12% (🟢 -0.29%)
/org/[orgSlug]/[user]/[type]/embed 412.35 KB 640.93 KB 183.12% (🟢 -0.28%)
/org/[orgSlug]/instant-meeting/team/[slug]/[type] 411.95 KB 640.53 KB 183.01% (🟢 -0.29%)
/org/[orgSlug]/team/[slug]/[type] 412.14 KB 640.73 KB 183.06% (🟢 -0.28%)
/settings/admin 262.55 KB 491.14 KB 140.32% (🟢 -0.56%)
/settings/admin/apps 275.69 KB 504.27 KB 144.08% (🟢 -0.57%)
/settings/admin/apps/[category] 275.67 KB 504.25 KB 144.07% (🟢 -0.56%)
/settings/admin/flags 266.66 KB 495.25 KB 141.50% (🟢 -0.56%)
/settings/admin/impersonation 263.04 KB 491.62 KB 140.46% (🟢 -0.56%)
/settings/admin/lockedSMS 283.72 KB 512.3 KB 146.37% (🟢 -0.57%)
/settings/admin/oAuth 274.71 KB 503.29 KB 143.80% (🟢 -0.56%)
/settings/admin/orgMigrations/_OrgMigrationLayout 251.47 KB 480.05 KB 137.16% (🟢 -0.57%)
/settings/admin/orgMigrations/moveTeamToOrg 300.62 KB 529.2 KB 151.20% (🟢 -0.56%)
/settings/admin/orgMigrations/moveUserToOrg 320.03 KB 548.62 KB 156.75% (🟢 -0.57%)
/settings/admin/orgMigrations/removeTeamFromOrg 300.37 KB 528.95 KB 151.13% (🟢 -0.56%)
/settings/admin/orgMigrations/removeUserFromOrg 300.38 KB 528.96 KB 151.13% (🟢 -0.56%)
/settings/admin/organizations 264.12 KB 492.7 KB 140.77% (🟢 -0.56%)
/settings/admin/organizations/[id]/edit 262.94 KB 491.52 KB 140.43% (🟢 -0.56%)
/settings/admin/users 264.8 KB 493.38 KB 140.97% (🟢 -0.57%)
/settings/admin/users/[id]/edit 393.48 KB 622.06 KB 177.73% (🟢 -0.56%)
/settings/admin/users/add 393.21 KB 621.79 KB 177.65% (🟢 -0.56%)
/settings/billing 262.66 KB 491.24 KB 140.35% (🟢 -0.56%)
/settings/developer/api-keys 266.71 KB 495.3 KB 141.51% (🟢 -0.56%)
/settings/developer/webhooks 266.81 KB 495.39 KB 141.54% (🟢 -0.56%)
/settings/developer/webhooks/[id] 267.8 KB 496.39 KB 141.82% (🟢 -0.56%)
/settings/developer/webhooks/new 267.8 KB 496.38 KB 141.82% (🟢 -0.56%)
/settings/my-account/appearance 315.51 KB 544.1 KB 155.46% (🟢 -0.57%)
/settings/my-account/calendars 273.23 KB 501.81 KB 143.38% (🟢 -0.57%)
/settings/my-account/conferencing 274.5 KB 503.08 KB 143.74% (🟢 -0.56%)
/settings/my-account/general 378.43 KB 607.02 KB 173.43% (🟢 -0.56%)
/settings/my-account/out-of-office 267.33 KB 495.92 KB 141.69% (🟢 -0.56%)
/settings/my-account/profile 405.98 KB 634.56 KB 181.30% (🟢 -0.56%)
/settings/organizations/admin-api 262.56 KB 491.14 KB 140.33% (🟢 -0.57%)
/settings/organizations/appearance 286.61 KB 515.2 KB 147.20% (🟢 -0.57%)
/settings/organizations/billing 262.74 KB 491.32 KB 140.38% (🟢 -0.57%)
/settings/organizations/dsync 294.84 KB 523.42 KB 149.55% (🟢 -0.56%)
/settings/organizations/general 350.41 KB 578.99 KB 165.43% (🟢 -0.57%)
/settings/organizations/members 400.19 KB 628.77 KB 179.65% (🟢 -0.56%)
/settings/organizations/privacy 268.32 KB 496.91 KB 141.97% (🟢 -0.56%)
/settings/organizations/profile 398.73 KB 627.31 KB 179.23% (🟢 -0.56%)
/settings/organizations/sso 273.4 KB 501.98 KB 143.42% (🟢 -0.56%)
/settings/organizations/teams/other 263.31 KB 491.89 KB 140.54% (🟢 -0.56%)
/settings/organizations/teams/other/[id]/appearance 275.45 KB 504.03 KB 144.01% (🟢 -0.57%)
/settings/organizations/teams/other/[id]/members 270.4 KB 498.98 KB 142.57% (🟢 -0.57%)
/settings/organizations/teams/other/[id]/profile 469.54 KB 698.13 KB 199.46% (🟢 -0.56%)
/settings/platform 261.84 KB 490.42 KB 140.12% (🟢 -0.32%)
/settings/platform/oauth-clients/[clientId]/edit 260.45 KB 489.03 KB 139.72% (🟢 -0.34%)
/settings/platform/oauth-clients/create 259.74 KB 488.32 KB 139.52% (🟢 -0.30%)
/settings/security/impersonation 267.56 KB 496.14 KB 141.76% (🟢 -0.57%)
/settings/security/password 305.13 KB 533.71 KB 152.49% (🟢 -0.57%)
/settings/security/sso 272.73 KB 501.31 KB 143.23% (🟢 -0.56%)
/settings/security/two-factor-auth 270.99 KB 499.57 KB 142.73% (🟢 -0.56%)
/settings/teams 262.22 KB 490.8 KB 140.23% (🟢 -0.56%)
/settings/teams/[id]/appearance 275.43 KB 504.02 KB 144.00% (🟢 -0.56%)
/settings/teams/[id]/billing 262.74 KB 491.32 KB 140.38% (🟢 -0.57%)
/settings/teams/[id]/members 380.43 KB 609.01 KB 174.00% (🟢 -0.56%)
/settings/teams/[id]/profile 470.38 KB 698.96 KB 199.70% (🟢 -0.56%)
/team/[slug]/[type] 412.11 KB 640.69 KB 183.05% (🟢 -0.28%)
/team/[slug]/[type]/embed 412.14 KB 640.72 KB 183.06% (🟢 -0.28%)
/teams 256.68 KB 485.26 KB 138.65% (🟢 -0.57%)
/upgrade 256.81 KB 485.39 KB 138.68% (🟢 -0.56%)
/video/[uid] 295.84 KB 524.42 KB 149.83% (🟡 +1.37%)
/workflows 288.16 KB 516.74 KB 147.64% (🟢 -0.57%)
/workflows/[workflow] 410.58 KB 639.16 KB 182.62% (🟢 -0.71%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

@github-actions github-actions bot added the ❗️ migrations contains migration files label May 23, 2024
@PeerRich PeerRich added this to the v4.2 milestone Jun 3, 2024
@anikdhabal anikdhabal marked this pull request as ready for review June 4, 2024 20:25
@graphite-app graphite-app bot requested a review from a team June 4, 2024 20:25
@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Jun 4, 2024
@dosubot dosubot bot added bookings area: bookings, availability, timezones, double booking event-types area: event types, event-types labels Jun 4, 2024
Copy link

graphite-app bot commented Jun 4, 2024

Graphite Automations

"Add community label" took an action on this PR • (06/04/24)

1 label was added to this PR based on Keith Williams's automation.

"Add consumer team as reviewer" took an action on this PR • (06/04/24)

1 reviewer was added to this PR based on Keith Williams's automation.

@keithwillcode keithwillcode modified the milestones: v4.2, v4.3 Jun 17, 2024
@dosubot dosubot bot modified the milestone: v4.3 Jun 17, 2024
@supalarry supalarry self-requested a review June 24, 2024 10:48
Copy link
Contributor

@supalarry supalarry left a comment

Choose a reason for hiding this comment

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

Wow amazing PR @anikdhabal ! Given that there is another attempt #15304 to resolve the issue I have following thoughts:

  1. I see you added re-schedule policy Only allow reschedule up to <time> before start time, but I think it's not necessary - in event-type settings -> Limits we already have "Minimum notice: N hours". So I think that if someone wants to re-schedule, then what matters is that there is N hours before the booking time so the booked person has enough time to prepare.

  2. For the "Allow reschedule within a grace period of after start time" - does the current code set grace period respecting event-type length, or is it fixed? Aka does 1 hour event-type has 1 hour grace period by default like in the screenshot 30 minute event has 30? Just like I noted in feat: Stop users from rescheduling ongoing bookings #15304 PR review comment, I think we should focus on not whether or not meeting already has started, but whether or not it has ended, and if it has not yet ended allow re-schedule.

Personally, I prefer PR #15304 because the linked issue's core problem is people re-scheduling booking days or weeks after it's end time, and adding grace period for re-schedule is a feature possibly in search of a problem that does not exist and only adds to the code complexity - users have not requested this, they just don't want to be re-scheduled for bookings that have expired for days not minutes or seconds.

@SomayChauhan @shirazdole what do you think?

PS Anik, once again, really amazing job on the PR itself!

@SomayChauhan
Copy link
Member

agree 100%,
we should avoid polluting our db unnecessarily

@anikdhabal
Copy link
Contributor Author

anikdhabal commented Jun 24, 2024

Hey @supalarry, great explanation. Firstly, in this PR, I added two reschedule options as @shirazdole mentioned in the issue. One is flexible, and the other is strict. From your explanation, I understand what you want, and I will update my PR accordingly today. You mentioned that you personally prefer the other PR, but could you give this PR a chance for an updated and ready version, since I submitted this PR before the other? What do you think? Should I update the PR according to your preferences, or are you ready to proceed with it?

@supalarry
Copy link
Contributor

Hey @supalarry, great explanation. Firstly, in this PR, I added two reschedule options as @shirazdole mentioned in the issue. One is flexible, and the other is strict. From your explanation, I understand what you want, and I will update my PR accordingly today. You mentioned that you personally prefer the other PR, but could you give this PR a chance for an updated and ready version, since I submitted this PR before the other? What do you think? Should I update the PR according to your preferences, or are you ready to proceed with it?

Thanks for the fast response!

First, I would like to get your thoughts too - I believe in what I wrote, but do you agree that the simpler approach in this case is better or that it's better to ship extra features like you have now? Shiraz wrote that we "may" have to do it, but that was not a strong YES from his side and we have to prioritize solving core issue of customers instead of shipping 100 features.

If you agree, the author of PR #15304 still has not replied, so if you implement the feedback faster let's move with your PR.

Once again, thanks for all the efforts they are appreciated!

@anikdhabal
Copy link
Contributor Author

Hey @supalarry, great explanation. Firstly, in this PR, I added two reschedule options as @shirazdole mentioned in the issue. One is flexible, and the other is strict. From your explanation, I understand what you want, and I will update my PR accordingly today. You mentioned that you personally prefer the other PR, but could you give this PR a chance for an updated and ready version, since I submitted this PR before the other? What do you think? Should I update the PR according to your preferences, or are you ready to proceed with it?

Thanks for the fast response!

First, I would like to get your thoughts too - I believe in what I wrote, but do you agree that the simpler approach in this case is better or that it's better to ship extra features like you have now? Shiraz wrote that we "may" have to do it, but that was not a strong YES from his side and we have to prioritize solving core issue of customers instead of shipping 100 features.

If you agree, the author of PR #15304 still has not replied, so if you implement the feedback faster let's move with your PR.

Once again, thanks for all the efforts they are appreciated!

Yes, I agree with you. Thanks for your always kind words and great explanations. Let me quickly update the code so you can proceed.

@anikdhabal anikdhabal requested a review from supalarry June 25, 2024 09:15
@anikdhabal anikdhabal changed the title feat: Provide event rescheduling option fix: Provide event rescheduling option before the event end time Jun 25, 2024
Copy link
Contributor

@supalarry supalarry left a comment

Choose a reason for hiding this comment

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

We currently would show "Meeting is scheduled" for a meeting in the past - would be good if we can show a message "This event is expired" or something:

Screenshot 2024-06-25 at 12 31 46

because now we only hide the reschedule and cancel buttons so the heading would be "This meeting is scheduled"
Screenshot 2024-06-25 at 12 31 00

Do you think you can add that? Would be nice user experience improvement.

@anikdhabal
Copy link
Contributor Author

anikdhabal commented Jun 25, 2024

That would be great. And one thing that needs to be fixed is that currently, users can reschedule past bookings directly from the email. So, we should show something in the Date picker indicating that 'Reschedule is not possible or the event is expired'.

@anikdhabal
Copy link
Contributor Author

anikdhabal commented Jun 25, 2024

@supalarry all things are up.
Screenshot 2024-06-25 181350

@anikdhabal anikdhabal requested a review from supalarry June 25, 2024 12:59
supalarry
supalarry previously approved these changes Jun 26, 2024
Copy link
Contributor

@supalarry supalarry left a comment

Choose a reason for hiding this comment

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

Amazing! I like the simplicity and usefulness of the PR - tested it and it works! Great job Anik!

Copy link
Member

@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.

Great work again @anikdhabal !! I have left a few suggestions. Let me know if those make sense.

Functionally it is working fine but as it involves booker which is a critical piece, so we have to be extra careful with its complexity.

I am okay merging the PR without that as well. But blocking merge till you acknowledge so that it isn't merged before you see the feedback.

@keithwillcode keithwillcode added the community-interns The team responsible for reviewing, testing and shipping low/medium community PRs label Jun 27, 2024
@hariombalhara hariombalhara merged commit 3807e33 into calcom:main Jun 28, 2024
27 of 35 checks passed
@anikdhabal
Copy link
Contributor Author

Hey @hariombalhara I will follow up to address these or make any necessary updates.

p6l-richard pushed a commit to p6l-richard/cal.com-fork that referenced this pull request Jul 22, 2024
…com#15150)

* feat: Provide event rescheduling option

* update

* update

* add checker function

* refactor and update

* update

* fix type error

* Update bookings-single-view.tsx

---------

Co-authored-by: Somay Chauhan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
booking-page area: booking page, public booking page, booker bookings area: bookings, availability, timezones, double booking community Created by Linear-GitHub Sync community-interns The team responsible for reviewing, testing and shipping low/medium community PRs event-types area: event types, event-types ✨ feature New feature or request Medium priority Created by Linear-GitHub Sync ❗️ migrations contains migration files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-3552] The reschedule option on a booking should only appear before an event start time
6 participants