@@ -322,7 +324,9 @@ export default function Shell(props: {
)}>
{/* show top navigation for md and smaller (tablet and phones) */}
{status === "authenticated" && (
-
{/* show bottom navigation for md and smaller (tablet and phones) */}
{status === "authenticated" && (
-
+
{/* note(PeerRich): using flatMap instead of map to remove settings from bottom nav */}
{navigation.flatMap((item, itemIdx) =>
item.href === "/settings/profile" ? (
diff --git a/apps/web/components/booking/pages/AvailabilityPage.tsx b/apps/web/components/booking/pages/AvailabilityPage.tsx
index 9a29f279..cd2c2813 100644
--- a/apps/web/components/booking/pages/AvailabilityPage.tsx
+++ b/apps/web/components/booking/pages/AvailabilityPage.tsx
@@ -16,7 +16,7 @@ import { useRouter } from "next/router";
import { useEffect, useMemo, useState } from "react";
import { FormattedNumber, IntlProvider } from "react-intl";
-import { useEmbedStyles, useIsEmbed, useIsBackgroundTransparent } from "@calcom/embed-core";
+import { useEmbedStyles, useIsEmbed, useIsBackgroundTransparent, sdkActionManager } from "@calcom/embed-core";
import classNames from "@calcom/lib/classNames";
import { asStringOrNull } from "@lib/asStringOrNull";
@@ -83,6 +83,10 @@ const AvailabilityPage = ({ profile, plan, eventType, workingHours, previousPage
return null;
}, [router.query.date]);
+ if (selectedDate) {
+ // Let iframe take the width available due to increase in max-width
+ sdkActionManager?.fire("__refreshWidth", {});
+ }
const [isTimeOptionsOpen, setIsTimeOptionsOpen] = useState(false);
const [timeFormat, setTimeFormat] = useState(detectBrowserTimeFormat);
@@ -91,7 +95,12 @@ const AvailabilityPage = ({ profile, plan, eventType, workingHours, previousPage
useEffect(() => {
handleToggle24hClock(localStorage.getItem("timeOption.is24hClock") === "true");
- telemetry.withJitsu((jitsu) => jitsu.track(telemetryEventTypes.pageView, collectPageParameters()));
+ telemetry.withJitsu((jitsu) =>
+ jitsu.track(
+ telemetryEventTypes.pageView,
+ collectPageParameters("availability", { isTeamBooking: document.URL.includes("team/") })
+ )
+ );
}, [telemetry]);
const changeDate = (newDate: Dayjs) => {
@@ -136,7 +145,7 @@ const AvailabilityPage = ({ profile, plan, eventType, workingHours, previousPage
diff --git a/apps/web/components/booking/pages/BookingPage.tsx b/apps/web/components/booking/pages/BookingPage.tsx
index 3dd4a421..dd36b04f 100644
--- a/apps/web/components/booking/pages/BookingPage.tsx
+++ b/apps/web/components/booking/pages/BookingPage.tsx
@@ -222,7 +222,10 @@ const BookingPage = ({
const bookEvent = (booking: BookingFormValues) => {
telemetry.withJitsu((jitsu) =>
- jitsu.track(telemetryEventTypes.bookingConfirmed, collectPageParameters())
+ jitsu.track(
+ telemetryEventTypes.bookingConfirmed,
+ collectPageParameters("/book", { isTeamBooking: document.URL.includes("team/") })
+ )
);
// "metadata" is a reserved key to allow for connecting external users without relying on the email address.
@@ -290,9 +293,10 @@ const BookingPage = ({
+ className={classNames(
+ isEmbed ? "mx-auto" : "mx-auto my-0 rounded-sm sm:my-24",
+ "max-w-3xl sm:border sm:dark:border-gray-600"
+ )}>
{isReady && (
{
{props.children}
);
-
+ const telemetryClient = useMemo(createTelemetryClient, []);
return (
-
+
{isPublicPage ? (
RemainingProviders
) : (
diff --git a/apps/web/lib/telemetry.ts b/apps/web/lib/telemetry.ts
index 5fa5ff01..90093be7 100644
--- a/apps/web/lib/telemetry.ts
+++ b/apps/web/lib/telemetry.ts
@@ -46,7 +46,7 @@ function isLocalhost(host: string) {
* Collects page parameters and makes sure no sensitive data made it to telemetry
* @param route current next.js route
*/
-export function collectPageParameters(route?: string): any {
+export function collectPageParameters(route?: string, extraData: Record = {}): any {
const host = document.location.hostname;
const maskedHost = isLocalhost(host) ? "localhost" : "masked";
//starts with ''
@@ -60,6 +60,7 @@ export function collectPageParameters(route?: string): any {
doc_search: "",
doc_path: docPath,
referer: "",
+ ...extraData,
};
}
diff --git a/apps/web/pages/[user].tsx b/apps/web/pages/[user].tsx
index 672841db..43a84638 100644
--- a/apps/web/pages/[user].tsx
+++ b/apps/web/pages/[user].tsx
@@ -20,6 +20,7 @@ import { useLocale } from "@calcom/lib/hooks/useLocale";
import { useExposePlanGlobally } from "@lib/hooks/useExposePlanGlobally";
import useTheme from "@lib/hooks/useTheme";
import prisma from "@lib/prisma";
+import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@lib/telemetry";
import { inferSSRProps } from "@lib/types/inferSSRProps";
import AvatarGroup from "@components/ui/AvatarGroup";
@@ -108,6 +109,13 @@ export default function User(props: inferSSRProps) {
const nameOrUsername = user.name || user.username || "";
const [evtsToVerify, setEvtsToVerify] = useState({});
const isEmbed = useIsEmbed();
+ const telemetry = useTelemetry();
+
+ useEffect(() => {
+ telemetry.withJitsu((jitsu) =>
+ jitsu.track(telemetryEventTypes.pageView, collectPageParameters("/[user]"))
+ );
+ }, [telemetry]);
return (
<>
diff --git a/apps/web/pages/team/[slug].tsx b/apps/web/pages/team/[slug].tsx
index df3a85db..260cbc4d 100644
--- a/apps/web/pages/team/[slug].tsx
+++ b/apps/web/pages/team/[slug].tsx
@@ -3,7 +3,7 @@ import { UserPlan } from "@prisma/client";
import classNames from "classnames";
import { GetServerSidePropsContext } from "next";
import Link from "next/link";
-import React from "react";
+import React, { useEffect } from "react";
import { useIsEmbed } from "@calcom/embed-core";
import Button from "@calcom/ui/Button";
@@ -15,6 +15,7 @@ import useTheme from "@lib/hooks/useTheme";
import { useToggleQuery } from "@lib/hooks/useToggleQuery";
import { defaultAvatarSrc } from "@lib/profile";
import { getTeamWithMembers } from "@lib/queries/teams";
+import { collectPageParameters, telemetryEventTypes, useTelemetry } from "@lib/telemetry";
import { inferSSRProps } from "@lib/types/inferSSRProps";
import EventTypeDescription from "@components/eventtype/EventTypeDescription";
@@ -25,13 +26,24 @@ import AvatarGroup from "@components/ui/AvatarGroup";
import Text from "@components/ui/Text";
export type TeamPageProps = inferSSRProps;
-
function TeamPage({ team }: TeamPageProps) {
const { isReady, Theme } = useTheme();
const showMembers = useToggleQuery("members");
const { t } = useLocale();
useExposePlanGlobally("PRO");
const isEmbed = useIsEmbed();
+ const telemetry = useTelemetry();
+
+ useEffect(() => {
+ telemetry.withJitsu((jitsu) =>
+ jitsu.track(
+ telemetryEventTypes.pageView,
+ collectPageParameters("/team/[slug]", {
+ isTeamBooking: true,
+ })
+ )
+ );
+ }, [telemetry]);
const eventTypes = (
{team.eventTypes.map((type) => (
diff --git a/packages/embeds/embed-core/README.md b/packages/embeds/embed-core/README.md
index f223288e..bd1e76dc 100644
--- a/packages/embeds/embed-core/README.md
+++ b/packages/embeds/embed-core/README.md
@@ -41,6 +41,17 @@ Make `dist/embed.umd.js` servable on URL
- let user choose the loader for ModalBox
- If website owner links the booking page directly for an event, should the user be able to go to events-listing page using back button ?
- Let user specify both dark and light theme colors. Right now the colors specified are for light theme.
+ - Embed doesn't adapt to screen size without page refresh.
+ - Try opening in portrait mode and then go to landscape mode.
+ - In inline mode, due to changing height of iframe, the content goes beyond the fold. Automatic scroll needs to be implemented.
+ - On Availability page, when selecting date, width doesn't increase. max-width is there but because of strict width restriction with iframe, it doesn't allow it to expand.
+
+- Branding
+ - Powered by Cal.com and 'Try it for free'. Should they be shown only for FREE account.
+ - Branding at the bottom has been removed for UI improvements, need to see where to add it.
+
+- API
+ - Allow loader color customization using UI command itself too.
- Automation Tests
- Run automation tests in CI
@@ -64,8 +75,18 @@ Make `dist/embed.umd.js` servable on URL
- Might be better to pass all configuration using a single base64encoded query param to booking page.
+- Performance Improvements
+ - Custom written Tailwind CSS is sent multiple times for different custom elements.
+
- Embed Code Generator
+- Release Issues
+ - Compatibility Issue - When embed-iframe.js is updated in such a way that it is not compatible with embed.js, doing a release might break the embed for some time. e.g. iframeReady event let's say get's changed to something else
+ - Best Case scenario - App and Website goes live at the same time. A website using embed loads the same updated and thus compatible versions of embed.js and embed-iframe.js
+ - Worst case scenario - App goes live first, website PR isn't merged yet and thus a website using the embed would load updated version of embed-iframe but outdated version of embed.js possibly breaking the embed.
+ - Ideal Solution: It would be to keep the libraries versioned and embed.js should instruct app within iframe to load a particular version. But if we push a security fix, it is possible that someone is still enforcing embed to load version with security issue. Need to handle this.
+ - Quick Solution: Serve embed.js also from app, so that they go live together and there is only a slight chance of compatibility issues on going live. Note, that they can still occur as 2 different requests are sent at different times to fetch the libraries and deployments can go live in between,
+
- UI Config Features
- Theme switch dynamically - If user switches the theme on website, he should be able to do it on embed. Add a demo for the API. Also, test system theme handling.
- How would the user add on hover styles just using style attribute ?
@@ -73,22 +94,8 @@ Make `dist/embed.umd.js` servable on URL
- If just iframe refreshes due to some reason, embed script can't replay the applied instructions.
- React Component
- - `onClick` support with preloading
-
-Embed for authenticated pages
-
-- Currently embed is properly supported for non authenticated pages like cal.com/john. It is supported for team links as well.
-- For such pages, you can customize the colors of all the texts and give a common background to all pages under your cal link
-- If we can support other pages, which are behind login, it can open possibilities for users to show "upcoming bookings", "availability" and other functionalities on their website itself.
- - First of all we need more usecases for this.
- - Think of it in this way. Cal.com is build with many different UI components that are put together to work seamlessly, what if the user can choose which component they need and which they don't
- - The main problem with this is that, there are so many pages in the app. We would need to ensure that all the pages use the same text colors only that are available as embed UI configuration.
- - We would need to hide certain UI components when opening a page. e.g. the navigation component wouldn't be there.
- - User might want to change the text also for components, e.g. he might call "Event Type" as "Meeting Type" everywhere. common.json would be useful in this scenario.
- - Login form shouldn't be visible in embed as auth would be taken care of separately. If due to cookies being expired, the component can't be shown then whatever auth flow is configured, can be triggered
- - In most scenarios, user would have a website on which the visitors would be signing in already into their system(and thus they own the user table) and he would want to just link those users to cal.com - This would be allowed only with self hosted instance ?
- - So, cal.com won't maintain the user details itself and would simply store a user id which it would provide to hosting website to retrieve user information whenever it needs it.
-
+ - `onClick` support with automatic preloading
+- Shadow DOM is currently in open state, which probably means that any styling change on website can possibly impact loader.
## Pending Documentation
diff --git a/packages/embeds/embed-core/index.html b/packages/embeds/embed-core/index.html
index de639074..6f6a53a8 100644
--- a/packages/embeds/embed-core/index.html
+++ b/packages/embeds/embed-core/index.html
@@ -54,6 +54,10 @@
.loader {
color: green;
}
+ * {
+ --cal-brand-border-color: blue;
+ --cal-brand-background-color: blue;
+ }
@@ -61,10 +65,6 @@
;
diff --git a/packages/embeds/embed-react/test-cal.tsx b/packages/embeds/embed-react/test-cal.tsx
index 1cf7c0b9..9bc56e5c 100644
--- a/packages/embeds/embed-react/test-cal.tsx
+++ b/packages/embeds/embed-react/test-cal.tsx
@@ -9,6 +9,7 @@ function App() {
There is Cal component below me