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: booking redirect page url is now has uid in it's parameters #19522

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

Conversation

retrogtx
Copy link
Contributor

What does this PR do?

Adds UID in the redirect URL after the websites domain in the form of ?uid=youruidxyz

Loom Video: https://www.loom.com/share/d3286e56a7514d5a8f37539ac0b97a23?sid=8ff255d1-5274-4bfe-8c83-546d54e766d6

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

Copy link

vercel bot commented Feb 25, 2025

@retrogtx 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 added the community Created by Linear-GitHub Sync label Feb 25, 2025
@graphite-app graphite-app bot requested a review from a team February 25, 2025 03:46
@github-actions github-actions bot added booking-page area: booking page, public booking page, booker 🐛 bug Something isn't working labels Feb 25, 2025
@keithwillcode keithwillcode added the community-interns The team responsible for reviewing, testing and shipping low/medium community PRs label Feb 25, 2025
@dosubot dosubot bot added bookings area: bookings, availability, timezones, double booking ✨ feature New feature or request labels Feb 25, 2025
Copy link

graphite-app bot commented Feb 25, 2025

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (02/25/25)

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

"Add community label" took an action on this PR • (02/25/25)

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

@retrogtx retrogtx changed the title feat: booking redirect page is now w UID feat: booking redirect page url is now has uid in it's parameters Feb 25, 2025
if (booking.uid) {
url.searchParams.append("uid", booking.uid);
}

const bookingExtraParams = getBookingRedirectExtraParams(booking);
Copy link
Member

@hariombalhara hariombalhara Feb 25, 2025

Choose a reason for hiding this comment

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

Can we not make it work by just modifying getBookingRedirectExtraParams fn. That is the purpose of the function to support passing anything that is needed.

Comment on lines 195 to 204
const newSearchParams = getNewSearchParams({
query: {
...query,
...bookingExtraParams,
...otherParams,
},
searchParams: searchParams ?? undefined,
});

newSearchParams.forEach((value, key) => {
url.searchParams.append(key, value);
Copy link
Contributor

Choose a reason for hiding this comment

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

if bookingExtraParams had uid, and we already have:

newSearchParams.forEach((value, key) => {
        url.searchParams.append(key, value);
```,

Why wasn't `uid` being added to search params? `getNewSearchParams` wasn't handling it?

I would improve on the logic there instead of creating a new logic specially for booking uid  

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yea that is what I did first, but then to get the uid first in the url is why I added the additional logic

https://redirect?uid=xyz&restparameeters

.filter((key) => redirectQueryParamKeys.includes(key))
.reduce<ResultType>((obj, key) => {
if (key === "responses") return extractResponseDetails(booking, obj);
if (key === "user") return extractUserDetails(booking, obj);
if (key === "attendees") return extractAttendeesAndGuests(booking, obj);
return { ...obj, [key]: booking[key] };
}, {});
}, result);
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 the only place where result is used? if so, no need to create a const up there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea also that can be done by booking.uid
result is not needed at all, thnx

@github-actions github-actions bot marked this pull request as draft February 25, 2025 12:07
Copy link
Contributor

github-actions bot commented Feb 25, 2025

E2E results are ready!

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 🐛 bug Something isn't working community Created by Linear-GitHub Sync community-interns The team responsible for reviewing, testing and shipping low/medium community PRs ✨ feature New feature or request ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-5213] booking ID not part of redirect URL param
4 participants