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: timezone display on booking page to reflect event availability timezone #14127

Merged
merged 8 commits into from Mar 19, 2024

Conversation

Shaik-Sirajuddin
Copy link
Contributor

What does this PR do?

Currently when the "Lock timezone on booking page" feature is enabled for the event ,
the timezone on the booking page locked is based on the timezone of the user accessing the booking page

this pr updates the display of the timezone on the booking page to the same timezone for which the 'availability' settings for that event have been defined.

Fixes #13521

Fix Video

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

Copy link

vercel bot commented Mar 18, 2024

@Shaik-Sirajuddin 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 a review from a team March 18, 2024 11:15
@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Mar 18, 2024
@CLAassistant
Copy link

CLAassistant commented Mar 18, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

graphite-app bot commented Mar 18, 2024

Graphite Automations

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

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

"Add community label" took an action on this PR • (03/18/24)

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

Copy link
Contributor

github-actions bot commented Mar 18, 2024

Thank you for following the naming conventions! 🙏 Feel free to join our discord and post your PR link.

@github-actions github-actions bot added bookings area: bookings, availability, timezones, double booking Low priority Created by Linear-GitHub Sync 🐛 bug Something isn't working labels Mar 18, 2024
Copy link
Contributor

github-actions bot commented Mar 18, 2024

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

Copy link
Contributor

@joeauyeung joeauyeung left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution @Shaik-Sirajuddin.

I only have one blocking comment to address.

Comment on lines 49 to 61
const { data: eventOwnerDefaultShedule } = trpc.viewer.availability.schedule.get.useQuery({
scheduleId: event?.owner?.defaultScheduleId || undefined,
});

useEffect(() => {
if (event && event?.lockTimeZoneToggleOnBookingPage) {
if (event?.schedule?.timeZone) {
setTimezone(event.schedule?.timeZone);
} else if (eventOwnerDefaultShedule) {
setTimezone(eventOwnerDefaultShedule.timeZone);
}
}
}, [event, setTimezone, eventOwnerDefaultShedule]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Blocking: Let's move the logic of getting the owner's timezone to server side

@@ -44,6 +46,20 @@ export const EventMeta = ({
const isEmbed = useIsEmbed();
const hideEventTypeDetails = isEmbed ? embedUiConfig.hideEventTypeDetails : false;

const { data: eventOwnerDefaultShedule } = trpc.viewer.availability.schedule.get.useQuery({
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's fix this typo here as well

Suggested change
const { data: eventOwnerDefaultShedule } = trpc.viewer.availability.schedule.get.useQuery({
const { data: eventOwnerDefaultSchedule } = trpc.viewer.availability.schedule.get.useQuery({

@Shaik-Sirajuddin
Copy link
Contributor Author

Shaik-Sirajuddin commented Mar 19, 2024

Migrated fetching owners default schedule to server side
PTAL @joeauyeung

Copy link
Contributor

@joeauyeung joeauyeung left a comment

Choose a reason for hiding this comment

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

Working as expected. Thanks again @Shaik-Sirajuddin!

@CarinaWolli CarinaWolli enabled auto-merge (squash) March 19, 2024 17:58
@CarinaWolli CarinaWolli merged commit a55ffca into calcom:main Mar 19, 2024
29 of 37 checks passed
@dosubot dosubot bot added this to the v4.2 milestone Apr 16, 2024
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 🐛 bug Something isn't working community Created by Linear-GitHub Sync Low priority Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-3129] Lock timezone on booking page based on availability timezone
4 participants