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: removed the confirm step in creating bookings #18380

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

theVedanta
Copy link

@theVedanta theVedanta commented Dec 27, 2024

What does this PR do?

Removed the confirm step changes in this PR because as I see it, once the URL params are passed and checked in the useEffect, the booking state is changed, where I've replaced it with the handleEventBooking();

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 updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

LOOM LINK: https://www.loom.com/share/2967cdb902fb4945908e17c79bb379b8?sid=88459728-1b9e-46e9-af1a-9168cd8cc0cc

How should this be tested?

You can start by creating event types with varying complexity and check if any URL params are conflicting this direct booking without confirmation.

No ENV vars required to test.

Copy link

vercel bot commented Dec 27, 2024

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

A member of the Team first needs to authorize it.

@graphite-app graphite-app bot requested review from a team December 27, 2024 02:49
@CLAassistant
Copy link

CLAassistant commented Dec 27, 2024

CLA assistant check
All committers have signed the CLA.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Dec 27, 2024
Copy link
Contributor

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "added functionality to remove the confirm step in creating bookings". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@github-actions github-actions bot added High priority Created by Linear-GitHub Sync ✨ feature New feature or request labels Dec 27, 2024
@dosubot dosubot bot added bookings area: bookings, availability, timezones, double booking ❗️ migrations contains migration files labels Dec 27, 2024
Copy link

graphite-app bot commented Dec 27, 2024

Graphite Automations

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

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

"Add foundation team as reviewer" took an action on this PR • (12/27/24)

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

"Add community label" took an action on this PR • (12/27/24)

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

@theVedanta theVedanta changed the title added functionality to remove the confirm step in creating bookings feat: removed the confirm step in creating bookings Dec 27, 2024
yarn.lock Outdated Show resolved Hide resolved
@Praashh
Copy link
Contributor

Praashh commented Dec 27, 2024

also can you please add a loom recording of the fix @theVedanta 🙏 ?

packages/prisma/.env Outdated Show resolved Hide resolved
@theVedanta
Copy link
Author

also can you please add a loom recording of the fix @theVedanta 🙏 ?

I've added it in the first comment or the PR description.

@Praashh
Copy link
Contributor

Praashh commented Dec 27, 2024

also can you please add a loom recording of the fix @theVedanta 🙏 ?

I've added it in the first comment or the PR description.

Alright, thanks! One thing I wanted to ask is, if someone accidentally clicks the button, it’ll immediately book the meeting. I think it would be better to have a confirmation dialog box or something similar to prevent this.

@theVedanta
Copy link
Author

also can you please add a loom recording of the fix @theVedanta 🙏 ?

I've added it in the first comment or the PR description.

Alright, thanks! One thing I wanted to ask is, if someone accidentally clicks the button, it’ll immediately book the meeting. I think it would be better to have a confirmation dialog box or something similar to prevent this.

This has been discussed in the GitHub issue before. Please check the issue once and let me know if a dialog box is required.

@Praashh
Copy link
Contributor

Praashh commented Dec 28, 2024

also can you please add a loom recording of the fix @theVedanta 🙏 ?

I've added it in the first comment or the PR description.

Alright, thanks! One thing I wanted to ask is, if someone accidentally clicks the button, it’ll immediately book the meeting. I think it would be better to have a confirmation dialog box or something similar to prevent this.

This has been discussed in the GitHub issue before. Please check the issue once and let me know if a dialog box is required.

yeah, got the answer, thank you 🙏

Copy link
Contributor

@Praashh Praashh left a comment

Choose a reason for hiding this comment

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

Can we have a test case for this feature @theVedanta?

@theVedanta
Copy link
Author

Can we have a test case for this feature @theVedanta?

Sure, can you please provide some context and more information on how you want the tescases generaeted?

@Praashh
Copy link
Contributor

Praashh commented Jan 1, 2025

Can we have a test case for this feature @theVedanta?

Sure, can you please provide some context and more information on how you want the tescases generaeted?

We need to test it on a variety of events, ensuring the behavior is expected for all events.

@@ -95,7 +95,10 @@ export const BookEventForm = ({
// still change the timeslot, and comes back to the form, all their values
// still exist. This gets cleared when the form is submitted.
const values = bookingForm.getValues();
setFormValues(values);

if (JSON.stringify(values) !== JSON.stringify(bookingData)) {
Copy link
Member

@hariombalhara hariombalhara Jan 1, 2025

Choose a reason for hiding this comment

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

What does it do? Doesn't seem like the correct approach.

The comparison is sensitive to irrelevant changes like property order or case, leading to unexpected form behavior

Copy link
Author

Choose a reason for hiding this comment

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

oh ok I will correct this then.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this addressed?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, this is fixed

@hariombalhara
Copy link
Member

@theVedanta needs confirmation on skipping the Booking Form as well here cc @CarinaWolli

I think we should skip the form and the loader should be the there on the slot itself.

Also @theVedanta, keep in mind that users can configure custom booking questions under Advanced section of the event and mark some of them required. We would be able to submit the slot directly only if all required fields have the data.

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.

Left some comments

@theVedanta
Copy link
Author

@theVedanta needs confirmation on skipping the Booking Form as well here cc @CarinaWolli

I think we should skip the form and the loader should be the there on the slot itself.

Also @theVedanta, keep in mind that users can configure custom booking questions under Advanced section of the event and mark some of them required. We would be able to submit the slot directly only if all required fields have the data.

I understand. I will make some changes soon, let me know if they are ok according to the tests.

@PeerRich
Copy link
Member

PeerRich commented Jan 3, 2025

correct we only skip the "confirm" step if all required inputs are prefilled

maybe even if all inputs are prefilled, no?

not only required but also the optional ones

@github-actions github-actions bot marked this pull request as draft January 3, 2025 23:01
Copy link
Contributor

github-actions bot commented Jan 3, 2025

E2E results are ready!

@keithwillcode keithwillcode added the high-risk Requires approval by Foundation team label Jan 3, 2025
@theVedanta
Copy link
Author

@PeerRich @Praashh @hariombalhara @CarinaWolli @keithwillcode I have made a change to the PR. Now, it checks for every field being filled in the form based on URL-Params. I can't figure out however, why the "maximum update depth reached" error occurs.
The app works fine when there are additional questions that do not already have a value in the URL Params.

This is what I mean with the help of an example:
When the meeting type has an additional question that is required, say, the Reference ID of a person.
If the URL Params contain the time, date, name, email, and other details of the user and not the Reference ID, the app works fine and stops to ask the user for it. However, when it is all filled in the URL-Params (including this hypothetical Reference ID, then we are running into a maximum-state-update error).

Can you please help me figure out the cause and potential fixes for this?

This is my first PR and I'm not very familiar with the workspace, so your help would be highly appreciated.

@theVedanta
Copy link
Author

@PeerRich @Praashh @hariombalhara @CarinaWolli @keithwillcode I have made a change to the PR. Now, it checks for every field being filled in the form based on URL-Params. I can't figure out however, why the "maximum update depth reached" error occurs. The app works fine when there are additional questions that do not already have a value in the URL Params.

This is what I mean with the help of an example: When the meeting type has an additional question that is required, say, the Reference ID of a person. If the URL Params contain the time, date, name, email, and other details of the user and not the Reference ID, the app works fine and stops to ask the user for it. However, when it is all filled in the URL-Params (including this hypothetical Reference ID, then we are running into a maximum-state-update error).

Can you please help me figure out the cause and potential fixes for this?

This is my first PR and I'm not very familiar with the workspace, so your help would be highly appreciated.

Also, I have fixed the JSON.stringify comparison which was not necessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bookings area: bookings, availability, timezones, double booking community Created by Linear-GitHub Sync ✨ feature New feature or request High priority Created by Linear-GitHub Sync high-risk Requires approval by Foundation team ❗️ migrations contains migration files ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-4943] If all information for "confirm" step is provided skip step
7 participants