feat: In Embed, Fire 'routed' event when Routing Form routes (#14470)
This commit is contained in:
1 parent
e2ef8d2dc8
commit
9a66dae0ba
5 files changed
+23
-5
No files matched your search
@@ -156,7 +156,7 @@
|
||||
Book Free Event [Auto Theme][uiConfig.hideEventTypeDetails=true]
|
||||
</button>
|
||||
<button data-cal-namespace="routingFormAuto" data-cal-link="forms/948ae412-d995-4865-875a-48302588de03">
|
||||
Book through Routing Form [Auto Theme]
|
||||
Book through Routing Form [Auto Theme] - Test for 'routed' event
|
||||
</button>
|
||||
<button
|
||||
data-cal-namespace="routingFormDark"
|
||||
|
||||
@@ -371,6 +371,15 @@ Cal("init", "routingFormAuto", {
|
||||
origin: "http://localhost:3000",
|
||||
});
|
||||
|
||||
Cal.ns.routingFormAuto("on", {
|
||||
action: "routed",
|
||||
callback: (e) => {
|
||||
const detail = e.detail;
|
||||
console.log("`routed` event data:", detail.data);
|
||||
alert(`Routing Done - Check console for 'routed' event data`);
|
||||
},
|
||||
});
|
||||
|
||||
Cal("init", "routingFormDark", {
|
||||
debug: true,
|
||||
origin: "http://localhost:3000",
|
||||
|
||||
@@ -56,6 +56,10 @@ export type EventDataMap = {
|
||||
};
|
||||
eventType: unknown;
|
||||
};
|
||||
routed: {
|
||||
actionType: "customPageMessage" | "externalRedirectUrl" | "eventTypeRedirectUrl";
|
||||
actionValue: string;
|
||||
};
|
||||
"*": Record<string, unknown>;
|
||||
__routeChanged: Record<string, never>;
|
||||
__windowLoadComplete: Record<string, never>;
|
||||
|
||||
Reference in new issue
Block a user