Skip to content

feat: "cal.isBookingDryRun" to be used for Routing form as well#18832

Merged
hariombalhara merged 1 commit intomainfrom
no-response-stored-in-dry-run
Jan 24, 2025
Merged

feat: "cal.isBookingDryRun" to be used for Routing form as well#18832
hariombalhara merged 1 commit intomainfrom
no-response-stored-in-dry-run

Conversation

@hariombalhara
Copy link
Copy Markdown
Member

@hariombalhara hariombalhara commented Jan 23, 2025

What does this PR do?

If cal.isBookingDry=true then

  • No response email is sent
  • No form related webhooks are triggered
  • No response is stored

It is supported in both Headless Router and Routing Form

Demo loom - Also shows the testing

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. 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?

  1. Setup a routing Form to route to teamMembers using attributes
  2. Go to Routing Form page(/forms/{FORM_ID}?cal.isBookingDryRun=true)
    • Submit the form
    • Verify that response wasn't there in DB.(Also, verify the debug log for dry run)
    • Reaches booking form which shows 'You are doing a test booking."
  3. Do the same with headless router(/router?form={FORM_ID}&cal.isBookingDryRun=true)

@graphite-app graphite-app Bot requested a review from a team January 23, 2025 13:35
@keithwillcode keithwillcode added core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO labels Jan 23, 2025
@dosubot dosubot Bot added routing-forms area: routing forms, routing, forms ✨ feature New feature or request labels Jan 23, 2025
@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented Jan 23, 2025

Graphite Automations

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

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

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 23, 2025

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 Jan 23, 2025 2:11pm
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Jan 23, 2025 2:11pm

formResponse: response,
fields: serializableForm.fields,
searchParams: new URLSearchParams(stringify(fieldsResponses)),
searchParams: new URLSearchParams(stringify(paramsToBeForwardedAsIs)),
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It is jsut fieldsResponses ensuring that 'cal.isBookingDryRun' is there.

// Cloudflare Turnstile Captcha
const shouldRenderCaptcha =
renderCaptcha && CLOUDFLARE_SITE_ID && CLOUDFLARE_USE_TURNSTILE_IN_BOOKER === "1";
!process.env.NEXT_PUBLIC_IS_E2E &&
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Found this bug while testing it. In E2e mode the Turnstile component renders null but shouldRenderCaptcha=true was disabling the confirm button.

cc @sean-brydon

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

My bad! Yeah this works

Copy link
Copy Markdown
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.

LGTM

@github-actions
Copy link
Copy Markdown
Contributor

E2E results are ready!

@hariombalhara hariombalhara merged commit b3f946d into main Jan 24, 2025
@hariombalhara hariombalhara deleted the no-response-stored-in-dry-run branch January 24, 2025 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

4 participants