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: Rerouting a booking with corrected responses #17074

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

hariombalhara
Copy link
Member

@hariombalhara hariombalhara commented Oct 12, 2024

What does this PR do?

Fixes CAL-4498

Loom Demo - With new UI Changes
Old Loom Demo - Not updated with UI/UX changes but should work

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.

How should this be tested?

See Loom

Review Ask

While reviewing please make sure to specifically review that it doesn't break any existing behaviour

Copy link

vercel bot commented Oct 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Oct 17, 2024 0:28am
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Oct 17, 2024 0:28am

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 "POC working with no TS error". 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

@keithwillcode keithwillcode added core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO labels Oct 12, 2024
@hariombalhara hariombalhara changed the title POC working with no TS error feat: Rerouting a booking with updated responses Oct 12, 2024
@hariombalhara hariombalhara changed the title feat: Rerouting a booking with updated responses feat: Rerouting a booking with updated Routing Form responses Oct 12, 2024
@hariombalhara hariombalhara self-assigned this Oct 12, 2024
Copy link
Contributor

github-actions bot commented Oct 12, 2024

E2E results are ready!

@@ -722,7 +780,7 @@ const FirstAttendee = ({
className=" hover:text-blue-500"
href={`mailto:${user.email}`}
onClick={(e) => e.stopPropagation()}>
{user.name}
{user.name || user.email}
Copy link
Member Author

Choose a reason for hiding this comment

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

It fixes user not shown in the list if it doesn't have name set.

type Props = {
form: SerializableForm<App_RoutingForms_Form>;
export type FormInputFieldsProps = {
form: Pick<SerializableForm<App_RoutingForms_Form>, "fields">;
Copy link
Member Author

Choose a reason for hiding this comment

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

Ask for what you need.

@@ -14,7 +14,7 @@ export function findMatchingRoute({
form,
response,
}: {
form: SerializableForm<App_RoutingForms_Form>;
form: Pick<SerializableForm<App_RoutingForms_Form>, "routes" | "fields">;
Copy link
Member Author

Choose a reason for hiding this comment

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

Ask for what is needed.

@@ -453,11 +454,13 @@ const Route = ({
}
if (option.value !== "custom") {
setRoute(route.id, {
action: { ...route.action, value: option.value },
action: { ...route.action, value: option.value, eventTypeId: option.eventTypeId },
Copy link
Member Author

Choose a reason for hiding this comment

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

Now we store eventTypeId as well in routing to allow Rerouting to easily know which eventType is it rerouting to. Instead of it having to query by event slug.

@@ -121,7 +121,7 @@ export async function findTeamMembersMatchingAttributeLogicOfRoute({
getFieldResponse,
});

if (!attributesQueryValue) {
if (raqbQueryValueUtils.isQueryValueEmpty(attributesQueryValue)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

attributesQueryValue could be an object but still without any rule. Better check for perf improvement.

@hariombalhara hariombalhara changed the title feat: Rerouting a booking with updated Routing Form responses feat: Rerouting a booking with corrected responses Oct 17, 2024
Copy link

linear bot commented Oct 17, 2024

@hariombalhara hariombalhara marked this pull request as ready for review October 17, 2024 12:14
@graphite-app graphite-app bot requested review from a team October 17, 2024 12:14
@dosubot dosubot bot added bookings area: bookings, availability, timezones, double booking routing-forms area: routing forms, routing, forms ✨ feature New feature or request labels Oct 17, 2024
Copy link

graphite-app bot commented Oct 17, 2024

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (10/17/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 • (10/17/24)

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

Comment on lines -922 to -933
if (!eventType.seatsPerTimeSlot && originalRescheduledBooking?.uid) {
await prisma.booking.update({
where: {
id: originalRescheduledBooking.id,
},
data: {
rescheduled: true,
status: BookingStatus.CANCELLED,
rescheduledBy: reqBody.rescheduledBy,
},
});
}
Copy link
Member Author

@hariombalhara hariombalhara Oct 17, 2024

Choose a reason for hiding this comment

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

It has been moved to createBooking to make it a part of transaction.

It has happened during testing that new booking creation failed but original booking got cancelled which is inconsistent state.

Moved here https://github.com/calcom/cal.com/pull/17074/files#diff-ef170c5be6fe8235704e6dc1614ddce14fe8b77160223dace06762c41c2edc93R294

Comment on lines +215 to +218
* Who uses it -
* 1. We need to be able to decide which booking can have a 'Reroute' action
*/
routedFromRoutingFormReponse: {
Copy link
Member Author

Choose a reason for hiding this comment

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

Added comment to easily know why certain nested query was needed.

@hariombalhara
Copy link
Member Author

Icon test seems to be failing maybe due to the new icon addition. Not sure how to fix it. @zomars

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 core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO ✨ feature New feature or request ready-for-e2e routing-forms area: routing forms, routing, forms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants