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: Pre-Fill input fields given url query parameter #537

Merged
merged 3 commits into from
Aug 12, 2024

Conversation

rgon
Copy link

@rgon rgon commented Aug 5, 2024

This PR implements pre-filling form fields given url query parameters, as requested in #145

I have implemented this feature in the formReady method. For ease-of-use, it follows the same standard as cal.com:

You can add anywhere in the booking flow before the booking form page or in the booking form page itself. Simply add these in the URL and you're good to go!
https://cal.com/johndoe/book?email=johndoe%40example.com&phone=1234
Source: https://cal.com/docs/core-features/bookings/prefill-fields#pre-filling-all-fields

It also implements hiding the pre-filled inputs, so that in custom embed flows, we could just iframe the appointments app with the calendar component by setting hidePrefilledInputs=true

https://mycloud.tld/appointments/appointmentID?name=UserName&email=userEmail&hidePrefilledInputs=true

This PR also updates the documentation, referencing this change.

Gonzalo Ruiz added 2 commits August 5, 2024 12:03
…hone=123456 and allow hiding input fields in form when setting hidePrefilledInputs=true
@SergeyMosin
Copy link
Owner

Thank you. This looks good. We also will need to add a setting for the users to enable/disable this feature. And maybe an option to display the Pre-Filled data in plain text in addition to hidePrefilledInputs

@rgon rgon changed the title feat: Pre-Fill input fields given url query parameter feat: Pre-Fill input fields given url query parameter (implements #145) Aug 5, 2024
@rgon rgon changed the title feat: Pre-Fill input fields given url query parameter (implements #145) feat: Pre-Fill input fields given url query parameter Aug 5, 2024
@rgon
Copy link
Author

rgon commented Aug 5, 2024

Thank you for this project!

I agree that disabling pre-filled values is a good idea. I have implemented this with the disablePrefilledInputs query param and updated this PR:
Screenshot from 2024-08-05 15-15-30

@rgon
Copy link
Author

rgon commented Aug 5, 2024

Regarding enabling it via the page settings, I have to dig deeper in the code to find out how to implement it. Will update the PR when I figure it out.

@SergeyMosin
Copy link
Owner

Regarding enabling it via the page settings, I have to dig deeper in the code to find out how to implement it. Will update the PR when I figure it out.

Don't worry about this, I'll add it after merging.

@SergeyMosin SergeyMosin changed the base branch from master to pr-test August 12, 2024 00:31
@SergeyMosin SergeyMosin merged commit a1430cf into SergeyMosin:pr-test Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants