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: location change during rescheduling #15810

Closed
wants to merge 3 commits into from

Conversation

dilpreetsio
Copy link
Contributor

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).
  • I have added a Docs issue here 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.

How should this be tested?

  • Create an event type with multiple locations
  • Create a booking
  • Reschedule the booking with new location
Inperson-location.mov
Meet.links.mov

Copy link

vercel bot commented Jul 17, 2024

@dilpreetsio 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 bookings area: bookings, availability, timezones, double booking 🐛 bug Something isn't working labels Jul 17, 2024
Copy link
Contributor

github-actions bot commented Jul 17, 2024

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 "Fix location change during rescheduling". 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

@dosubot dosubot bot added the booking-page area: booking page, public booking page, booker label Jul 17, 2024
@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Jul 17, 2024
@graphite-app graphite-app bot requested a review from a team July 17, 2024 14:47
Copy link

graphite-app bot commented Jul 17, 2024

Graphite Automations

"Add community label" took an action on this PR • (07/17/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 • (07/17/24)

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

@Amit91848 Amit91848 changed the title Fix location change during rescheduling fix: location change during rescheduling Jul 17, 2024
@Amit91848
Copy link
Contributor

Type checks are failing @dilpreetsio , please fix those 🙌

@@ -227,6 +227,7 @@ const EventTypePage = (props: EventTypeSetupProps & { allActiveWorkflows?: Workf
const [pendingRoute, setPendingRoute] = useState("");
const leaveWithoutAssigningHosts = useRef(false);
const [animationParentRef] = useAutoAnimate<HTMLDivElement>();

Copy link
Member

Choose a reason for hiding this comment

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

Let's remove this whitespace change.

readOnly = false;
}
// TODO: We need to ensure that location field is properly updated in Booking Success Page, email, calendar, webhook after reschedule
readOnly = false;
Copy link
Member

Choose a reason for hiding this comment

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

Made this change because if (locationResponse?.value === "attendeeInPerson" || "phone") { condition is faulty.

It is always truthy. So, it seems like location change is enabled for attendeeInPerson and phone but in fact it is enabled in all cases.

Introduced in #11651

I think with this PR we should intend to be able to make any change to location field and test it accordingly.

Comment on lines +31 to +36
"system", // Deletable-No, CanChangeIdentifier-No, Toggleable-No, CanMarkOptional-No.
"system-but-optional", // Deletable-No, CanChangeIdentifier-No, Toggleable-Yes, CanMarkOptional-Yes
// TODO: Seems to be unused and could probably be deleted
"system-but-hidden", // Deletable-No, CanChangeIdentifier-No, Always Hidden and thus Optional
"user", // Fully editable. Deletable-Yes, CanChangeIdentifier-Yes, Toggleable-Yes, CanMarkOptional-Yes
// TODO: Seems to be unused and could probably be deleted
Copy link
Member

Choose a reason for hiding this comment

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

Updated the comments to make it more readable.

@@ -391,7 +391,7 @@ export const Components: Record<FieldType, Component> = {
if (!value) {
setValue({
value: options[0]?.value,
optionValue: "",
optionValue: options[0]?.optionValue || "",
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this and other change in this component.

optionValue can only be updated through ComponentForField at line 469.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The booking view expects the optionValue to have the a valid value.

"optionValue" in bookingInfo.responses.location

Currently the optionValue is always empty regardless of the option selected.

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.

Thanks @dilpreetsio for the PR.

I don't understand right now how the changes are fixing the bug. While testing I could see the same behaviour even without the changes in components.tsx file.

Could you confirm that the behaviour(as per the recording your shared in the PR description) didn't exist in main?

@dilpreetsio
Copy link
Contributor Author

@hariombalhara Yes the behaviour on main is not as expected.

Screen.Recording.2024-07-18.at.3.12.10.PM.mov

@Amit91848
Copy link
Contributor

Same issue was flagged earlier #15108 (comment). Also add tests to ensure this doesn't break in the future.

Copy link
Contributor

This PR is being marked as stale due to inactivity.

@github-actions github-actions bot added the Stale label Aug 15, 2024
@anikdhabal anikdhabal marked this pull request as draft August 23, 2024 18:41
@github-actions github-actions bot removed the Stale label Aug 24, 2024
@Amit91848
Copy link
Contributor

Thanks for your contribution but closing in favour of #16162

@Amit91848 Amit91848 closed this Sep 3, 2024
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CAL-4049] Choosing a different location when rescheduling not working
4 participants