Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
f65c1f4
feat: event tracker helper
Jun 30, 2025
edc3c81
feat: track click events for `data-ph-element`
Jun 30, 2025
bb56fc3
fix: handled click events
gakshita Jun 30, 2025
f19befd
fix: handled name
gakshita Jun 30, 2025
f366f95
chore: tracker element updates
Jun 30, 2025
5301f63
chore: remove export
Jun 30, 2025
8011b76
chore: tracker element type
Jun 30, 2025
ff0112f
chore: track element and event helper.
Jun 30, 2025
5c30d0d
chore: minor improvements
Jun 30, 2025
ef93781
chore: minor refactors
Jun 30, 2025
4b510b8
fix: workspace events
gakshita Jun 30, 2025
9f8872e
fix: added slug
gakshita Jun 30, 2025
0d58c18
fix: changes nomenclature
gakshita Jun 30, 2025
06dc802
Merge branch 'refactor-event-trackers' of https://github.com/makeplan…
gakshita Jun 30, 2025
7ec3673
Merge pull request #7287 from makeplane/fix-workspace-events
gakshita Jun 30, 2025
bc39053
fix: nomenclature
gakshita Jun 30, 2025
f5cc076
chore: update event tracker helper types
Jun 30, 2025
3545008
fix: data id
gakshita Jun 30, 2025
db1caa7
refactor: cycle events (#7290)
prateekshourya29 Jul 1, 2025
be77cf8
Merge branch 'refactor-event-trackers' of github.com:makeplane/plane …
prateekshourya29 Jul 1, 2025
90991df
Refactor module events (#7291)
prateekshourya29 Jul 1, 2025
785f857
Merge branch 'refactor-event-trackers' of github.com:makeplane/plane …
prateekshourya29 Jul 1, 2025
9cd75e6
Merge branch 'preview' of github.com:makeplane/plane into refactor-ev…
prateekshourya29 Jul 1, 2025
59140aa
refactor: global views, product tour, notifications, onboarding, user…
prateekshourya29 Jul 1, 2025
477d5f7
Merge pull request #7303 from makeplane/refactor-addition-events
gakshita Jul 1, 2025
47f3dd4
chore: member tracker events (#7302)
gakshita Jul 1, 2025
37fd368
refactor: update event tracker constants
prateekshourya29 Jul 1, 2025
72d9318
refactor: auth related event trackers (#7306)
prateekshourya29 Jul 1, 2025
d4d49f5
Chore: state events (#7307)
gakshita Jul 1, 2025
b17ee72
chore: project events (#7305)
gakshita Jul 1, 2025
c6f9d35
fix: removed hardcoded values
gakshita Jul 1, 2025
af42ebe
fix: github redirection event
gakshita Jul 1, 2025
20b75a2
chore: project page tracker events (#7304)
gakshita Jul 1, 2025
3051751
chore: minor cleanup and import fixes
prateekshourya29 Jul 1, 2025
349b98f
refactor: added tracker elements for buttons (#7308)
vamsikrishnamathala Jul 1, 2025
b7541b6
fix: event type
Palanikannan1437 Jul 1, 2025
da58043
refactor: posthog group event
prateekshourya29 Jul 1, 2025
5bc5b18
chore: removed instances of event tracker (#7309)
vamsikrishnamathala Jul 1, 2025
9ae2887
refactor: remove event tracker stores and hooks
prateekshourya29 Jul 1, 2025
874e11b
refactor: remove event tracker store
prateekshourya29 Jul 1, 2025
e39dc36
Merge branch 'preview' of github.com:makeplane/plane into refactor-ev…
prateekshourya29 Jul 1, 2025
b07cba1
fix: build errors
prateekshourya29 Jul 1, 2025
aac6867
clean up event tracker payloads
prateekshourya29 Jul 1, 2025
559e04d
chore: workspace-settings-events
gakshita Jul 2, 2025
dc02a87
Merge branch 'preview' of https://github.com/makeplane/plane into cho…
gakshita Jul 2, 2025
3476609
fix: refactor
gakshita Jul 2, 2025
90e64f1
Merge branch 'preview' of https://github.com/makeplane/plane into cho…
gakshita Jul 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useState } from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
import useSWR from "swr";
import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { EUserPermissions, EUserPermissionsLevel, WORKSPACE_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
import { IWebhook } from "@plane/types";
// ui
import { TOAST_TYPE, setToast } from "@plane/ui";
Expand All @@ -14,6 +14,7 @@ import { PageHead } from "@/components/core";
import { SettingsContentWrapper } from "@/components/settings";
import { DeleteWebhookModal, WebhookDeleteSection, WebhookForm } from "@/components/web-hooks";
// hooks
import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useUserPermissions, useWebhook, useWorkspace } from "@/hooks/store";

const WebhookDetailsPage = observer(() => {
Expand Down Expand Up @@ -55,13 +56,26 @@ const WebhookDetailsPage = observer(() => {
};
await updateWebhook(workspaceSlug.toString(), formData.id, payload)
.then(() => {
captureSuccess({
eventName: WORKSPACE_SETTINGS_TRACKER_EVENTS.webhook_updated,
payload: {
webhook: formData.id,
},
});
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",
message: "Webhook updated successfully.",
});
})
.catch((error) => {
captureError({
eventName: WORKSPACE_SETTINGS_TRACKER_EVENTS.webhook_updated,
payload: {
webhook: formData.id,
},
error: error as Error,
});
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { observer } from "mobx-react";
import { useParams } from "next/navigation";
import useSWR from "swr";
// plane imports
import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { EUserPermissions, EUserPermissionsLevel, WORKSPACE_SETTINGS_TRACKER_ELEMENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
// components
import { NotAuthorizedView } from "@/components/auth-screens";
Expand All @@ -15,6 +15,7 @@ import { SettingsContentWrapper, SettingsHeading } from "@/components/settings";
import { WebhookSettingsLoader } from "@/components/ui";
import { WebhooksList, CreateWebhookModal } from "@/components/web-hooks";
// hooks
import { captureClick } from "@/helpers/event-tracker.helper";
import { useUserPermissions, useWebhook, useWorkspace } from "@/hooks/store";
import { useResolvedAssetPath } from "@/hooks/use-resolved-asset-path";

Expand Down Expand Up @@ -71,7 +72,12 @@ const WebhooksListPage = observer(() => {
description={t("workspace_settings.settings.webhooks.description")}
button={{
label: t("workspace_settings.settings.webhooks.add_webhook"),
onClick: () => setShowCreateWebhookModal(true),
onClick: () => {
captureClick({
elementName: WORKSPACE_SETTINGS_TRACKER_ELEMENTS.HEADER_ADD_WEBHOOK_BUTTON,
});
setShowCreateWebhookModal(true);
},
}}
/>
{Object.keys(webhooks).length > 0 ? (
Expand All @@ -89,7 +95,12 @@ const WebhooksListPage = observer(() => {
size="md"
primaryButton={{
text: t("workspace_settings.settings.webhooks.add_webhook"),
onClick: () => setShowCreateWebhookModal(true),
onClick: () => {
captureClick({
elementName: WORKSPACE_SETTINGS_TRACKER_ELEMENTS.EMPTY_STATE_ADD_WEBHOOK_BUTTON,
});
setShowCreateWebhookModal(true);
},
}}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import {
SUBSCRIPTION_REDIRECTION_URLS,
SUBSCRIPTION_WITH_BILLING_FREQUENCY,
TALK_TO_SALES_URL,
WORKSPACE_SETTINGS_TRACKER_ELEMENTS,
WORKSPACE_SETTINGS_TRACKER_EVENTS,
} from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { EProductSubscriptionEnum, TBillingFrequency } from "@plane/types";
Expand All @@ -16,6 +18,7 @@ import { DiscountInfo } from "@/components/license/modal/card/discount-info";
import { getUpgradeButtonStyle } from "@/components/workspace/billing/subscription";
import { TPlanDetail } from "@/constants/plans";
// local imports
import { captureSuccess } from "@/helpers/event-tracker.helper";
import { PlanFrequencyToggle } from "./frequency-toggle";

type TPlanDetailProps = {
Expand Down Expand Up @@ -49,6 +52,12 @@ export const PlanDetail: FC<TPlanDetailProps> = observer((props) => {
const frequency = billingFrequency ?? "year";
// Get the redirection URL based on the subscription type and billing frequency
const redirectUrl = SUBSCRIPTION_REDIRECTION_URLS[subscriptionType][frequency] ?? TALK_TO_SALES_URL;
captureSuccess({
eventName: WORKSPACE_SETTINGS_TRACKER_EVENTS.upgrade_plan_redirected,
payload: {
subscriptionType,
},
});
// Open the URL in a new tab
window.open(redirectUrl, "_blank");
};
Expand Down Expand Up @@ -101,7 +110,15 @@ export const PlanDetail: FC<TPlanDetailProps> = observer((props) => {

{/* Subscription button */}
<div className={cn("flex flex-col gap-1 py-3 items-start transition-all duration-300")}>
<button onClick={handleRedirection} className={cn(upgradeButtonStyle, COMMON_BUTTON_STYLE)}>
<button
onClick={handleRedirection}
className={cn(upgradeButtonStyle, COMMON_BUTTON_STYLE)}
data-ph-element={
isSubscriptionActive
? WORKSPACE_SETTINGS_TRACKER_ELEMENTS.BILLING_UPGRADE_BUTTON(subscriptionType)
: WORKSPACE_SETTINGS_TRACKER_ELEMENTS.BILLING_TALK_TO_SALES_BUTTON
}
>
{isSubscriptionActive ? `Upgrade to ${subscriptionName}` : t("common.upgrade_cta.talk_to_sales")}
</button>
</div>
Expand Down
31 changes: 28 additions & 3 deletions apps/web/core/components/exporter/export-form.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { useState } from "react";
import { intersection } from "lodash";
import { Controller, useForm } from "react-hook-form";
import { EUserPermissions, EUserPermissionsLevel, EXPORTERS_LIST } from "@plane/constants";
import {
EUserPermissions,
EUserPermissionsLevel,
EXPORTERS_LIST,
WORKSPACE_SETTINGS_TRACKER_EVENTS,
WORKSPACE_SETTINGS_TRACKER_ELEMENTS,
} from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { Button, CustomSearchSelect, CustomSelect, TOAST_TYPE, setToast } from "@plane/ui";
import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useProject, useUser, useUserPermissions } from "@/hooks/store";
import { ProjectExportService } from "@/services/project/project-export.service";

Expand Down Expand Up @@ -73,6 +80,12 @@ export const ExportForm = (props: Props) => {
.then(() => {
mutateServices();
setExportLoading(false);
captureSuccess({
eventName: WORKSPACE_SETTINGS_TRACKER_EVENTS.csv_exported,
payload: {
provider: formData.provider.provider,
},
});
setToast({
type: TOAST_TYPE.SUCCESS,
title: t("workspace_settings.settings.exports.modal.toasts.success.title"),
Expand All @@ -88,8 +101,15 @@ export const ExportForm = (props: Props) => {
}),
});
})
.catch(() => {
.catch((error) => {
setExportLoading(false);
captureError({
eventName: WORKSPACE_SETTINGS_TRACKER_EVENTS.csv_exported,
payload: {
provider: formData.provider.provider,
},
error: error as Error,
});
setToast({
type: TOAST_TYPE.ERROR,
title: t("error"),
Expand Down Expand Up @@ -163,7 +183,12 @@ export const ExportForm = (props: Props) => {
</div>
</div>
<div className="flex items-center justify-between ">
<Button variant="primary" type="submit" loading={exportLoading}>
<Button
variant="primary"
type="submit"
loading={exportLoading}
data-ph-element={WORKSPACE_SETTINGS_TRACKER_ELEMENTS.EXPORT_BUTTON}
>
{exportLoading ? `${t("workspace_settings.settings.exports.exporting")}...` : t("export")}
</Button>
</div>
Expand Down
15 changes: 15 additions & 0 deletions apps/web/core/components/web-hooks/create-webhook-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
import React, { useState } from "react";
import { useParams } from "next/navigation";
// types
import { WORKSPACE_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { IWebhook, IWorkspace, TWebhookEventTypes } from "@plane/types";
// ui
import { EModalPosition, EModalWidth, ModalCore, TOAST_TYPE, setToast } from "@plane/ui";
// helpers
import { csvDownload } from "@plane/utils";
// hooks
import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import useKeypress from "@/hooks/use-keypress";
// components
import { WebhookForm } from "./form";
Expand Down Expand Up @@ -67,6 +69,12 @@ export const CreateWebhookModal: React.FC<ICreateWebhookModal> = (props) => {

await createWebhook(workspaceSlug.toString(), payload)
.then(({ webHook, secretKey }) => {
captureSuccess({
eventName: WORKSPACE_SETTINGS_TRACKER_EVENTS.webhook_created,
payload: {
webhook: formData?.url,
},
});
setToast({
type: TOAST_TYPE.SUCCESS,
title: t("workspace_settings.settings.webhooks.toasts.created.title"),
Expand All @@ -79,6 +87,13 @@ export const CreateWebhookModal: React.FC<ICreateWebhookModal> = (props) => {
csvDownload(csvData, `webhook-secret-key-${Date.now()}`);
})
.catch((error) => {
captureError({
eventName: WORKSPACE_SETTINGS_TRACKER_EVENTS.webhook_created,
payload: {
webhook: formData?.url,
},
error: error as Error,
});
setToast({
type: TOAST_TYPE.ERROR,
title: t("workspace_settings.settings.webhooks.toasts.not_created.title"),
Expand Down
21 changes: 18 additions & 3 deletions apps/web/core/components/web-hooks/delete-webhook-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import React, { FC, useState } from "react";
import { useParams } from "next/navigation";
// ui
import { WORKSPACE_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
import { AlertModalCore, TOAST_TYPE, setToast } from "@plane/ui";
// hooks
import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useWebhook } from "@/hooks/store";
import { useAppRouter } from "@/hooks/use-app-router";

Expand Down Expand Up @@ -35,20 +37,33 @@ export const DeleteWebhookModal: FC<IDeleteWebhook> = (props) => {

removeWebhook(workspaceSlug.toString(), webhookId.toString())
.then(() => {
captureSuccess({
eventName: WORKSPACE_SETTINGS_TRACKER_EVENTS.webhook_deleted,
payload: {
webhook: webhookId,
},
});
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",
message: "Webhook deleted successfully.",
});
router.replace(`/${workspaceSlug}/settings/webhooks/`);
})
.catch((error) =>
.catch((error) => {
captureError({
eventName: WORKSPACE_SETTINGS_TRACKER_EVENTS.webhook_deleted,
payload: {
webhook: webhookId,
},
error: error as Error,
});
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
message: error?.error ?? "Something went wrong. Please try again.",
})
)
});
})
.finally(() => setIsDeleting(false));
};

Expand Down
7 changes: 6 additions & 1 deletion apps/web/core/components/web-hooks/form/delete-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { ChevronDown, ChevronUp } from "lucide-react";
import { Disclosure, Transition } from "@headlessui/react";
import { WORKSPACE_SETTINGS_TRACKER_ELEMENTS } from "@plane/constants";
import { Button } from "@plane/ui";

type Props = {
Expand Down Expand Up @@ -36,7 +37,11 @@ export const WebhookDeleteSection: React.FC<Props> = (props) => {
webhook.
</span>
<div>
<Button variant="danger" onClick={openDeleteModal}>
<Button
variant="danger"
onClick={openDeleteModal}
data-ph-element={WORKSPACE_SETTINGS_TRACKER_ELEMENTS.WEBHOOK_DELETE_BUTTON}
>
Delete webhook
</Button>
</div>
Expand Down
7 changes: 6 additions & 1 deletion apps/web/core/components/web-hooks/form/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import React, { FC, useEffect, useState } from "react";
import { observer } from "mobx-react";
import { Controller, useForm } from "react-hook-form";
import { WORKSPACE_SETTINGS_TRACKER_ELEMENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { IWebhook, TWebhookEventTypes } from "@plane/types";
// hooks
Expand Down Expand Up @@ -93,7 +94,11 @@ export const WebhookForm: FC<Props> = observer((props) => {
{data ? (
<div className="pt-0 space-y-5">
<WebhookSecretKey data={data} />
<Button type="submit" loading={isSubmitting}>
<Button
type="submit"
loading={isSubmitting}
data-ph-element={WORKSPACE_SETTINGS_TRACKER_ELEMENTS.WEBHOOK_UPDATE_BUTTON}
>
{isSubmitting ? t("updating") : t("update")}
</Button>
</div>
Expand Down
8 changes: 7 additions & 1 deletion apps/web/core/components/web-hooks/form/toggle.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
"use client";

import { Control, Controller } from "react-hook-form";
// constants
import { WORKSPACE_SETTINGS_TRACKER_ELEMENTS } from "@plane/constants";
import { IWebhook } from "@plane/types";
// ui
import { ToggleSwitch } from "@plane/ui";
// types
// hooks
import { captureClick } from "@/helpers/event-tracker.helper";

interface IWebHookToggle {
control: Control<IWebhook, any>;
Expand All @@ -20,6 +23,9 @@ export const WebhookToggle = ({ control }: IWebHookToggle) => (
<ToggleSwitch
value={value}
onChange={(val: boolean) => {
captureClick({
elementName: WORKSPACE_SETTINGS_TRACKER_ELEMENTS.WEBHOOK_DETAILS_PAGE_TOGGLE_SWITCH,
});
onChange(val);
}}
size="sm"
Expand Down
Loading