feat: routing forms integration for booker atom (#18726)

* update booker atom for routing form

* remove logs

* hide routing form properties from docs

* fixup

* add comments to explain why certain fields are not defined for routing forms in v2

* chore: routing for handler return team and org id

* bump libraries platform

* fixup! bump libraries platform

* chore: get routing form params to embed

* logs to remove

* fix import path

* chore: handle routing form params in booker embed

* wip need router api v2 endpoint

* resolve merge conflicts

* fixup

* fixup! Merge branch 'main' into remove-redirect-on-success-for-platform

* fixup! fixup! Merge branch 'main' into remove-redirect-on-success-for-platform

* router atom

* fix libraries version

* cleanup

* remove console logs

* bump libraries

---------

Co-authored-by: Morgan Vernay <[email protected]>
Co-authored-by: Morgan <[email protected]>
This commit is contained in:
authored and GitHub committed 2025-01-29 13:51:58 +02:00
1 parent 9608669f98
commit 8615ccb1aa
21 files changed
+546 -171

No files matched your search

@@ -7,7 +7,7 @@ import { useRouter } from "next/navigation";
import { useEffect, useState } from "react";
import Select from "react-select";
import { CalProvider, BookerEmbed } from "@calcom/atoms";
import { CalProvider, BookerEmbed, Router } from "@calcom/atoms";
import "@calcom/atoms/globals.min.css";
const poppins = Poppins({ subsets: ["latin"], weight: ["400", "800"] });
@@ -121,6 +121,21 @@ export default function App({ Component, pageProps }: AppProps) {
/>
</div>
)}
{pathname === "/router" && (
<div className="p-4">
<Router
formId="a63e6fce-899a-404e-8c38-e069710589c5"
formResponsesURLParams={new URLSearchParams({ isBookingDryRun: "true", Territory: "Europe" })}
onDisplayBookerEmbed={() => {
console.log("render booker embed");
}}
bookerBannerUrl="https://i0.wp.com/mahala.co.uk/wp-content/uploads/2014/12/img_banner-thin_mountains.jpg?fit=800%2C258&ssl=1"
bookerCustomClassNames={{
bookerWrapper: "dark",
}}
/>
</div>
)}
</div>
);
}
@@ -0,0 +1,15 @@
import { Navbar } from "@/components/Navbar";
import { Inter } from "next/font/google";
const inter = Inter({ subsets: ["latin"] });
export default function Router(props: { calUsername: string; calEmail: string }) {
return (
<main className={`flex ${inter.className} text-default dark flex flex-col`}>
<Navbar username={props.calUsername} />
<div>
<h1 className="mx-8 my-4 text-2xl font-bold">This is the router atom</h1>
</div>
</main>
);
}