feat: posthog version upgrade and added trackings (#24401)
* posthog version upgrade and calai banner tracking * disable posthog for EU * bunch more posthog tracking * Revert yarn.lock changes * add posthog package yarn changes * fix: add missing posthog import and fix lint warning in MemberInvitationModal Co-Authored-By: [email protected] <[email protected]> * fix: type check * cubic fixes * refactor * remove ui playground --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
42 files changed
+570
-271
No files matched your search
@@ -135,8 +135,10 @@ export interface BaseCardProps extends CVACardType {
|
||||
learnMore?: {
|
||||
href: string;
|
||||
text: string;
|
||||
onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
|
||||
};
|
||||
mediaLink?: string;
|
||||
mediaLinkOnClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
|
||||
thumbnailUrl?: string;
|
||||
structure?: string;
|
||||
coverPhoto?: string;
|
||||
@@ -157,6 +159,7 @@ export function Card({
|
||||
learnMore,
|
||||
coverPhoto,
|
||||
buttonClassName,
|
||||
mediaLinkOnClick,
|
||||
}: BaseCardProps) {
|
||||
const LinkComponent = learnMore && learnMore.href.startsWith("https") ? "a" : Link;
|
||||
return (
|
||||
@@ -200,7 +203,7 @@ export function Card({
|
||||
</div>
|
||||
{variant === "SidebarCard" && mediaLink && (
|
||||
<a
|
||||
onClick={actionButton?.onClick}
|
||||
onClick={mediaLinkOnClick}
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
href={mediaLink}
|
||||
@@ -253,6 +256,7 @@ export function Card({
|
||||
href={learnMore.href}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
onClick={learnMore.onClick}
|
||||
className={classNames("text-default text-xs font-medium", buttonClassName)}>
|
||||
{learnMore.text}
|
||||
</LinkComponent>
|
||||
|
||||
@@ -13,6 +13,7 @@ interface ToggleGroupProps extends Omit<RadixToggleGroup.ToggleGroupSingleProps,
|
||||
tooltip?: string;
|
||||
iconLeft?: ReactNode;
|
||||
dataTestId?: string;
|
||||
onClick?: VoidFunction;
|
||||
}[];
|
||||
isFullWidth?: boolean;
|
||||
orientation?: "horizontal" | "vertical";
|
||||
@@ -67,6 +68,7 @@ export const ToggleGroup = ({
|
||||
<OptionalTooltipWrapper key={option.value} tooltipText={option.tooltip}>
|
||||
<RadixToggleGroup.Item
|
||||
disabled={option.disabled}
|
||||
onClick={option?.onClick}
|
||||
value={option.value}
|
||||
data-testid={option.dataTestId ?? `toggle-group-item-${option.value}`}
|
||||
className={classNames(
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import Link from "next/link";
|
||||
import { Fragment } from "react";
|
||||
import posthog from "posthog-js";
|
||||
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { useUrlMatchesCurrentUrl } from "@calcom/lib/hooks/useUrlMatchesCurrentUrl";
|
||||
@@ -29,6 +30,8 @@ export type VerticalTabItemProps = {
|
||||
isActive?: boolean;
|
||||
isBadged?: boolean;
|
||||
"data-testid"?: string;
|
||||
//eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
trackingMetadata?: Record<string, any>;
|
||||
};
|
||||
|
||||
const VerticalTabItem = ({
|
||||
@@ -50,6 +53,9 @@ const VerticalTabItem = ({
|
||||
<>
|
||||
<Link
|
||||
onClick={(e) => {
|
||||
if (props.trackingMetadata) {
|
||||
posthog.capture("settings_sidebar_button_clicked", props.trackingMetadata);
|
||||
}
|
||||
if (props.onClick) {
|
||||
e.preventDefault();
|
||||
props.onClick(name);
|
||||
|
||||
Reference in new issue
Block a user