diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/analytics/[tabId]/page.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/analytics/[tabId]/page.tsx
index f3a5fe3e80..58b0f9567b 100644
--- a/apps/web/app/(all)/[workspaceSlug]/(projects)/analytics/[tabId]/page.tsx
+++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/analytics/[tabId]/page.tsx
@@ -2,7 +2,7 @@ import { useState, useEffect } from "react";
import { observer } from "mobx-react";
import { useRouter } from "next/navigation";
// plane package imports
-import { EUserPermissions, EUserPermissionsLevel, PROJECT_TRACKER_ELEMENTS } from "@plane/constants";
+import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { EmptyStateDetailed } from "@plane/propel/empty-state";
import { Tabs } from "@plane/propel/tabs";
@@ -11,7 +11,6 @@ import { cn } from "@plane/utils";
import AnalyticsFilterActions from "@/components/analytics/analytics-filter-actions";
import { PageHead } from "@/components/core/page-title";
// hooks
-import { captureClick } from "@/helpers/event-tracker.helper";
import { useCommandPalette } from "@/hooks/store/use-command-palette";
import { useProject } from "@/hooks/store/use-project";
import { useWorkspace } from "@/hooks/store/use-workspace";
@@ -120,7 +119,6 @@ function AnalyticsPage({ params }: Route.ComponentProps) {
label: "Create a project",
onClick: () => {
toggleCreateProjectModal(true);
- captureClick({ elementName: PROJECT_TRACKER_ELEMENTS.EMPTY_STATE_CREATE_PROJECT_BUTTON });
},
disabled: !canPerformEmptyStateActions,
},
diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(list)/header.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(list)/header.tsx
index b7e339d045..74c04c18b9 100644
--- a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(list)/header.tsx
+++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/pages/(list)/header.tsx
@@ -2,7 +2,7 @@ import { useState } from "react";
import { observer } from "mobx-react";
import { useParams, useRouter, useSearchParams } from "next/navigation";
// constants
-import { EPageAccess, PROJECT_PAGE_TRACKER_EVENTS, PROJECT_TRACKER_ELEMENTS } from "@plane/constants";
+import { EPageAccess } from "@plane/constants";
// plane types
import { Button } from "@plane/propel/button";
import { PageIcon } from "@plane/propel/icons";
@@ -12,7 +12,6 @@ import type { TPage } from "@plane/types";
import { Breadcrumbs, Header } from "@plane/ui";
// helpers
import { BreadcrumbLink } from "@/components/common/breadcrumb-link";
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useProject } from "@/hooks/store/use-project";
// plane web imports
@@ -40,23 +39,10 @@ export const PagesListHeader = observer(function PagesListHeader() {
await createPage(payload)
.then((res) => {
- captureSuccess({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.create,
- payload: {
- id: res?.id,
- state: "SUCCESS",
- },
- });
const pageId = `/${workspaceSlug}/projects/${currentProjectDetails?.id}/pages/${res?.id}`;
router.push(pageId);
})
.catch((err) => {
- captureError({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.create,
- payload: {
- state: "ERROR",
- },
- });
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
@@ -86,13 +72,7 @@ export const PagesListHeader = observer(function PagesListHeader() {
{canCurrentUserCreatePage && (
-
diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/star-us-link.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/star-us-link.tsx
index 7501a2e1e8..8b1cc9769e 100644
--- a/apps/web/app/(all)/[workspaceSlug]/(projects)/star-us-link.tsx
+++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/star-us-link.tsx
@@ -1,12 +1,9 @@
import { useTheme } from "next-themes";
// plane imports
-import { HEADER_GITHUB_ICON, GITHUB_REDIRECTED_TRACKER_EVENT } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
// assets
import githubBlackImage from "@/app/assets/logos/github-black.png?url";
import githubWhiteImage from "@/app/assets/logos/github-white.png?url";
-// helpers
-import { captureElementAndEvent } from "@/helpers/event-tracker.helper";
export function StarUsOnGitHubLink() {
// plane hooks
@@ -18,17 +15,6 @@ export function StarUsOnGitHubLink() {
return (
- captureElementAndEvent({
- element: {
- elementName: HEADER_GITHUB_ICON,
- },
- event: {
- eventName: GITHUB_REDIRECTED_TRACKER_EVENT,
- state: "SUCCESS",
- },
- })
- }
className="flex flex-shrink-0 items-center gap-1.5 rounded-sm bg-layer-2 px-3 py-1.5"
href="https://github.com/makeplane/plane"
target="_blank"
diff --git a/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/members/page.tsx b/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/members/page.tsx
index 1de0255b68..f74d9ca271 100644
--- a/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/members/page.tsx
+++ b/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/members/page.tsx
@@ -20,8 +20,6 @@ import { PageHead } from "@/components/core/page-title";
import { MemberListFiltersDropdown } from "@/components/project/dropdowns/filters/member-list";
import { SettingsContentWrapper } from "@/components/settings/content-wrapper";
import { WorkspaceMembersList } from "@/components/workspace/settings/members-list";
-// helpers
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useMember } from "@/hooks/store/use-member";
import { useWorkspace } from "@/hooks/store/use-workspace";
@@ -58,13 +56,6 @@ const WorkspaceMembersSettingsPage = observer(function WorkspaceMembersSettingsP
setInviteModal(false);
- captureSuccess({
- eventName: MEMBER_TRACKER_EVENTS.invite,
- payload: {
- emails: data.emails.map((email) => email.email),
- },
- });
-
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",
@@ -76,14 +67,6 @@ const WorkspaceMembersSettingsPage = observer(function WorkspaceMembersSettingsP
const err = error as Error & { error?: string };
message = err.error;
}
- captureError({
- eventName: MEMBER_TRACKER_EVENTS.invite,
- payload: {
- emails: data.emails.map((email) => email.email),
- },
- error: error as Error,
- });
-
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
diff --git a/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/webhooks/[webhookId]/page.tsx b/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/webhooks/[webhookId]/page.tsx
index c9135696d5..441ae6662f 100644
--- a/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/webhooks/[webhookId]/page.tsx
+++ b/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/webhooks/[webhookId]/page.tsx
@@ -1,7 +1,7 @@
import { useState } from "react";
import { observer } from "mobx-react";
import useSWR from "swr";
-import { EUserPermissions, EUserPermissionsLevel, WORKSPACE_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
+import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IWebhook } from "@plane/types";
// ui
@@ -11,7 +11,6 @@ import { PageHead } from "@/components/core/page-title";
import { SettingsContentWrapper } from "@/components/settings/content-wrapper";
import { DeleteWebhookModal, WebhookDeleteSection, WebhookForm } from "@/components/web-hooks";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useWebhook } from "@/hooks/store/use-webhook";
import { useWorkspace } from "@/hooks/store/use-workspace";
import { useUserPermissions } from "@/hooks/store/user";
@@ -55,12 +54,6 @@ function WebhookDetailsPage({ params }: Route.ComponentProps) {
try {
await updateWebhook(workspaceSlug, formData.id, payload);
-
- captureSuccess({
- eventName: WORKSPACE_SETTINGS_TRACKER_EVENTS.webhook_updated,
- payload: { webhook: formData.id },
- });
-
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",
@@ -68,12 +61,6 @@ function WebhookDetailsPage({ params }: Route.ComponentProps) {
});
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: any) {
- captureError({
- eventName: WORKSPACE_SETTINGS_TRACKER_EVENTS.webhook_updated,
- payload: { webhook: formData.id },
- error: error as Error,
- });
-
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
diff --git a/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/webhooks/page.tsx b/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/webhooks/page.tsx
index 93ae93967e..41ef5af4f6 100644
--- a/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/webhooks/page.tsx
+++ b/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/webhooks/page.tsx
@@ -2,7 +2,7 @@ import { useEffect, useState } from "react";
import { observer } from "mobx-react";
import useSWR from "swr";
// plane imports
-import { EUserPermissions, EUserPermissionsLevel, WORKSPACE_SETTINGS_TRACKER_ELEMENTS } from "@plane/constants";
+import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
// components
import { EmptyStateCompact } from "@plane/propel/empty-state";
@@ -13,7 +13,6 @@ import { SettingsHeading } from "@/components/settings/heading";
import { WebhookSettingsLoader } from "@/components/ui/loader/settings/web-hook";
import { WebhooksList, CreateWebhookModal } from "@/components/web-hooks";
// hooks
-import { captureClick } from "@/helpers/event-tracker.helper";
import { useWebhook } from "@/hooks/store/use-webhook";
import { useWorkspace } from "@/hooks/store/use-workspace";
import { useUserPermissions } from "@/hooks/store/user";
@@ -72,9 +71,6 @@ function WebhooksListPage({ params }: Route.ComponentProps) {
button={{
label: t("workspace_settings.settings.webhooks.add_webhook"),
onClick: () => {
- captureClick({
- elementName: WORKSPACE_SETTINGS_TRACKER_ELEMENTS.HEADER_ADD_WEBHOOK_BUTTON,
- });
setShowCreateWebhookModal(true);
},
}}
@@ -94,9 +90,6 @@ function WebhooksListPage({ params }: Route.ComponentProps) {
{
label: t("settings_empty_state.webhooks.cta_primary"),
onClick: () => {
- captureClick({
- elementName: WORKSPACE_SETTINGS_TRACKER_ELEMENTS.EMPTY_STATE_ADD_WEBHOOK_BUTTON,
- });
setShowCreateWebhookModal(true);
},
},
diff --git a/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/account/api-tokens/page.tsx b/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/account/api-tokens/page.tsx
index 6553d52a1c..c071ef4c35 100644
--- a/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/account/api-tokens/page.tsx
+++ b/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/account/api-tokens/page.tsx
@@ -1,8 +1,7 @@
-import React, { useState } from "react";
+import { useState } from "react";
import { observer } from "mobx-react";
import useSWR from "swr";
// plane imports
-import { PROFILE_SETTINGS_TRACKER_ELEMENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
// component
import { EmptyStateCompact } from "@plane/propel/empty-state";
@@ -14,7 +13,6 @@ import { SettingsHeading } from "@/components/settings/heading";
import { APITokenSettingsLoader } from "@/components/ui/loader/settings/api-token";
import { API_TOKENS_LIST } from "@/constants/fetch-keys";
// store hooks
-import { captureClick } from "@/helpers/event-tracker.helper";
import { useWorkspace } from "@/hooks/store/use-workspace";
const apiTokenService = new APITokenService();
@@ -51,9 +49,6 @@ function ApiTokensPage() {
button={{
label: t("workspace_settings.settings.api_tokens.add_token"),
onClick: () => {
- captureClick({
- elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.HEADER_ADD_PAT_BUTTON,
- });
setIsCreateTokenModalOpen(true);
},
}}
@@ -72,9 +67,6 @@ function ApiTokensPage() {
button={{
label: t("workspace_settings.settings.api_tokens.add_token"),
onClick: () => {
- captureClick({
- elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.HEADER_ADD_PAT_BUTTON,
- });
setIsCreateTokenModalOpen(true);
},
}}
@@ -89,9 +81,6 @@ function ApiTokensPage() {
{
label: t("settings_empty_state.tokens.cta_primary"),
onClick: () => {
- captureClick({
- elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.EMPTY_STATE_ADD_PAT_BUTTON,
- });
setIsCreateTokenModalOpen(true);
},
},
diff --git a/apps/web/app/(all)/invitations/page.tsx b/apps/web/app/(all)/invitations/page.tsx
index f16a8a24e6..ca926bc502 100644
--- a/apps/web/app/(all)/invitations/page.tsx
+++ b/apps/web/app/(all)/invitations/page.tsx
@@ -1,11 +1,11 @@
-import React, { useState } from "react";
+import { useState } from "react";
import { observer } from "mobx-react";
import Link from "next/link";
import useSWR, { mutate } from "swr";
import { CheckCircle2 } from "lucide-react";
// plane imports
-import { ROLE, MEMBER_TRACKER_EVENTS, MEMBER_TRACKER_ELEMENTS, GROUP_WORKSPACE_TRACKER_EVENT } from "@plane/constants";
+import { ROLE } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
// types
import { Button } from "@plane/propel/button";
@@ -19,9 +19,7 @@ import emptyInvitation from "@/app/assets/empty-state/invitation.svg?url";
import { EmptyState } from "@/components/common/empty-state";
import { WorkspaceLogo } from "@/components/workspace/logo";
import { USER_WORKSPACES_LIST } from "@/constants/fetch-keys";
-// helpers
// hooks
-import { captureError, captureSuccess, joinEventGroup } from "@/helpers/event-tracker.helper";
import { useWorkspace } from "@/hooks/store/use-workspace";
import { useUser, useUserProfile } from "@/hooks/store/user";
import { useAppRouter } from "@/hooks/use-app-router";
@@ -79,18 +77,6 @@ function UserInvitationsPage() {
const firstInviteId = invitationsRespond[0];
const invitation = invitations?.find((i) => i.id === firstInviteId);
const redirectWorkspace = invitations?.find((i) => i.id === firstInviteId)?.workspace;
- if (redirectWorkspace?.id) {
- joinEventGroup(GROUP_WORKSPACE_TRACKER_EVENT, redirectWorkspace?.id, {
- date: new Date().toDateString(),
- workspace_id: redirectWorkspace?.id,
- });
- }
- captureSuccess({
- eventName: MEMBER_TRACKER_EVENTS.accept,
- payload: {
- member_id: invitation?.id,
- },
- });
updateUserProfile({ last_workspace_id: redirectWorkspace?.id })
.then(() => {
setIsJoiningWorkspaces(false);
@@ -107,14 +93,7 @@ function UserInvitationsPage() {
setIsJoiningWorkspaces(false);
});
})
- .catch((err) => {
- captureError({
- eventName: MEMBER_TRACKER_EVENTS.accept,
- payload: {
- member_id: invitationsRespond?.[0],
- },
- error: err,
- });
+ .catch((_err) => {
setToast({
type: TOAST_TYPE.ERROR,
title: t("error"),
@@ -183,7 +162,6 @@ function UserInvitationsPage() {
onClick={submitInvitations}
disabled={isJoiningWorkspaces || invitationsRespond.length === 0}
loading={isJoiningWorkspaces}
- data-ph-element={MEMBER_TRACKER_ELEMENTS.ACCEPT_INVITATION_BUTTON}
>
{t("accept_and_join")}
diff --git a/apps/web/app/provider.tsx b/apps/web/app/provider.tsx
index 4d23fed9d3..ef696647b2 100644
--- a/apps/web/app/provider.tsx
+++ b/apps/web/app/provider.tsx
@@ -29,10 +29,6 @@ const ChatSupportModal = lazy(function ChatSupportModal() {
return import("@/components/global/chat-support-modal");
});
-const PostHogProvider = lazy(function PostHogProvider() {
- return import("@/lib/posthog-provider");
-});
-
export interface IAppProvider {
children: React.ReactNode;
}
@@ -52,9 +48,7 @@ export function AppProvider(props: IAppProvider) {
-
- {children}
-
+ {children}
diff --git a/apps/web/ce/components/onboarding/tour/root.tsx b/apps/web/ce/components/onboarding/tour/root.tsx
index f5498b0468..8e9a87004e 100644
--- a/apps/web/ce/components/onboarding/tour/root.tsx
+++ b/apps/web/ce/components/onboarding/tour/root.tsx
@@ -10,8 +10,6 @@ import IssuesTour from "@/app/assets/onboarding/issues.webp?url";
import ModulesTour from "@/app/assets/onboarding/modules.webp?url";
import PagesTour from "@/app/assets/onboarding/pages.webp?url";
import ViewsTour from "@/app/assets/onboarding/views.webp?url";
-// helpers
-import { captureClick } from "@/helpers/event-tracker.helper";
// hooks
import { useCommandPalette } from "@/hooks/store/use-command-palette";
import { useUser } from "@/hooks/store/user";
@@ -107,9 +105,6 @@ export const TourRoot = observer(function TourRoot(props: TOnboardingTourProps)
{
- captureClick({
- elementName: PRODUCT_TOUR_TRACKER_ELEMENTS.START_BUTTON,
- });
setStep("work-items");
}}
>
@@ -119,9 +114,6 @@ export const TourRoot = observer(function TourRoot(props: TOnboardingTourProps)
type="button"
className="bg-transparent text-11 font-medium text-accent-primary outline-subtle-1"
onClick={() => {
- captureClick({
- elementName: PRODUCT_TOUR_TRACKER_ELEMENTS.SKIP_BUTTON,
- });
onComplete();
}}
>
@@ -170,9 +162,6 @@ export const TourRoot = observer(function TourRoot(props: TOnboardingTourProps)
{
- captureClick({
- elementName: PRODUCT_TOUR_TRACKER_ELEMENTS.CREATE_PROJECT_BUTTON,
- });
onComplete();
toggleCreateProjectModal(true);
}}
diff --git a/apps/web/ce/components/pages/header/lock-control.tsx b/apps/web/ce/components/pages/header/lock-control.tsx
index dddc7e6bf3..d99f8fd9c9 100644
--- a/apps/web/ce/components/pages/header/lock-control.tsx
+++ b/apps/web/ce/components/pages/header/lock-control.tsx
@@ -2,10 +2,7 @@ import { useState, useEffect, useRef } from "react";
import { observer } from "mobx-react";
import { LockKeyhole, LockKeyholeOpen } from "lucide-react";
// plane imports
-import { PROJECT_PAGE_TRACKER_ELEMENTS } from "@plane/constants";
import { Tooltip } from "@plane/propel/tooltip";
-// helpers
-import { captureClick } from "@/helpers/event-tracker.helper";
// hooks
import { usePageOperations } from "@/hooks/use-page-operations";
// store
@@ -79,7 +76,6 @@ export const PageLockControl = observer(function PageLockControl({ page }: Props
@@ -92,7 +88,6 @@ export const PageLockControl = observer(function PageLockControl({ page }: Props
diff --git a/apps/web/ce/components/projects/create/root.tsx b/apps/web/ce/components/projects/create/root.tsx
index ddf7920b47..8a1d142e56 100644
--- a/apps/web/ce/components/projects/create/root.tsx
+++ b/apps/web/ce/components/projects/create/root.tsx
@@ -1,18 +1,16 @@
-import { PROJECT_TRACKER_EVENTS } from "@plane/constants";
-import { useTranslation } from "@plane/i18n";
-import { observer } from "mobx-react";
import { useState } from "react";
+import { observer } from "mobx-react";
import { FormProvider, useForm } from "react-hook-form";
-// ui
+// plane imports
+import { useTranslation } from "@plane/i18n";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import { EFileAssetType } from "@plane/types";
-// constants
+// components
import ProjectCommonAttributes from "@/components/project/create/common-attributes";
import ProjectCreateHeader from "@/components/project/create/header";
import ProjectCreateButtons from "@/components/project/create/project-create-buttons";
// hooks
import { getCoverImageType, uploadCoverImage } from "@/helpers/cover-image.helper";
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useProject } from "@/hooks/store/use-project";
import { usePlatformOS } from "@/hooks/use-platform-os";
// plane web types
@@ -97,12 +95,6 @@ export const CreateProjectForm = observer(function CreateProjectForm(props: TCre
await updateCoverImageStatus(res.id, coverImage);
await updateProject(workspaceSlug.toString(), res.id, { cover_image_url: coverImage });
}
- captureSuccess({
- eventName: PROJECT_TRACKER_EVENTS.create,
- payload: {
- identifier: formData.identifier,
- },
- });
setToast({
type: TOAST_TYPE.SUCCESS,
title: t("success"),
@@ -116,13 +108,6 @@ export const CreateProjectForm = observer(function CreateProjectForm(props: TCre
})
.catch((err) => {
try {
- captureError({
- eventName: PROJECT_TRACKER_EVENTS.create,
- payload: {
- identifier: formData.identifier,
- },
- });
-
// Handle the new error format where codes are nested in arrays under field names
const errorData = err?.data ?? {};
diff --git a/apps/web/ce/components/workspace/billing/comparison/plan-detail.tsx b/apps/web/ce/components/workspace/billing/comparison/plan-detail.tsx
index cdc170c446..26bb31979d 100644
--- a/apps/web/ce/components/workspace/billing/comparison/plan-detail.tsx
+++ b/apps/web/ce/components/workspace/billing/comparison/plan-detail.tsx
@@ -4,8 +4,6 @@ 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 { Button } from "@plane/propel/button";
@@ -16,7 +14,6 @@ import { getSubscriptionName } from "@plane/utils";
import { DiscountInfo } from "@/components/license/modal/card/discount-info";
import type { TPlanDetail } from "@/constants/plans";
// local imports
-import { captureSuccess } from "@/helpers/event-tracker.helper";
import { PlanFrequencyToggle } from "./frequency-toggle";
type TPlanDetailProps = {
@@ -45,12 +42,6 @@ export const PlanDetail = observer(function PlanDetail(props: TPlanDetailProps)
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");
};
@@ -103,17 +94,7 @@ export const PlanDetail = observer(function PlanDetail(props: TPlanDetailProps)
{/* Subscription button */}
-
+
{isSubscriptionActive ? `Upgrade to ${subscriptionName}` : t("common.upgrade_cta.talk_to_sales")}
diff --git a/apps/web/ce/helpers/command-palette.ts b/apps/web/ce/helpers/command-palette.ts
index d29660a168..697d12c283 100644
--- a/apps/web/ce/helpers/command-palette.ts
+++ b/apps/web/ce/helpers/command-palette.ts
@@ -1,15 +1,5 @@
-// types
-import {
- CYCLE_TRACKER_ELEMENTS,
- MODULE_TRACKER_ELEMENTS,
- PROJECT_PAGE_TRACKER_ELEMENTS,
- PROJECT_TRACKER_ELEMENTS,
- PROJECT_VIEW_TRACKER_ELEMENTS,
- WORK_ITEM_TRACKER_ELEMENTS,
-} from "@plane/constants";
import type { TCommandPaletteActionList, TCommandPaletteShortcut, TCommandPaletteShortcutList } from "@plane/types";
// store
-import { captureClick } from "@/helpers/event-tracker.helper";
import { store } from "@/lib/store-context";
export const getGlobalShortcutsList: () => TCommandPaletteActionList = () => {
@@ -21,7 +11,6 @@ export const getGlobalShortcutsList: () => TCommandPaletteActionList = () => {
description: "Create a new work item in the current project",
action: () => {
toggleCreateIssueModal(true);
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.COMMAND_PALETTE_ADD_BUTTON });
},
},
};
@@ -36,7 +25,6 @@ export const getWorkspaceShortcutsList: () => TCommandPaletteActionList = () =>
description: "Create a new project in the current workspace",
action: () => {
toggleCreateProjectModal(true);
- captureClick({ elementName: PROJECT_TRACKER_ELEMENTS.COMMAND_PALETTE_SHORTCUT_CREATE_BUTTON });
},
},
};
@@ -57,7 +45,6 @@ export const getProjectShortcutsList: () => TCommandPaletteActionList = () => {
description: "Create a new page in the current project",
action: () => {
toggleCreatePageModal({ isOpen: true });
- captureClick({ elementName: PROJECT_PAGE_TRACKER_ELEMENTS.COMMAND_PALETTE_SHORTCUT_CREATE_BUTTON });
},
},
m: {
@@ -65,7 +52,6 @@ export const getProjectShortcutsList: () => TCommandPaletteActionList = () => {
description: "Create a new module in the current project",
action: () => {
toggleCreateModuleModal(true);
- captureClick({ elementName: MODULE_TRACKER_ELEMENTS.COMMAND_PALETTE_ADD_ITEM });
},
},
q: {
@@ -73,7 +59,6 @@ export const getProjectShortcutsList: () => TCommandPaletteActionList = () => {
description: "Create a new cycle in the current project",
action: () => {
toggleCreateCycleModal(true);
- captureClick({ elementName: CYCLE_TRACKER_ELEMENTS.COMMAND_PALETTE_ADD_ITEM });
},
},
v: {
@@ -81,7 +66,6 @@ export const getProjectShortcutsList: () => TCommandPaletteActionList = () => {
description: "Create a new view in the current project",
action: () => {
toggleCreateViewModal(true);
- captureClick({ elementName: PROJECT_VIEW_TRACKER_ELEMENTS.COMMAND_PALETTE_ADD_ITEM });
},
},
backspace: {
diff --git a/apps/web/core/components/account/auth-forms/forgot-password.tsx b/apps/web/core/components/account/auth-forms/forgot-password.tsx
index 0c210530e3..10d2d82318 100644
--- a/apps/web/core/components/account/auth-forms/forgot-password.tsx
+++ b/apps/web/core/components/account/auth-forms/forgot-password.tsx
@@ -5,14 +5,11 @@ import { Controller, useForm } from "react-hook-form";
// icons
import { CircleCheck } from "lucide-react";
// plane imports
-import { AUTH_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { Button, getButtonStyling } from "@plane/propel/button";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import { Input } from "@plane/ui";
import { cn, checkEmailValidity } from "@plane/utils";
-// helpers
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import useTimer from "@/hooks/use-timer";
// services
@@ -59,12 +56,6 @@ export const ForgotPasswordForm = observer(function ForgotPasswordForm() {
email: formData.email,
})
.then(() => {
- captureSuccess({
- eventName: AUTH_TRACKER_EVENTS.forgot_password,
- payload: {
- email: formData.email,
- },
- });
setToast({
type: TOAST_TYPE.SUCCESS,
title: t("auth.forgot_password.toast.success.title"),
@@ -73,12 +64,6 @@ export const ForgotPasswordForm = observer(function ForgotPasswordForm() {
setResendCodeTimer(30);
})
.catch((err) => {
- captureError({
- eventName: AUTH_TRACKER_EVENTS.forgot_password,
- payload: {
- email: formData.email,
- },
- });
setToast({
type: TOAST_TYPE.ERROR,
title: t("auth.forgot_password.toast.error.title"),
diff --git a/apps/web/core/components/account/auth-forms/password.tsx b/apps/web/core/components/account/auth-forms/password.tsx
index b7b1cad893..e773246153 100644
--- a/apps/web/core/components/account/auth-forms/password.tsx
+++ b/apps/web/core/components/account/auth-forms/password.tsx
@@ -1,4 +1,4 @@
-import React, { useEffect, useMemo, useRef, useState } from "react";
+import { useEffect, useMemo, useRef, useState } from "react";
import { observer } from "mobx-react";
import Link from "next/link";
// icons
@@ -15,8 +15,6 @@ import { ForgotPasswordPopover } from "@/components/account/auth-forms/forgot-pa
// constants
// helpers
import { EAuthModes, EAuthSteps } from "@/helpers/authentication.helper";
-// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// services
import { AuthService } from "@/services/auth.service";
@@ -154,15 +152,6 @@ export const AuthPasswordForm = observer(function AuthPasswordForm(props: Props)
: true;
if (isPasswordValid) {
setIsSubmitting(true);
- captureSuccess({
- eventName:
- mode === EAuthModes.SIGN_IN
- ? AUTH_TRACKER_EVENTS.sign_in_with_password
- : AUTH_TRACKER_EVENTS.sign_up_with_password,
- payload: {
- email: passwordFormData.email,
- },
- });
if (formRef.current) formRef.current.submit(); // Manually submit the form if the condition is met
} else {
setBannerMessage(true);
@@ -170,15 +159,6 @@ export const AuthPasswordForm = observer(function AuthPasswordForm(props: Props)
}}
onError={() => {
setIsSubmitting(false);
- captureError({
- eventName:
- mode === EAuthModes.SIGN_IN
- ? AUTH_TRACKER_EVENTS.sign_in_with_password
- : AUTH_TRACKER_EVENTS.sign_up_with_password,
- payload: {
- email: passwordFormData.email,
- },
- });
}}
>
diff --git a/apps/web/core/components/account/auth-forms/set-password.tsx b/apps/web/core/components/account/auth-forms/set-password.tsx
index d3cfc167ce..0fa36dd876 100644
--- a/apps/web/core/components/account/auth-forms/set-password.tsx
+++ b/apps/web/core/components/account/auth-forms/set-password.tsx
@@ -5,15 +5,13 @@ import { useSearchParams } from "next/navigation";
// icons
import { Eye, EyeOff } from "lucide-react";
// plane imports
-import { AUTH_TRACKER_ELEMENTS, AUTH_TRACKER_EVENTS, E_PASSWORD_STRENGTH } from "@plane/constants";
+import { E_PASSWORD_STRENGTH } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { Button } from "@plane/propel/button";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import { Input, PasswordStrengthIndicator } from "@plane/ui";
// components
import { getPasswordStrength } from "@plane/utils";
-// helpers
-import { captureError, captureSuccess, captureView } from "@/helpers/event-tracker.helper";
// hooks
import { useUser } from "@/hooks/store/user";
import { useAppRouter } from "@/hooks/use-app-router";
@@ -60,12 +58,6 @@ export const SetPasswordForm = observer(function SetPasswordForm() {
// hooks
const { data: user, handleSetPassword } = useUser();
- useEffect(() => {
- captureView({
- elementName: AUTH_TRACKER_ELEMENTS.SET_PASSWORD_FORM,
- });
- }, []);
-
useEffect(() => {
if (csrfToken === undefined)
authService.requestCSRFToken().then((data) => data?.csrf_token && setCsrfToken(data.csrf_token));
@@ -92,9 +84,6 @@ export const SetPasswordForm = observer(function SetPasswordForm() {
e.preventDefault();
if (!csrfToken) throw new Error("csrf token not found");
await handleSetPassword(csrfToken, { password: passwordFormData.password });
- captureSuccess({
- eventName: AUTH_TRACKER_EVENTS.password_created,
- });
router.push("/");
} catch (error: unknown) {
let message = undefined;
@@ -102,9 +91,6 @@ export const SetPasswordForm = observer(function SetPasswordForm() {
const err = error as Error & { error?: string };
message = err.error;
}
- captureError({
- eventName: AUTH_TRACKER_EVENTS.password_created,
- });
setToast({
type: TOAST_TYPE.ERROR,
title: t("common.errors.default.title"),
diff --git a/apps/web/core/components/account/auth-forms/unique-code.tsx b/apps/web/core/components/account/auth-forms/unique-code.tsx
index dabe028fa9..e09fc392a0 100644
--- a/apps/web/core/components/account/auth-forms/unique-code.tsx
+++ b/apps/web/core/components/account/auth-forms/unique-code.tsx
@@ -1,6 +1,6 @@
-import React, { useEffect, useState } from "react";
+import { useEffect, useState } from "react";
import { CircleCheck, XCircle } from "lucide-react";
-import { API_BASE_URL, AUTH_TRACKER_ELEMENTS, AUTH_TRACKER_EVENTS } from "@plane/constants";
+import { API_BASE_URL } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { Button } from "@plane/propel/button";
import { Input, Spinner } from "@plane/ui";
@@ -8,7 +8,6 @@ import { Input, Spinner } from "@plane/ui";
// helpers
import { EAuthModes } from "@/helpers/authentication.helper";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import useTimer from "@/hooks/use-timer";
// services
import { AuthService } from "@/services/auth.service";
@@ -59,22 +58,10 @@ export function AuthUniqueCodeForm(props: TAuthUniqueCodeForm) {
setResendCodeTimer(defaultResetTimerValue);
handleFormChange("code", uniqueCode?.code || "");
setIsRequestingNewCode(false);
- captureSuccess({
- eventName: AUTH_TRACKER_EVENTS.new_code_requested,
- payload: {
- email: email,
- },
- });
} catch {
setResendCodeTimer(0);
console.error("Error while requesting new code");
setIsRequestingNewCode(false);
- captureError({
- eventName: AUTH_TRACKER_EVENTS.new_code_requested,
- payload: {
- email: email,
- },
- });
}
};
@@ -93,22 +80,9 @@ export function AuthUniqueCodeForm(props: TAuthUniqueCodeForm) {
action={`${API_BASE_URL}/auth/${mode === EAuthModes.SIGN_IN ? "magic-sign-in" : "magic-sign-up"}/`}
onSubmit={() => {
setIsSubmitting(true);
- captureSuccess({
- eventName: AUTH_TRACKER_EVENTS.code_verify,
- payload: {
- state: "SUCCESS",
- first_time: !isExistingEmail,
- },
- });
}}
onError={() => {
setIsSubmitting(false);
- captureError({
- eventName: AUTH_TRACKER_EVENTS.code_verify,
- payload: {
- state: "FAILED",
- },
- });
}}
>
@@ -163,7 +137,6 @@ export function AuthUniqueCodeForm(props: TAuthUniqueCodeForm) {
generateNewCode(uniqueCodeFormData.email)}
className={
isRequestNewCodeDisabled
@@ -182,14 +155,7 @@ export function AuthUniqueCodeForm(props: TAuthUniqueCodeForm) {
-
+
{isRequestingNewCode ? (
t("auth.common.unique_code.sending_code")
) : isSubmitting ? (
diff --git a/apps/web/core/components/account/deactivate-account-modal.tsx b/apps/web/core/components/account/deactivate-account-modal.tsx
index b7d1952de2..c5ba6d481a 100644
--- a/apps/web/core/components/account/deactivate-account-modal.tsx
+++ b/apps/web/core/components/account/deactivate-account-modal.tsx
@@ -1,5 +1,4 @@
import { useState } from "react";
-import { PROFILE_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
// ui
import { Button } from "@plane/propel/button";
@@ -7,7 +6,6 @@ import { TrashIcon } from "@plane/propel/icons";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import { EModalPosition, EModalWidth, ModalCore } from "@plane/ui";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useUser } from "@/hooks/store/user";
import { useAppRouter } from "@/hooks/use-app-router";
@@ -36,9 +34,6 @@ export function DeactivateAccountModal(props: Props) {
await deactivateAccount()
.then(() => {
- captureSuccess({
- eventName: PROFILE_SETTINGS_TRACKER_EVENTS.deactivate_account,
- });
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",
@@ -50,9 +45,6 @@ export function DeactivateAccountModal(props: Props) {
return;
})
.catch((err: any) => {
- captureError({
- eventName: PROFILE_SETTINGS_TRACKER_EVENTS.deactivate_account,
- });
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
diff --git a/apps/web/core/components/api-token/delete-token-modal.tsx b/apps/web/core/components/api-token/delete-token-modal.tsx
index 8989150ca6..cc42fb9a57 100644
--- a/apps/web/core/components/api-token/delete-token-modal.tsx
+++ b/apps/web/core/components/api-token/delete-token-modal.tsx
@@ -1,8 +1,6 @@
-import type { FC } from "react";
import { useState } from "react";
import { mutate } from "swr";
// types
-import { PROFILE_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import { APITokenService } from "@plane/services";
@@ -11,7 +9,6 @@ import type { IApiToken } from "@plane/types";
import { AlertModalCore } from "@plane/ui";
// fetch-keys
import { API_TOKENS_LIST } from "@/constants/fetch-keys";
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
type Props = {
isOpen: boolean;
@@ -50,32 +47,18 @@ export function DeleteApiTokenModal(props: Props) {
(prevData) => (prevData ?? []).filter((token) => token.id !== tokenId),
false
);
- captureSuccess({
- eventName: PROFILE_SETTINGS_TRACKER_EVENTS.pat_deleted,
- payload: {
- token: tokenId,
- },
- });
handleClose();
+ setDeleteLoading(false);
})
- .catch((err) =>
+ .catch((err) => {
setToast({
type: TOAST_TYPE.ERROR,
title: t("workspace_settings.settings.api_tokens.delete.error.title"),
message: err?.message ?? t("workspace_settings.settings.api_tokens.delete.error.message"),
- })
- )
- .catch((err) => {
- captureError({
- eventName: PROFILE_SETTINGS_TRACKER_EVENTS.pat_deleted,
- payload: {
- token: tokenId,
- },
- error: err as Error,
});
- })
- .finally(() => setDeleteLoading(false));
+ setDeleteLoading(false);
+ });
};
return (
diff --git a/apps/web/core/components/api-token/modal/create-token-modal.tsx b/apps/web/core/components/api-token/modal/create-token-modal.tsx
index a87b18d71e..a5f9e1a645 100644
--- a/apps/web/core/components/api-token/modal/create-token-modal.tsx
+++ b/apps/web/core/components/api-token/modal/create-token-modal.tsx
@@ -1,7 +1,6 @@
-import React, { useState } from "react";
+import { useState } from "react";
import { mutate } from "swr";
// plane imports
-import { PROFILE_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import { APITokenService } from "@plane/services";
import type { IApiToken } from "@plane/types";
@@ -9,8 +8,6 @@ import { EModalPosition, EModalWidth, ModalCore } from "@plane/ui";
import { renderFormattedDate, csvDownload } from "@plane/utils";
// constants
import { API_TOKENS_LIST } from "@/constants/fetch-keys";
-// helpers
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// local imports
import { CreateApiTokenForm } from "./form";
import { GeneratedTokenDetails } from "./generated-token-details";
@@ -66,12 +63,6 @@ export function CreateApiTokenModal(props: Props) {
},
false
);
- captureSuccess({
- eventName: PROFILE_SETTINGS_TRACKER_EVENTS.pat_created,
- payload: {
- token: res.id,
- },
- });
})
.catch((err) => {
setToast({
@@ -80,10 +71,6 @@ export function CreateApiTokenModal(props: Props) {
message: err.message || err.detail,
});
- captureError({
- eventName: PROFILE_SETTINGS_TRACKER_EVENTS.pat_created,
- });
-
throw err;
});
};
diff --git a/apps/web/core/components/automation/auto-archive-automation.tsx b/apps/web/core/components/automation/auto-archive-automation.tsx
index e27817bb3a..9d3e14afd5 100644
--- a/apps/web/core/components/automation/auto-archive-automation.tsx
+++ b/apps/web/core/components/automation/auto-archive-automation.tsx
@@ -1,24 +1,16 @@
-import React, { useMemo, useState } from "react";
+import { useMemo, useState } from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
import { ArchiveRestore } from "lucide-react";
// types
-import {
- PROJECT_AUTOMATION_MONTHS,
- EUserPermissions,
- EUserPermissionsLevel,
- PROJECT_SETTINGS_TRACKER_ELEMENTS,
- PROJECT_SETTINGS_TRACKER_EVENTS,
-} from "@plane/constants";
+import { PROJECT_AUTOMATION_MONTHS, EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import type { IProject } from "@plane/types";
// ui
import { CustomSelect, Loader, ToggleSwitch } from "@plane/ui";
// component
import { SelectMonthModal } from "@/components/automation";
-// constants
// hooks
-import { captureElementAndEvent } from "@/helpers/event-tracker.helper";
import { useProject } from "@/hooks/store/use-project";
import { useUserPermissions } from "@/hooks/store/user";
@@ -52,6 +44,14 @@ export const AutoArchiveAutomation = observer(function AutoArchiveAutomation(pro
return currentProjectDetails.archive_in !== 0;
}, [currentProjectDetails]);
+ const handleToggleArchive = async () => {
+ if (currentProjectDetails?.archive_in === 0) {
+ await handleChange({ archive_in: 1 });
+ } else {
+ await handleChange({ archive_in: 0 });
+ }
+ };
+
return (
<>
- {
- if (currentProjectDetails?.archive_in === 0) {
- await handleChange({ archive_in: 1 });
- } else {
- await handleChange({ archive_in: 0 });
- }
- captureElementAndEvent({
- element: {
- elementName: PROJECT_SETTINGS_TRACKER_ELEMENTS.AUTOMATIONS_ARCHIVE_TOGGLE_BUTTON,
- },
- event: {
- eventName: PROJECT_SETTINGS_TRACKER_EVENTS.auto_archive_workitems,
- state: "SUCCESS",
- },
- });
- }}
- size="sm"
- disabled={!isAdmin}
- />
+
{currentProjectDetails ? (
diff --git a/apps/web/core/components/automation/auto-close-automation.tsx b/apps/web/core/components/automation/auto-close-automation.tsx
index c808e064db..6b9e7a8d42 100644
--- a/apps/web/core/components/automation/auto-close-automation.tsx
+++ b/apps/web/core/components/automation/auto-close-automation.tsx
@@ -1,17 +1,10 @@
-import React, { useMemo, useState } from "react";
+import { useMemo, useState } from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// icons
import { ArchiveX } from "lucide-react";
// types
-import {
- PROJECT_AUTOMATION_MONTHS,
- EUserPermissions,
- EUserPermissionsLevel,
- EIconSize,
- PROJECT_SETTINGS_TRACKER_ELEMENTS,
- PROJECT_SETTINGS_TRACKER_EVENTS,
-} from "@plane/constants";
+import { PROJECT_AUTOMATION_MONTHS, EUserPermissions, EUserPermissionsLevel, EIconSize } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { StateGroupIcon, StatePropertyIcon } from "@plane/propel/icons";
import type { IProject } from "@plane/types";
@@ -21,7 +14,6 @@ import { CustomSelect, CustomSearchSelect, ToggleSwitch, Loader } from "@plane/u
import { SelectMonthModal } from "@/components/automation";
// constants
// hooks
-import { captureElementAndEvent } from "@/helpers/event-tracker.helper";
import { useProject } from "@/hooks/store/use-project";
import { useProjectState } from "@/hooks/store/use-project-state";
import { useUserPermissions } from "@/hooks/store/user";
@@ -111,15 +103,6 @@ export const AutoCloseAutomation = observer(function AutoCloseAutomation(props:
} else {
await handleChange({ close_in: 0, default_state: null });
}
- captureElementAndEvent({
- element: {
- elementName: PROJECT_SETTINGS_TRACKER_ELEMENTS.AUTOMATIONS_CLOSE_TOGGLE_BUTTON,
- },
- event: {
- eventName: PROJECT_SETTINGS_TRACKER_EVENTS.auto_close_workitems,
- state: "SUCCESS",
- },
- });
}}
size="sm"
disabled={!isAdmin}
diff --git a/apps/web/core/components/cycles/analytics-sidebar/sidebar-header.tsx b/apps/web/core/components/cycles/analytics-sidebar/sidebar-header.tsx
index f89f7b9750..f30f26ea06 100644
--- a/apps/web/core/components/cycles/analytics-sidebar/sidebar-header.tsx
+++ b/apps/web/core/components/cycles/analytics-sidebar/sidebar-header.tsx
@@ -1,16 +1,9 @@
-import type { FC } from "react";
-import React, { useEffect } from "react";
+import { useEffect } from "react";
import { observer } from "mobx-react";
import { Controller, useForm } from "react-hook-form";
import { ArrowRight } from "lucide-react";
// Plane Imports
-import {
- CYCLE_TRACKER_EVENTS,
- CYCLE_STATUS,
- EUserPermissions,
- EUserPermissionsLevel,
- CYCLE_TRACKER_ELEMENTS,
-} from "@plane/constants";
+import { CYCLE_STATUS, EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { ChevronRightIcon } from "@plane/propel/icons";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
@@ -19,7 +12,6 @@ import { getDate, renderFormattedPayloadDate } from "@plane/utils";
// components
import { DateRangeDropdown } from "@/components/dropdowns/date-range";
// hooks
-import { captureElementAndEvent } from "@/helpers/event-tracker.helper";
import { useCycle } from "@/hooks/store/use-cycle";
import { useUserPermissions } from "@/hooks/store/user";
import { useTimeZoneConverter } from "@/hooks/use-timezone-converter";
@@ -64,37 +56,7 @@ export const CycleSidebarHeader = observer(function CycleSidebarHeader(props: Pr
const submitChanges = async (data: Partial) => {
if (!workspaceSlug || !projectId || !cycleDetails.id) return;
-
- await updateCycleDetails(workspaceSlug.toString(), projectId.toString(), cycleDetails.id.toString(), data)
- .then(() => {
- captureElementAndEvent({
- element: {
- elementName: CYCLE_TRACKER_ELEMENTS.RIGHT_SIDEBAR,
- },
- event: {
- eventName: CYCLE_TRACKER_EVENTS.update,
- state: "SUCCESS",
- payload: {
- id: cycleDetails.id,
- },
- },
- });
- })
-
- .catch(() => {
- captureElementAndEvent({
- element: {
- elementName: CYCLE_TRACKER_ELEMENTS.RIGHT_SIDEBAR,
- },
- event: {
- eventName: CYCLE_TRACKER_EVENTS.update,
- state: "ERROR",
- payload: {
- id: cycleDetails.id,
- },
- },
- });
- });
+ await updateCycleDetails(workspaceSlug.toString(), projectId.toString(), cycleDetails.id.toString(), data);
};
useEffect(() => {
diff --git a/apps/web/core/components/cycles/archived-cycles/modal.tsx b/apps/web/core/components/cycles/archived-cycles/modal.tsx
index 5d7b35560a..a686e580af 100644
--- a/apps/web/core/components/cycles/archived-cycles/modal.tsx
+++ b/apps/web/core/components/cycles/archived-cycles/modal.tsx
@@ -1,11 +1,9 @@
import { useState } from "react";
// ui
-import { CYCLE_TRACKER_EVENTS } from "@plane/constants";
import { Button } from "@plane/propel/button";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import { EModalPosition, EModalWidth, ModalCore } from "@plane/ui";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useCycle } from "@/hooks/store/use-cycle";
import { useAppRouter } from "@/hooks/use-app-router";
@@ -43,12 +41,6 @@ export function ArchiveCycleModal(props: Props) {
title: "Archive success",
message: "Your archives can be found in project archives.",
});
- captureSuccess({
- eventName: CYCLE_TRACKER_EVENTS.archive,
- payload: {
- id: cycleId,
- },
- });
onClose();
router.push(`/${workspaceSlug}/projects/${projectId}/cycles`);
return;
@@ -59,12 +51,6 @@ export function ArchiveCycleModal(props: Props) {
title: "Error!",
message: "Cycle could not be archived. Please try again.",
});
- captureError({
- eventName: CYCLE_TRACKER_EVENTS.archive,
- payload: {
- id: cycleId,
- },
- });
})
.finally(() => setIsArchiving(false));
};
diff --git a/apps/web/core/components/cycles/delete-modal.tsx b/apps/web/core/components/cycles/delete-modal.tsx
index ea485f9810..d491ffe90b 100644
--- a/apps/web/core/components/cycles/delete-modal.tsx
+++ b/apps/web/core/components/cycles/delete-modal.tsx
@@ -2,14 +2,12 @@ import { useState } from "react";
import { observer } from "mobx-react";
import { useParams, useSearchParams } from "next/navigation";
// types
-import { PROJECT_ERROR_MESSAGES, CYCLE_TRACKER_EVENTS } from "@plane/constants";
+import { PROJECT_ERROR_MESSAGES } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { ICycle } from "@plane/types";
// ui
import { AlertModalCore } from "@plane/ui";
-// helpers
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useCycle } from "@/hooks/store/use-cycle";
import { useAppRouter } from "@/hooks/use-app-router";
@@ -48,12 +46,6 @@ export const CycleDeleteModal = observer(function CycleDeleteModal(props: ICycle
title: "Success!",
message: "Cycle deleted successfully.",
});
- captureSuccess({
- eventName: CYCLE_TRACKER_EVENTS.delete,
- payload: {
- id: cycle.id,
- },
- });
})
.catch((errors) => {
const isPermissionError = errors?.error === "You don't have the required permissions.";
@@ -65,13 +57,6 @@ export const CycleDeleteModal = observer(function CycleDeleteModal(props: ICycle
type: TOAST_TYPE.ERROR,
message: currentError.i18n_message && t(currentError.i18n_message),
});
- captureError({
- eventName: CYCLE_TRACKER_EVENTS.delete,
- payload: {
- id: cycle.id,
- },
- error: errors,
- });
})
.finally(() => handleClose());
} catch {
diff --git a/apps/web/core/components/cycles/list/cycle-list-item-action.tsx b/apps/web/core/components/cycles/list/cycle-list-item-action.tsx
index c0021d362f..e918dd53f6 100644
--- a/apps/web/core/components/cycles/list/cycle-list-item-action.tsx
+++ b/apps/web/core/components/cycles/list/cycle-list-item-action.tsx
@@ -1,17 +1,11 @@
-import type { FC, MouseEvent } from "react";
+import type { MouseEvent } from "react";
import React, { useEffect, useMemo, useState } from "react";
import { observer } from "mobx-react";
import { useParams, usePathname, useSearchParams } from "next/navigation";
import { useForm } from "react-hook-form";
import { Eye, ArrowRight, CalendarDays } from "lucide-react";
// plane imports
-import {
- CYCLE_TRACKER_EVENTS,
- EUserPermissions,
- EUserPermissionsLevel,
- IS_FAVORITE_MENU_OPEN,
- CYCLE_TRACKER_ELEMENTS,
-} from "@plane/constants";
+import { EUserPermissions, EUserPermissionsLevel, IS_FAVORITE_MENU_OPEN } from "@plane/constants";
import { useLocalStorage } from "@plane/hooks";
import { useTranslation } from "@plane/i18n";
import { TransferIcon, WorkItemsIcon, MembersPropertyIcon } from "@plane/propel/icons";
@@ -25,7 +19,6 @@ import { DateRangeDropdown } from "@/components/dropdowns/date-range";
import { ButtonAvatars } from "@/components/dropdowns/member/avatar";
import { MergedDateDisplay } from "@/components/dropdowns/merged-date";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useCycle } from "@/hooks/store/use-cycle";
import { useMember } from "@/hooks/store/use-member";
import { useUserPermissions } from "@/hooks/store/user";
@@ -109,25 +102,11 @@ export const CycleListItemAction = observer(function CycleListItemAction(props:
e.preventDefault();
if (!workspaceSlug || !projectId) return;
- const addToFavoritePromise = addCycleToFavorites(workspaceSlug?.toString(), projectId.toString(), cycleId)
- .then(() => {
+ const addToFavoritePromise = addCycleToFavorites(workspaceSlug?.toString(), projectId.toString(), cycleId).then(
+ () => {
if (!isFavoriteMenuOpen) toggleFavoriteMenu(true);
- captureSuccess({
- eventName: CYCLE_TRACKER_EVENTS.favorite,
- payload: {
- id: cycleId,
- },
- });
- })
- .catch((error) => {
- captureError({
- eventName: CYCLE_TRACKER_EVENTS.favorite,
- payload: {
- id: cycleId,
- },
- error,
- });
- });
+ }
+ );
setPromiseToast(addToFavoritePromise, {
loading: t("project_cycles.action.favorite.loading"),
@@ -146,24 +125,11 @@ export const CycleListItemAction = observer(function CycleListItemAction(props:
e.preventDefault();
if (!workspaceSlug || !projectId) return;
- const removeFromFavoritePromise = removeCycleFromFavorites(workspaceSlug?.toString(), projectId.toString(), cycleId)
- .then(() => {
- captureSuccess({
- eventName: CYCLE_TRACKER_EVENTS.unfavorite,
- payload: {
- id: cycleId,
- },
- });
- })
- .catch((error) => {
- captureError({
- eventName: CYCLE_TRACKER_EVENTS.unfavorite,
- payload: {
- id: cycleId,
- },
- error,
- });
- });
+ const removeFromFavoritePromise = removeCycleFromFavorites(
+ workspaceSlug?.toString(),
+ projectId.toString(),
+ cycleId
+ );
setPromiseToast(removeFromFavoritePromise, {
loading: t("project_cycles.action.unfavorite.loading"),
@@ -319,7 +285,6 @@ export const CycleListItemAction = observer(function CycleListItemAction(props:
)}
{isEditingAllowed && !cycleDetails.archived_at && (
{
e.preventDefault();
e.stopPropagation();
diff --git a/apps/web/core/components/cycles/modal.tsx b/apps/web/core/components/cycles/modal.tsx
index 3aeb9e5925..bc068ddd70 100644
--- a/apps/web/core/components/cycles/modal.tsx
+++ b/apps/web/core/components/cycles/modal.tsx
@@ -1,14 +1,12 @@
-import React, { useEffect, useState } from "react";
+import { useEffect, useState } from "react";
import { mutate } from "swr";
// types
-import { CYCLE_TRACKER_EVENTS } from "@plane/constants";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { CycleDateCheckData, ICycle, TCycleTabOptions } from "@plane/types";
// ui
import { EModalPosition, EModalWidth, ModalCore } from "@plane/ui";
// hooks
import { renderFormattedPayloadDate } from "@plane/utils";
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useCycle } from "@/hooks/store/use-cycle";
import { useProject } from "@/hooks/store/use-project";
import useKeypress from "@/hooks/use-keypress";
@@ -62,12 +60,6 @@ export function CycleCreateUpdateModal(props: CycleModalProps) {
title: "Success!",
message: "Cycle created successfully.",
});
- captureSuccess({
- eventName: CYCLE_TRACKER_EVENTS.create,
- payload: {
- id: res.id,
- },
- });
})
.catch((err) => {
setToast({
@@ -75,10 +67,6 @@ export function CycleCreateUpdateModal(props: CycleModalProps) {
title: "Error!",
message: err?.detail ?? "Error in creating cycle. Please try again.",
});
- captureError({
- eventName: CYCLE_TRACKER_EVENTS.create,
- error: err,
- });
});
};
@@ -88,12 +76,6 @@ export function CycleCreateUpdateModal(props: CycleModalProps) {
const selectedProjectId = payload.project_id ?? projectId.toString();
await updateCycleDetails(workspaceSlug, selectedProjectId, cycleId, payload)
.then((res) => {
- captureSuccess({
- eventName: CYCLE_TRACKER_EVENTS.update,
- payload: {
- id: res.id,
- },
- });
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",
@@ -106,10 +88,6 @@ export function CycleCreateUpdateModal(props: CycleModalProps) {
title: "Error!",
message: err?.detail ?? "Error in updating cycle. Please try again.",
});
- captureError({
- eventName: CYCLE_TRACKER_EVENTS.update,
- error: err,
- });
});
};
diff --git a/apps/web/core/components/cycles/quick-actions.tsx b/apps/web/core/components/cycles/quick-actions.tsx
index d0e5c74c70..4254a0f315 100644
--- a/apps/web/core/components/cycles/quick-actions.tsx
+++ b/apps/web/core/components/cycles/quick-actions.tsx
@@ -1,24 +1,16 @@
import { useState } from "react";
import { observer } from "mobx-react";
import { MoreHorizontal } from "lucide-react";
-
// ui
-import {
- CYCLE_TRACKER_EVENTS,
- EUserPermissions,
- EUserPermissionsLevel,
- CYCLE_TRACKER_ELEMENTS,
-} from "@plane/constants";
+import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { IconButton } from "@plane/propel/icon-button";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { TContextMenuItem } from "@plane/ui";
import { ContextMenu, CustomMenu } from "@plane/ui";
import { copyUrlToClipboard, cn } from "@plane/utils";
-// helpers
// hooks
import { useCycleMenuItems } from "@/components/common/quick-actions-helper";
-import { captureClick, captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useCycle } from "@/hooks/store/use-cycle";
import { useUserPermissions } from "@/hooks/store/user";
import { useAppRouter } from "@/hooks/use-app-router";
@@ -76,12 +68,6 @@ export const CycleQuickActions = observer(function CycleQuickActions(props: Prop
title: t("project_cycles.action.restore.success.title"),
message: t("project_cycles.action.restore.success.description"),
});
- captureSuccess({
- eventName: CYCLE_TRACKER_EVENTS.restore,
- payload: {
- id: cycleId,
- },
- });
router.push(`/${workspaceSlug}/projects/${projectId}/archives/cycles`);
})
.catch(() => {
@@ -90,12 +76,6 @@ export const CycleQuickActions = observer(function CycleQuickActions(props: Prop
title: t("project_cycles.action.restore.failed.title"),
message: t("project_cycles.action.restore.failed.description"),
});
- captureError({
- eventName: CYCLE_TRACKER_EVENTS.restore,
- payload: {
- id: cycleId,
- },
- });
});
const menuResult = useCycleMenuItems({
@@ -118,11 +98,7 @@ export const CycleQuickActions = observer(function CycleQuickActions(props: Prop
const CONTEXT_MENU_ITEMS = MENU_ITEMS.map(function CONTEXT_MENU_ITEMS(item) {
return {
...item,
-
action: () => {
- captureClick({
- elementName: CYCLE_TRACKER_ELEMENTS.CONTEXT_MENU,
- });
item.action();
},
};
@@ -170,9 +146,6 @@ export const CycleQuickActions = observer(function CycleQuickActions(props: Prop
{
- captureClick({
- elementName: CYCLE_TRACKER_ELEMENTS.QUICK_ACTIONS,
- });
item.action();
}}
className={cn(
diff --git a/apps/web/core/components/estimates/delete/modal.tsx b/apps/web/core/components/estimates/delete/modal.tsx
index e348495bf6..f583bec023 100644
--- a/apps/web/core/components/estimates/delete/modal.tsx
+++ b/apps/web/core/components/estimates/delete/modal.tsx
@@ -1,13 +1,10 @@
-import type { FC } from "react";
import { useState } from "react";
import { observer } from "mobx-react";
// ui
-import { PROJECT_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
import { Button } from "@plane/propel/button";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import { EModalPosition, EModalWidth, ModalCore } from "@plane/ui";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useProjectEstimates } from "@/hooks/store/estimates";
import { useEstimate } from "@/hooks/store/estimates/use-estimate";
import { useProject } from "@/hooks/store/use-project";
@@ -34,18 +31,11 @@ export const DeleteEstimateModal = observer(function DeleteEstimateModal(props:
try {
if (!workspaceSlug || !projectId || !estimateId) return;
setButtonLoader(true);
-
await deleteEstimate(workspaceSlug, projectId, estimateId);
if (areEstimateEnabledByProjectId(projectId)) {
await updateProject(workspaceSlug, projectId, { estimate: null });
}
setButtonLoader(false);
- captureSuccess({
- eventName: PROJECT_SETTINGS_TRACKER_EVENTS.estimate_deleted,
- payload: {
- id: estimateId,
- },
- });
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Estimate deleted",
@@ -54,12 +44,6 @@ export const DeleteEstimateModal = observer(function DeleteEstimateModal(props:
handleClose();
} catch (error) {
setButtonLoader(false);
- captureError({
- eventName: PROJECT_SETTINGS_TRACKER_EVENTS.estimate_deleted,
- payload: {
- id: estimateId,
- },
- });
setToast({
type: TOAST_TYPE.ERROR,
title: "Estimate creation failed",
diff --git a/apps/web/core/components/estimates/empty-screen.tsx b/apps/web/core/components/estimates/empty-screen.tsx
index b7f4764a8e..28c69729a1 100644
--- a/apps/web/core/components/estimates/empty-screen.tsx
+++ b/apps/web/core/components/estimates/empty-screen.tsx
@@ -1,12 +1,8 @@
-import type { FC } from "react";
import { useTheme } from "next-themes";
-import { PROJECT_SETTINGS_TRACKER_ELEMENTS, PROJECT_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
// plane imports
import { useTranslation } from "@plane/i18n";
// components
import { DetailedEmptyState } from "@/components/empty-state/detailed-empty-state-root";
-// helpers
-import { captureElementAndEvent } from "@/helpers/event-tracker.helper";
type TEstimateEmptyScreen = {
onButtonClick: () => void;
@@ -30,15 +26,6 @@ export function EstimateEmptyScreen(props: TEstimateEmptyScreen) {
text: t("project_settings.empty_state.estimates.primary_button"),
onClick: () => {
onButtonClick();
- captureElementAndEvent({
- element: {
- elementName: PROJECT_SETTINGS_TRACKER_ELEMENTS.ESTIMATES_EMPTY_STATE_CREATE_BUTTON,
- },
- event: {
- eventName: PROJECT_SETTINGS_TRACKER_EVENTS.estimate_created,
- state: "SUCCESS",
- },
- });
},
}}
/>
diff --git a/apps/web/core/components/estimates/estimate-disable-switch.tsx b/apps/web/core/components/estimates/estimate-disable-switch.tsx
index 705ecfcb4f..4378ce2abb 100644
--- a/apps/web/core/components/estimates/estimate-disable-switch.tsx
+++ b/apps/web/core/components/estimates/estimate-disable-switch.tsx
@@ -1,11 +1,8 @@
-import type { FC } from "react";
import { observer } from "mobx-react";
-import { PROJECT_SETTINGS_TRACKER_ELEMENTS, PROJECT_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import { ToggleSwitch } from "@plane/ui";
// hooks
-import { captureElementAndEvent } from "@/helpers/event-tracker.helper";
import { useProjectEstimates } from "@/hooks/store/estimates";
import { useProject } from "@/hooks/store/use-project";
// i18n
@@ -32,15 +29,6 @@ export const EstimateDisableSwitch = observer(function EstimateDisableSwitch(pro
await updateProject(workspaceSlug, projectId, {
estimate: currentProjectActiveEstimate ? null : currentActiveEstimateId,
});
- captureElementAndEvent({
- element: {
- elementName: PROJECT_SETTINGS_TRACKER_ELEMENTS.ESTIMATES_TOGGLE_BUTTON,
- },
- event: {
- eventName: PROJECT_SETTINGS_TRACKER_EVENTS.estimates_toggle,
- state: "SUCCESS",
- },
- });
setToast({
type: TOAST_TYPE.SUCCESS,
title: currentProjectActiveEstimate
@@ -51,15 +39,6 @@ export const EstimateDisableSwitch = observer(function EstimateDisableSwitch(pro
: t("project_settings.estimates.toasts.enabled.success.message"),
});
} catch (err) {
- captureElementAndEvent({
- element: {
- elementName: PROJECT_SETTINGS_TRACKER_ELEMENTS.ESTIMATES_TOGGLE_BUTTON,
- },
- event: {
- eventName: PROJECT_SETTINGS_TRACKER_EVENTS.estimates_toggle,
- state: "ERROR",
- },
- });
setToast({
type: TOAST_TYPE.ERROR,
title: t("project_settings.estimates.toasts.disabled.error.title"),
diff --git a/apps/web/core/components/exporter/export-form.tsx b/apps/web/core/components/exporter/export-form.tsx
index 74f947316a..c56e462b50 100644
--- a/apps/web/core/components/exporter/export-form.tsx
+++ b/apps/web/core/components/exporter/export-form.tsx
@@ -8,8 +8,6 @@ import {
EUserPermissionsLevel,
EXPORTERS_LIST,
// ISSUE_DISPLAY_FILTERS_BY_PAGE,
- WORKSPACE_SETTINGS_TRACKER_EVENTS,
- WORKSPACE_SETTINGS_TRACKER_ELEMENTS,
} from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { Button } from "@plane/propel/button";
@@ -20,7 +18,6 @@ import type { TWorkItemFilterExpression } from "@plane/types";
import { CustomSearchSelect, CustomSelect } from "@plane/ui";
// import { WorkspaceLevelWorkItemFiltersHOC } from "@/components/work-item-filters/filters-hoc/workspace-level";
// import { WorkItemFiltersRow } from "@/components/work-item-filters/filters-row";
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useProject } from "@/hooks/store/use-project";
import { useUser, useUserPermissions } from "@/hooks/store/user";
import { ProjectExportService } from "@/services/project/project-export.service";
@@ -105,12 +102,6 @@ export const ExportForm = observer(function ExportForm(props: Props) {
await projectExportService.csvExport(workspaceSlug, payload);
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"),
@@ -127,13 +118,6 @@ export const ExportForm = observer(function ExportForm(props: Props) {
});
} 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"),
@@ -258,12 +242,7 @@ export const ExportForm = observer(function ExportForm(props: Props) {
/>
*/}
-
+
{exportLoading ? `${t("workspace_settings.settings.exports.exporting")}...` : t("export")}
diff --git a/apps/web/core/components/global/product-updates/modal.tsx b/apps/web/core/components/global/product-updates/modal.tsx
index 87ac429c2e..ef3f7540da 100644
--- a/apps/web/core/components/global/product-updates/modal.tsx
+++ b/apps/web/core/components/global/product-updates/modal.tsx
@@ -1,12 +1,8 @@
-import { useEffect } from "react";
import { observer } from "mobx-react";
-import { USER_TRACKER_ELEMENTS } from "@plane/constants";
// ui
import { EModalPosition, EModalWidth, ModalCore } from "@plane/ui";
// components
import { ProductUpdatesFooter } from "@/components/global";
-// helpers
-import { captureView } from "@/helpers/event-tracker.helper";
// plane web components
import { ProductUpdatesChangelog } from "@/plane-web/components/global/product-updates/changelog";
import { ProductUpdatesHeader } from "@/plane-web/components/global/product-updates/header";
@@ -19,12 +15,6 @@ export type ProductUpdatesModalProps = {
export const ProductUpdatesModal = observer(function ProductUpdatesModal(props: ProductUpdatesModalProps) {
const { isOpen, handleClose } = props;
- useEffect(() => {
- if (isOpen) {
- captureView({ elementName: USER_TRACKER_ELEMENTS.PRODUCT_CHANGELOG_MODAL });
- }
- }, [isOpen]);
-
return (
diff --git a/apps/web/core/components/home/root.tsx b/apps/web/core/components/home/root.tsx
index 2712c3ac8c..8735e8812b 100644
--- a/apps/web/core/components/home/root.tsx
+++ b/apps/web/core/components/home/root.tsx
@@ -2,10 +2,7 @@ import { observer } from "mobx-react";
import { useParams } from "next/navigation";
import useSWR from "swr";
// plane imports
-import { PRODUCT_TOUR_TRACKER_EVENTS } from "@plane/constants";
import { ContentWrapper } from "@plane/ui";
-// helpers
-import { captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useHome } from "@/hooks/store/use-home";
import { useUserProfile, useUser } from "@/hooks/store/user";
@@ -33,19 +30,12 @@ export const WorkspaceHomeView = observer(function WorkspaceHomeView() {
}
);
- const handleTourCompleted = () => {
- updateTourCompleted()
- .then(() => {
- captureSuccess({
- eventName: PRODUCT_TOUR_TRACKER_EVENTS.complete,
- payload: {
- user_id: currentUser?.id,
- },
- });
- })
- .catch((error) => {
- console.error(error);
- });
+ const handleTourCompleted = async () => {
+ try {
+ await updateTourCompleted();
+ } catch (error) {
+ console.error("Error updating tour completed", error);
+ }
};
// TODO: refactor loader implementation
diff --git a/apps/web/core/components/home/widgets/empty-states/no-projects.tsx b/apps/web/core/components/home/widgets/empty-states/no-projects.tsx
index 7d0d7dca9c..fe4384cb7e 100644
--- a/apps/web/core/components/home/widgets/empty-states/no-projects.tsx
+++ b/apps/web/core/components/home/widgets/empty-states/no-projects.tsx
@@ -5,14 +5,12 @@ import Link from "next/link";
import { useParams } from "next/navigation";
import { Hotel } from "lucide-react";
// plane ui
-import { EUserPermissions, EUserPermissionsLevel, PROJECT_TRACKER_ELEMENTS } from "@plane/constants";
+import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { useLocalStorage } from "@plane/hooks";
import { useTranslation } from "@plane/i18n";
import { MembersPropertyIcon, CheckIcon, ProjectIcon, CloseIcon } from "@plane/propel/icons";
import { cn, getFileURL } from "@plane/utils";
-// helpers
// hooks
-import { captureClick } from "@/helpers/event-tracker.helper";
import { useCommandPalette } from "@/hooks/store/use-command-palette";
import { useProject } from "@/hooks/store/use-project";
import { useWorkspace } from "@/hooks/store/use-workspace";
@@ -57,7 +55,6 @@ export const NoProjectsEmptyState = observer(function NoProjectsEmptyState() {
e.preventDefault();
e.stopPropagation();
toggleCreateProjectModal(true);
- captureClick({ elementName: PROJECT_TRACKER_ELEMENTS.EMPTY_STATE_CREATE_PROJECT_BUTTON });
},
disabled: !canCreateProject,
},
diff --git a/apps/web/core/components/inbox/content/issue-root.tsx b/apps/web/core/components/inbox/content/issue-root.tsx
index 3c7b3c75dc..c09dc192f2 100644
--- a/apps/web/core/components/inbox/content/issue-root.tsx
+++ b/apps/web/core/components/inbox/content/issue-root.tsx
@@ -2,7 +2,6 @@ import type { Dispatch, SetStateAction } from "react";
import { useEffect, useMemo, useRef } from "react";
import { observer } from "mobx-react";
// plane imports
-import { WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
import type { EditorRefApi } from "@plane/editor";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { TIssue, TNameDescriptionLoader } from "@plane/types";
@@ -17,8 +16,6 @@ import type { TIssueOperations } from "@/components/issues/issue-detail";
import { IssueActivity } from "@/components/issues/issue-detail/issue-activity";
import { IssueReaction } from "@/components/issues/issue-detail/reactions";
import { IssueTitleInput } from "@/components/issues/title-input";
-// helpers
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useIssueDetail } from "@/hooks/store/use-issue-detail";
import { useMember } from "@/hooks/store/use-member";
@@ -102,10 +99,6 @@ export const InboxIssueMainContent = observer(function InboxIssueMainContent(pro
type: TOAST_TYPE.SUCCESS,
message: "Work item deleted successfully",
});
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.delete,
- payload: { id: _issueId },
- });
} catch (error) {
console.log("Error in deleting work item:", error);
setToast({
@@ -113,47 +106,24 @@ export const InboxIssueMainContent = observer(function InboxIssueMainContent(pro
type: TOAST_TYPE.ERROR,
message: "Work item delete failed",
});
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.delete,
- payload: { id: _issueId },
- error: error as Error,
- });
}
},
update: async (_workspaceSlug: string, _projectId: string, _issueId: string, data: Partial) => {
try {
await inboxIssue.updateIssue(data);
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: _issueId },
- });
} catch (error) {
setToast({
title: "Work item update failed",
type: TOAST_TYPE.ERROR,
message: "Work item update failed",
});
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: _issueId },
- error: error as Error,
- });
}
},
archive: async (workspaceSlug: string, projectId: string, issueId: string) => {
try {
await archiveIssue(workspaceSlug, projectId, issueId);
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.archive,
- payload: { id: issueId },
- });
} catch (error) {
console.error("Error in archiving issue:", error);
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.archive,
- payload: { id: issueId },
- error: error as Error,
- });
}
},
}),
diff --git a/apps/web/core/components/inbox/modals/create-modal/create-root.tsx b/apps/web/core/components/inbox/modals/create-modal/create-root.tsx
index d07606b4ea..059a4d2f78 100644
--- a/apps/web/core/components/inbox/modals/create-modal/create-root.tsx
+++ b/apps/web/core/components/inbox/modals/create-modal/create-root.tsx
@@ -1,8 +1,8 @@
-import type { FC, FormEvent } from "react";
+import type { FormEvent } from "react";
import { useCallback, useEffect, useRef, useState } from "react";
import { observer } from "mobx-react";
// plane imports
-import { ETabIndices, WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
+import { ETabIndices } from "@plane/constants";
import type { EditorRefApi } from "@plane/editor";
import { useTranslation } from "@plane/i18n";
import { Button } from "@plane/propel/button";
@@ -10,8 +10,6 @@ import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { TIssue } from "@plane/types";
import { ToggleSwitch } from "@plane/ui";
import { renderFormattedPayloadDate, getTabIndex } from "@plane/utils";
-// helpers
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useProject } from "@/hooks/store/use-project";
import { useProjectInbox } from "@/hooks/store/use-project-inbox";
@@ -170,12 +168,6 @@ export const InboxIssueCreateRoot = observer(function InboxIssueCreateRoot(props
descriptionEditorRef?.current?.clearEditor();
setFormData(defaultIssueData);
}
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.create,
- payload: {
- id: res?.issue?.id,
- },
- });
setToast({
type: TOAST_TYPE.SUCCESS,
title: `Success!`,
@@ -184,13 +176,6 @@ export const InboxIssueCreateRoot = observer(function InboxIssueCreateRoot(props
})
.catch((error) => {
console.error(error);
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.create,
- payload: {
- id: formData?.id,
- },
- error: error as Error,
- });
setToast({
type: TOAST_TYPE.ERROR,
title: `Error!`,
diff --git a/apps/web/core/components/integration/jira/give-details.tsx b/apps/web/core/components/integration/jira/give-details.tsx
index 969462a6cf..65601beecc 100644
--- a/apps/web/core/components/integration/jira/give-details.tsx
+++ b/apps/web/core/components/integration/jira/give-details.tsx
@@ -1,9 +1,6 @@
-import React from "react";
import { observer } from "mobx-react";
import Link from "next/link";
import { useFormContext, Controller } from "react-hook-form";
-
-import { PROJECT_TRACKER_ELEMENTS } from "@plane/constants";
import { PlusIcon } from "@plane/propel/icons";
import type { IJiraImporterForm } from "@plane/types";
// hooks
@@ -11,7 +8,6 @@ import type { IJiraImporterForm } from "@plane/types";
import { CustomSelect, Input } from "@plane/ui";
// helpers
import { checkEmailValidity } from "@plane/utils";
-import { captureClick } from "@/helpers/event-tracker.helper";
import { useCommandPalette } from "@/hooks/store/use-command-palette";
import { useProject } from "@/hooks/store/use-project";
// types
@@ -199,9 +195,7 @@ export const JiraGetImportDetail = observer(function JiraGetImportDetail() {
{
- captureClick({ elementName: PROJECT_TRACKER_ELEMENTS.CREATE_PROJECT_JIRA_IMPORT_DETAIL_PAGE });
toggleCreateProjectModal(true);
}}
className="flex cursor-pointer select-none items-center space-x-2 truncate rounded-sm px-1 py-1.5 text-secondary"
diff --git a/apps/web/core/components/issues/issue-detail-widgets/attachments/helper.tsx b/apps/web/core/components/issues/issue-detail-widgets/attachments/helper.tsx
index a08133c819..0ca891f17a 100644
--- a/apps/web/core/components/issues/issue-detail-widgets/attachments/helper.tsx
+++ b/apps/web/core/components/issues/issue-detail-widgets/attachments/helper.tsx
@@ -1,10 +1,8 @@
import { useMemo } from "react";
-import { WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
import { setPromiseToast, TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { TIssueServiceType } from "@plane/types";
import { EIssueServiceType } from "@plane/types";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useIssueDetail } from "@/hooks/store/use-issue-detail";
// types
import type { TAttachmentUploadStatus } from "@/store/issue/issue-details/attachment.store";
@@ -36,34 +34,21 @@ export const useAttachmentOperations = (
const attachmentOperations: TAttachmentOperations = useMemo(
() => ({
create: async (file) => {
- try {
- if (!workspaceSlug || !projectId || !issueId) throw new Error("Missing required fields");
- const attachmentUploadPromise = createAttachment(workspaceSlug, projectId, issueId, file);
- setPromiseToast(attachmentUploadPromise, {
- loading: "Uploading attachment...",
- success: {
- title: "Attachment uploaded",
- message: () => "The attachment has been successfully uploaded",
- },
- error: {
- title: "Attachment not uploaded",
- message: () => "The attachment could not be uploaded",
- },
- });
+ if (!workspaceSlug || !projectId || !issueId) throw new Error("Missing required fields");
+ const attachmentUploadPromise = createAttachment(workspaceSlug, projectId, issueId, file);
+ setPromiseToast(attachmentUploadPromise, {
+ loading: "Uploading attachment...",
+ success: {
+ title: "Attachment uploaded",
+ message: () => "The attachment has been successfully uploaded",
+ },
+ error: {
+ title: "Attachment not uploaded",
+ message: () => "The attachment could not be uploaded",
+ },
+ });
- await attachmentUploadPromise;
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.attachment.add,
- payload: { id: issueId },
- });
- } catch (error) {
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.attachment.add,
- payload: { id: issueId },
- error: error as Error,
- });
- throw error;
- }
+ await attachmentUploadPromise;
},
remove: async (attachmentId) => {
try {
@@ -74,16 +59,7 @@ export const useAttachmentOperations = (
type: TOAST_TYPE.SUCCESS,
title: "Attachment removed",
});
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.attachment.remove,
- payload: { id: issueId },
- });
- } catch (error) {
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.attachment.remove,
- payload: { id: issueId },
- error: error as Error,
- });
+ } catch (_error) {
setToast({
message: "The Attachment could not be removed",
type: TOAST_TYPE.ERROR,
diff --git a/apps/web/core/components/issues/issue-detail-widgets/relations/helper.tsx b/apps/web/core/components/issues/issue-detail-widgets/relations/helper.tsx
index 520a44b418..1666613330 100644
--- a/apps/web/core/components/issues/issue-detail-widgets/relations/helper.tsx
+++ b/apps/web/core/components/issues/issue-detail-widgets/relations/helper.tsx
@@ -1,13 +1,11 @@
import { useMemo } from "react";
// plane imports
-import { WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { TIssue, TIssueServiceType } from "@plane/types";
import { EIssueServiceType } from "@plane/types";
import { copyUrlToClipboard } from "@plane/utils";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useIssueDetail } from "@/hooks/store/use-issue-detail";
export type TRelationIssueOperations = {
@@ -26,33 +24,23 @@ export const useRelationOperations = (
const issueOperations: TRelationIssueOperations = useMemo(
() => ({
- copyLink: (path) => {
- copyUrlToClipboard(path).then(() => {
- setToast({
- type: TOAST_TYPE.SUCCESS,
- title: t("common.link_copied"),
- message: t("entity.link_copied_to_clipboard", { entity: entityName }),
- });
+ copyLink: async (path) => {
+ await copyUrlToClipboard(path);
+ setToast({
+ type: TOAST_TYPE.SUCCESS,
+ title: t("common.link_copied"),
+ message: t("entity.link_copied_to_clipboard", { entity: entityName }),
});
},
update: async (workspaceSlug, projectId, issueId, data) => {
try {
await updateIssue(workspaceSlug, projectId, issueId, data);
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- });
setToast({
title: t("toast.success"),
type: TOAST_TYPE.SUCCESS,
message: t("entity.update.success", { entity: entityName }),
});
- } catch (error) {
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- error: error as Error,
- });
+ } catch (_error) {
setToast({
title: t("toast.error"),
type: TOAST_TYPE.ERROR,
@@ -61,20 +49,7 @@ export const useRelationOperations = (
}
},
remove: async (workspaceSlug, projectId, issueId) => {
- try {
- return removeIssue(workspaceSlug, projectId, issueId).then(() => {
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.delete,
- payload: { id: issueId },
- });
- });
- } catch (error) {
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.delete,
- payload: { id: issueId },
- error: error as Error,
- });
- }
+ return removeIssue(workspaceSlug, projectId, issueId);
},
}),
[entityName, removeIssue, t, updateIssue]
diff --git a/apps/web/core/components/issues/issue-detail-widgets/sub-issues/helper.ts b/apps/web/core/components/issues/issue-detail-widgets/sub-issues/helper.ts
index 3790e1164e..ab1722b364 100644
--- a/apps/web/core/components/issues/issue-detail-widgets/sub-issues/helper.ts
+++ b/apps/web/core/components/issues/issue-detail-widgets/sub-issues/helper.ts
@@ -1,14 +1,12 @@
import { useMemo } from "react";
import { useParams } from "next/navigation";
// plane imports
-import { WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { TIssueServiceType, TSubIssueOperations } from "@plane/types";
import { EIssueServiceType } from "@plane/types";
import { copyUrlToClipboard } from "@plane/utils";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useIssueDetail } from "@/hooks/store/use-issue-detail";
import { useProjectState } from "@/hooks/store/use-project-state";
// plane web helpers
@@ -39,18 +37,17 @@ export const useSubIssueOperations = (issueServiceType: TIssueServiceType): TSub
const subIssueOperations: TSubIssueOperations = useMemo(
() => ({
- copyLink: (path) => {
- copyUrlToClipboard(path).then(() => {
- setToast({
- type: TOAST_TYPE.SUCCESS,
- title: t("common.link_copied"),
- message: t("entity.link_copied_to_clipboard", {
- entity:
- issueServiceType === EIssueServiceType.ISSUES
- ? t("common.sub_work_items", { count: 1 })
- : t("issue.label", { count: 1 }),
- }),
- });
+ copyLink: async (path) => {
+ await copyUrlToClipboard(path);
+ setToast({
+ type: TOAST_TYPE.SUCCESS,
+ title: t("common.link_copied"),
+ message: t("entity.link_copied_to_clipboard", {
+ entity:
+ issueServiceType === EIssueServiceType.ISSUES
+ ? t("common.sub_work_items", { count: 1 })
+ : t("issue.label", { count: 1 }),
+ }),
});
},
fetchSubIssues: async (workspaceSlug, projectId, parentIssueId) => {
@@ -131,22 +128,13 @@ export const useSubIssueOperations = (issueServiceType: TIssueServiceType): TSub
}
}
}
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.sub_issue.update,
- payload: { id: issueId, parent_id: parentIssueId },
- });
setToast({
type: TOAST_TYPE.SUCCESS,
title: t("toast.success"),
message: t("sub_work_item.update.success"),
});
setSubIssueHelpers(parentIssueId, "issue_loader", issueId);
- } catch (error) {
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.sub_issue.update,
- payload: { id: issueId, parent_id: parentIssueId },
- error: error as Error,
- });
+ } catch (_error) {
setToast({
type: TOAST_TYPE.ERROR,
title: t("toast.error"),
@@ -178,17 +166,8 @@ export const useSubIssueOperations = (issueServiceType: TIssueServiceType): TSub
: t("issue.label", { count: 1 }),
}),
});
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.sub_issue.remove,
- payload: { id: issueId, parent_id: parentIssueId },
- });
setSubIssueHelpers(parentIssueId, "issue_loader", issueId);
- } catch (error) {
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.sub_issue.remove,
- payload: { id: issueId, parent_id: parentIssueId },
- error: error as Error,
- });
+ } catch (_error) {
setToast({
type: TOAST_TYPE.ERROR,
title: t("toast.error"),
@@ -205,18 +184,9 @@ export const useSubIssueOperations = (issueServiceType: TIssueServiceType): TSub
try {
setSubIssueHelpers(parentIssueId, "issue_loader", issueId);
return deleteSubIssue(workspaceSlug, projectId, parentIssueId, issueId).then(() => {
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.sub_issue.delete,
- payload: { id: issueId, parent_id: parentIssueId },
- });
setSubIssueHelpers(parentIssueId, "issue_loader", issueId);
});
- } catch (error) {
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.sub_issue.delete,
- payload: { id: issueId, parent_id: parentIssueId },
- error: error as Error,
- });
+ } catch (_error) {
setToast({
type: TOAST_TYPE.ERROR,
title: t("toast.error"),
diff --git a/apps/web/core/components/issues/issue-detail-widgets/sub-issues/quick-action-button.tsx b/apps/web/core/components/issues/issue-detail-widgets/sub-issues/quick-action-button.tsx
index 950491bf95..56f5a8c4a7 100644
--- a/apps/web/core/components/issues/issue-detail-widgets/sub-issues/quick-action-button.tsx
+++ b/apps/web/core/components/issues/issue-detail-widgets/sub-issues/quick-action-button.tsx
@@ -1,7 +1,5 @@
-import type { FC } from "react";
import React from "react";
import { observer } from "mobx-react";
-
// plane imports
import { WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
@@ -9,7 +7,6 @@ import { PlusIcon, WorkItemsIcon } from "@plane/propel/icons";
import type { TIssue, TIssueServiceType } from "@plane/types";
import { CustomMenu } from "@plane/ui";
// hooks
-import { captureClick } from "@/helpers/event-tracker.helper";
import { useIssueDetail } from "@/hooks/store/use-issue-detail";
type Props = {
@@ -54,13 +51,11 @@ export const SubIssuesActionButton = observer(function SubIssuesActionButton(pro
};
const handleCreateNew = () => {
- captureClick({ elementName: WORK_ITEM_TRACKER_EVENTS.sub_issue.create });
handleIssueCrudState("create", issueId, null);
toggleCreateIssueModal(true);
};
const handleAddExisting = () => {
- captureClick({ elementName: WORK_ITEM_TRACKER_EVENTS.sub_issue.add_existing });
handleIssueCrudState("existing", issueId, null);
toggleSubIssuesModal(issue.id);
};
diff --git a/apps/web/core/components/issues/issue-detail/issue-detail-quick-actions.tsx b/apps/web/core/components/issues/issue-detail/issue-detail-quick-actions.tsx
index e17d96b710..fc084bf5ef 100644
--- a/apps/web/core/components/issues/issue-detail/issue-detail-quick-actions.tsx
+++ b/apps/web/core/components/issues/issue-detail/issue-detail-quick-actions.tsx
@@ -1,17 +1,13 @@
import { useRef } from "react";
import { observer } from "mobx-react";
// plane imports
-import { WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { CopyLinkIcon } from "@plane/propel/icons";
import { IconButton } from "@plane/propel/icon-button";
-import { LinkIcon } from "@plane/propel/icons";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import { Tooltip } from "@plane/propel/tooltip";
import { EIssuesStoreType } from "@plane/types";
import { generateWorkItemLink, copyTextToClipboard } from "@plane/utils";
-// helpers
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useIssueDetail } from "@/hooks/store/use-issue-detail";
import { useIssues } from "@/hooks/store/use-issues";
@@ -70,15 +66,21 @@ export const IssueDetailQuickActions = observer(function IssueDetailQuickActions
});
// handlers
- const handleCopyText = () => {
- const originURL = typeof window !== "undefined" && window.location.origin ? window.location.origin : "";
- copyTextToClipboard(`${originURL}${workItemLink}`).then(() => {
+ const handleCopyText = async () => {
+ try {
+ const originURL = typeof window !== "undefined" && window.location.origin ? window.location.origin : "";
+ await copyTextToClipboard(`${originURL}${workItemLink}`);
setToast({
type: TOAST_TYPE.SUCCESS,
title: t("common.link_copied"),
message: t("common.copied_to_clipboard"),
});
- });
+ } catch (_error) {
+ setToast({
+ title: t("toast.error"),
+ type: TOAST_TYPE.ERROR,
+ });
+ }
};
const handleDeleteIssue = async () => {
@@ -88,24 +90,14 @@ export const IssueDetailQuickActions = observer(function IssueDetailQuickActions
? `/${workspaceSlug}/projects/${projectId}/archives/issues`
: `/${workspaceSlug}/projects/${projectId}/issues`;
- return deleteIssue(workspaceSlug, projectId, issueId).then(() => {
- router.push(redirectionPath);
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.delete,
- payload: { id: issueId },
- });
- });
- } catch (error) {
+ await deleteIssue(workspaceSlug, projectId, issueId);
+ router.push(redirectionPath);
+ } catch (_error) {
setToast({
title: t("toast.error "),
type: TOAST_TYPE.ERROR,
message: t("entity.delete.failed", { entity: t("issue.label", { count: 1 }) }),
});
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.delete,
- payload: { id: issueId },
- error: error as Error,
- });
}
};
@@ -113,38 +105,32 @@ export const IssueDetailQuickActions = observer(function IssueDetailQuickActions
try {
await archiveIssue(workspaceSlug, projectId, issueId);
router.push(`/${workspaceSlug}/projects/${projectId}/issues`);
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.archive,
- payload: { id: issueId },
- });
- } catch (error) {
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.archive,
- payload: { id: issueId },
- error: error as Error,
+ } catch (_error) {
+ setToast({
+ title: t("toast.error"),
+ type: TOAST_TYPE.ERROR,
+ message: t("issue.archive.failed.message"),
});
}
};
const handleRestore = async () => {
if (!workspaceSlug || !projectId || !issueId) return;
-
- await restoreIssue(workspaceSlug.toString(), projectId.toString(), issueId.toString())
- .then(() => {
- setToast({
- type: TOAST_TYPE.SUCCESS,
- title: t("issue.restore.success.title"),
- message: t("issue.restore.success.message"),
- });
- router.push(workItemLink);
- })
- .catch(() => {
- setToast({
- type: TOAST_TYPE.ERROR,
- title: t("toast.error"),
- message: t("issue.restore.failed.message"),
- });
+ try {
+ await restoreIssue(workspaceSlug.toString(), projectId.toString(), issueId.toString());
+ setToast({
+ type: TOAST_TYPE.SUCCESS,
+ title: t("issue.restore.success.title"),
+ message: t("issue.restore.success.message"),
});
+ router.push(workItemLink);
+ } catch (_error) {
+ setToast({
+ title: t("toast.error"),
+ type: TOAST_TYPE.ERROR,
+ message: t("issue.restore.failed.message"),
+ });
+ }
};
return (
diff --git a/apps/web/core/components/issues/issue-detail/root.tsx b/apps/web/core/components/issues/issue-detail/root.tsx
index 104f84f101..fcb07e07f4 100644
--- a/apps/web/core/components/issues/issue-detail/root.tsx
+++ b/apps/web/core/components/issues/issue-detail/root.tsx
@@ -1,8 +1,7 @@
-import type { FC } from "react";
import { useMemo } from "react";
import { observer } from "mobx-react";
// plane imports
-import { EUserPermissions, EUserPermissionsLevel, WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
+import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { TOAST_TYPE, setPromiseToast, setToast } from "@plane/propel/toast";
import type { TIssue } from "@plane/types";
@@ -12,7 +11,6 @@ import emptyIssue from "@/app/assets/empty-state/issue.svg?url";
// components
import { EmptyState } from "@/components/common/empty-state";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useAppTheme } from "@/hooks/store/use-app-theme";
import { useIssueDetail } from "@/hooks/store/use-issue-detail";
import { useIssues } from "@/hooks/store/use-issues";
@@ -90,17 +88,8 @@ export const IssueDetailRoot = observer(function IssueDetailRoot(props: TIssueDe
update: async (workspaceSlug: string, projectId: string, issueId: string, data: Partial) => {
try {
await updateIssue(workspaceSlug, projectId, issueId, data);
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- });
} catch (error) {
console.log("Error in updating issue:", error);
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- error: error as Error,
- });
setToast({
title: t("common.error.label"),
type: TOAST_TYPE.ERROR,
@@ -117,10 +106,6 @@ export const IssueDetailRoot = observer(function IssueDetailRoot(props: TIssueDe
type: TOAST_TYPE.SUCCESS,
message: t("entity.delete.success", { entity: t("issue.label") }),
});
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.delete,
- payload: { id: issueId },
- });
} catch (error) {
console.log("Error in deleting issue:", error);
setToast({
@@ -128,67 +113,35 @@ export const IssueDetailRoot = observer(function IssueDetailRoot(props: TIssueDe
type: TOAST_TYPE.ERROR,
message: t("entity.delete.failed", { entity: t("issue.label") }),
});
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.delete,
- payload: { id: issueId },
- error: error as Error,
- });
}
},
archive: async (workspaceSlug: string, projectId: string, issueId: string) => {
try {
await archiveIssue(workspaceSlug, projectId, issueId);
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.archive,
- payload: { id: issueId },
- });
} catch (error) {
console.log("Error in archiving issue:", error);
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.archive,
- payload: { id: issueId },
- error: error as Error,
- });
}
},
addCycleToIssue: async (workspaceSlug: string, projectId: string, cycleId: string, issueId: string) => {
try {
await addCycleToIssue(workspaceSlug, projectId, cycleId, issueId);
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- });
- } catch (error) {
+ } catch (_error) {
setToast({
type: TOAST_TYPE.ERROR,
title: t("common.error.label"),
message: t("issue.add.cycle.failed"),
});
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- error: error as Error,
- });
}
},
addIssueToCycle: async (workspaceSlug: string, projectId: string, cycleId: string, issueIds: string[]) => {
try {
await addIssueToCycle(workspaceSlug, projectId, cycleId, issueIds);
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- });
- } catch (error) {
+ } catch (_error) {
setToast({
type: TOAST_TYPE.ERROR,
title: t("common.error.label"),
message: t("issue.add.cycle.failed"),
});
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- error: error as Error,
- });
}
},
removeIssueFromCycle: async (workspaceSlug: string, projectId: string, cycleId: string, issueId: string) => {
@@ -206,16 +159,8 @@ export const IssueDetailRoot = observer(function IssueDetailRoot(props: TIssueDe
},
});
await removeFromCyclePromise;
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- });
} catch (error) {
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- error: error as Error,
- });
+ console.log("Error in removing issue from cycle:", error);
}
},
removeIssueFromModule: async (workspaceSlug: string, projectId: string, moduleId: string, issueId: string) => {
@@ -233,16 +178,8 @@ export const IssueDetailRoot = observer(function IssueDetailRoot(props: TIssueDe
},
});
await removeFromModulePromise;
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- });
} catch (error) {
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- error: error as Error,
- });
+ console.log("Error in removing issue from module:", error);
}
},
changeModulesInIssue: async (
@@ -253,10 +190,6 @@ export const IssueDetailRoot = observer(function IssueDetailRoot(props: TIssueDe
removeModuleIds: string[]
) => {
const promise = await changeModulesInIssue(workspaceSlug, projectId, issueId, addModuleIds, removeModuleIds);
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- });
return promise;
},
}),
@@ -273,7 +206,6 @@ export const IssueDetailRoot = observer(function IssueDetailRoot(props: TIssueDe
changeModulesInIssue,
removeIssueFromModule,
t,
- issueId,
]
);
diff --git a/apps/web/core/components/issues/issue-layouts/empty-states/cycle.tsx b/apps/web/core/components/issues/issue-layouts/empty-states/cycle.tsx
index 2428b66984..c98fafacc4 100644
--- a/apps/web/core/components/issues/issue-layouts/empty-states/cycle.tsx
+++ b/apps/web/core/components/issues/issue-layouts/empty-states/cycle.tsx
@@ -11,7 +11,6 @@ import type { ISearchIssueResponse } from "@plane/types";
import { EIssuesStoreType, EUserProjectRoles } from "@plane/types";
// components
import { ExistingIssuesListModal } from "@/components/core/modals/existing-issues-list-modal";
-import { captureClick } from "@/helpers/event-tracker.helper";
import { useCommandPalette } from "@/hooks/store/use-command-palette";
import { useCycle } from "@/hooks/store/use-cycle";
import { useIssues } from "@/hooks/store/use-issues";
@@ -107,7 +106,6 @@ export const CycleEmptyState = observer(function CycleEmptyState() {
{
label: t("project_empty_state.cycle_work_items.cta_primary"),
onClick: () => {
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.EMPTY_STATE_ADD_BUTTON.CYCLE });
toggleCreateIssueModal(true, EIssuesStoreType.CYCLE);
},
disabled: !canPerformEmptyStateActions,
diff --git a/apps/web/core/components/issues/issue-layouts/empty-states/global-view.tsx b/apps/web/core/components/issues/issue-layouts/empty-states/global-view.tsx
index 87ac70cca4..e2c2553e81 100644
--- a/apps/web/core/components/issues/issue-layouts/empty-states/global-view.tsx
+++ b/apps/web/core/components/issues/issue-layouts/empty-states/global-view.tsx
@@ -1,11 +1,10 @@
import { observer } from "mobx-react";
// plane imports
-import { EUserPermissionsLevel, WORK_ITEM_TRACKER_ELEMENTS } from "@plane/constants";
+import { EUserPermissionsLevel } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { EmptyStateDetailed } from "@plane/propel/empty-state";
import { EIssuesStoreType, EUserWorkspaceRoles } from "@plane/types";
// hooks
-import { captureClick } from "@/helpers/event-tracker.helper";
import { useCommandPalette } from "@/hooks/store/use-command-palette";
import { useProject } from "@/hooks/store/use-project";
import { useUserPermissions } from "@/hooks/store/user";
@@ -35,7 +34,6 @@ export const GlobalViewEmptyState = observer(function GlobalViewEmptyState() {
label: t("workspace_projects.empty_state.no_projects.primary_button.text"),
onClick: () => {
toggleCreateProjectModal(true);
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.EMPTY_STATE_ADD_BUTTON.GLOBAL_VIEW });
},
disabled: !hasMemberLevelPermission,
variant: "primary",
@@ -55,7 +53,6 @@ export const GlobalViewEmptyState = observer(function GlobalViewEmptyState() {
{
label: t(`workspace_empty_state.views.cta_primary`),
onClick: () => {
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.EMPTY_STATE_ADD_BUTTON.GLOBAL_VIEW });
toggleCreateIssueModal(true, EIssuesStoreType.PROJECT);
},
disabled: !hasMemberLevelPermission,
diff --git a/apps/web/core/components/issues/issue-layouts/empty-states/module.tsx b/apps/web/core/components/issues/issue-layouts/empty-states/module.tsx
index 807400411f..461ecc5c6b 100644
--- a/apps/web/core/components/issues/issue-layouts/empty-states/module.tsx
+++ b/apps/web/core/components/issues/issue-layouts/empty-states/module.tsx
@@ -2,7 +2,7 @@ import { useState } from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// plane imports
-import { EUserPermissionsLevel, WORK_ITEM_TRACKER_ELEMENTS } from "@plane/constants";
+import { EUserPermissionsLevel } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { EmptyStateDetailed } from "@plane/propel/empty-state";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
@@ -10,7 +10,6 @@ import type { ISearchIssueResponse } from "@plane/types";
import { EIssuesStoreType, EUserProjectRoles } from "@plane/types";
// components
import { ExistingIssuesListModal } from "@/components/core/modals/existing-issues-list-modal";
-import { captureClick } from "@/helpers/event-tracker.helper";
// hooks
import { useCommandPalette } from "@/hooks/store/use-command-palette";
import { useIssues } from "@/hooks/store/use-issues";
@@ -94,7 +93,6 @@ export const ModuleEmptyState = observer(function ModuleEmptyState() {
{
label: t("project_empty_state.module_work_items.cta_primary"),
onClick: () => {
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.EMPTY_STATE_ADD_BUTTON.MODULE });
toggleCreateIssueModal(true, EIssuesStoreType.MODULE);
},
disabled: !canPerformEmptyStateActions,
diff --git a/apps/web/core/components/issues/issue-layouts/empty-states/project-issues.tsx b/apps/web/core/components/issues/issue-layouts/empty-states/project-issues.tsx
index 11d3c04461..488c8d205b 100644
--- a/apps/web/core/components/issues/issue-layouts/empty-states/project-issues.tsx
+++ b/apps/web/core/components/issues/issue-layouts/empty-states/project-issues.tsx
@@ -1,12 +1,10 @@
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// plane imports
-import { EUserPermissionsLevel, WORK_ITEM_TRACKER_ELEMENTS } from "@plane/constants";
+import { EUserPermissionsLevel } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { EmptyStateDetailed } from "@plane/propel/empty-state";
import { EIssuesStoreType, EUserProjectRoles } from "@plane/types";
-// components
-import { captureClick } from "@/helpers/event-tracker.helper";
// hooks
import { useCommandPalette } from "@/hooks/store/use-command-palette";
import { useUserPermissions } from "@/hooks/store/user";
@@ -54,7 +52,6 @@ export const ProjectEmptyState = observer(function ProjectEmptyState() {
{
label: t("project_empty_state.work_items.cta_primary"),
onClick: () => {
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.EMPTY_STATE_ADD_BUTTON.WORK_ITEMS });
toggleCreateIssueModal(true, EIssuesStoreType.PROJECT);
},
disabled: !canPerformEmptyStateActions,
diff --git a/apps/web/core/components/issues/issue-layouts/empty-states/project-view.tsx b/apps/web/core/components/issues/issue-layouts/empty-states/project-view.tsx
index 4ea0dcd4b5..3e8bb73513 100644
--- a/apps/web/core/components/issues/issue-layouts/empty-states/project-view.tsx
+++ b/apps/web/core/components/issues/issue-layouts/empty-states/project-view.tsx
@@ -3,8 +3,6 @@ import { observer } from "mobx-react";
import { EUserPermissions, EUserPermissionsLevel, WORK_ITEM_TRACKER_ELEMENTS } from "@plane/constants";
import { EmptyStateDetailed } from "@plane/propel/empty-state";
import { EIssuesStoreType } from "@plane/types";
-// components
-import { captureClick } from "@/helpers/event-tracker.helper";
// hooks
import { useCommandPalette } from "@/hooks/store/use-command-palette";
import { useUserPermissions } from "@/hooks/store/user";
@@ -30,7 +28,6 @@ export const ProjectViewEmptyState = observer(function ProjectViewEmptyState() {
{
label: "New work item",
onClick: () => {
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.EMPTY_STATE_ADD_BUTTON.PROJECT_VIEW });
toggleCreateIssueModal(true, EIssuesStoreType.PROJECT_VIEW);
},
disabled: !isCreatingIssueAllowed,
diff --git a/apps/web/core/components/issues/issue-layouts/kanban/base-kanban-root.tsx b/apps/web/core/components/issues/issue-layouts/kanban/base-kanban-root.tsx
index 0fc8f21311..a172d8687d 100644
--- a/apps/web/core/components/issues/issue-layouts/kanban/base-kanban-root.tsx
+++ b/apps/web/core/components/issues/issue-layouts/kanban/base-kanban-root.tsx
@@ -5,12 +5,10 @@ import { dropTargetForElements } from "@atlaskit/pragmatic-drag-and-drop/element
import { autoScrollForElements } from "@atlaskit/pragmatic-drag-and-drop-auto-scroll/element";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
-import { EIssueFilterType, EUserPermissions, EUserPermissionsLevel, WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
+import { EIssueFilterType, EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import type { EIssuesStoreType } from "@plane/types";
import { EIssueServiceType, EIssueLayoutTypes } from "@plane/types";
-//constants
//hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useIssueDetail } from "@/hooks/store/use-issue-detail";
import { useIssues } from "@/hooks/store/use-issues";
import { useKanbanView } from "@/hooks/store/use-kanban-view";
@@ -200,23 +198,14 @@ export const BaseKanBanRoot = observer(function BaseKanBanRoot(props: IBaseKanBa
if (!draggedIssueId || !draggedIssue) return;
- await removeIssue(draggedIssue.project_id, draggedIssueId)
- .then(() => {
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.delete,
- payload: { id: draggedIssueId },
- });
- })
- .catch(() => {
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.delete,
- payload: { id: draggedIssueId },
- });
- })
- .finally(() => {
- setDeleteIssueModal(false);
- setDraggedIssueId(undefined);
- });
+ try {
+ await removeIssue(draggedIssue.project_id, draggedIssueId);
+ setDeleteIssueModal(false);
+ setDraggedIssueId(undefined);
+ } catch (_error) {
+ setDeleteIssueModal(false);
+ setDraggedIssueId(undefined);
+ }
};
const handleCollapsedGroups = useCallback(
diff --git a/apps/web/core/components/issues/issue-layouts/kanban/headers/group-by-card.tsx b/apps/web/core/components/issues/issue-layouts/kanban/headers/group-by-card.tsx
index 634bcba0a5..67664b4a0f 100644
--- a/apps/web/core/components/issues/issue-layouts/kanban/headers/group-by-card.tsx
+++ b/apps/web/core/components/issues/issue-layouts/kanban/headers/group-by-card.tsx
@@ -3,7 +3,6 @@ import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// lucide icons
import { Minimize2, Maximize2, Circle } from "lucide-react";
-import { WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
import { PlusIcon } from "@plane/propel/icons";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { TIssue, ISearchIssueResponse, TIssueKanbanFilters, TIssueGroupByOptions } from "@plane/types";
@@ -13,7 +12,6 @@ import { CustomMenu } from "@plane/ui";
import { ExistingIssuesListModal } from "@/components/core/modals/existing-issues-list-modal";
import { CreateUpdateIssueModal } from "@/components/issues/issue-modal/modal";
// constants
-import { captureClick } from "@/helpers/event-tracker.helper";
import { useIssueStoreType } from "@/hooks/use-issue-layout-store";
import { CreateUpdateEpicModal } from "@/plane-web/components/epics/epic-modal";
// types
@@ -75,7 +73,7 @@ export const HeaderGroupByCard = observer(function HeaderGroupByCard(props: IHea
title: "Success!",
message: "Work items added to the cycle successfully.",
});
- } catch (error) {
+ } catch (_error) {
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
@@ -162,7 +160,6 @@ export const HeaderGroupByCard = observer(function HeaderGroupByCard(props: IHea
>
{
- captureClick({ elementName: WORK_ITEM_TRACKER_EVENTS.create });
setIsOpen(true);
}}
>
@@ -170,7 +167,6 @@ export const HeaderGroupByCard = observer(function HeaderGroupByCard(props: IHea
{
- captureClick({ elementName: WORK_ITEM_TRACKER_EVENTS.add_existing });
setOpenExistingIssueListModal(true);
}}
>
@@ -181,7 +177,6 @@ export const HeaderGroupByCard = observer(function HeaderGroupByCard(props: IHea
{
- captureClick({ elementName: WORK_ITEM_TRACKER_EVENTS.create });
setIsOpen(true);
}}
>
diff --git a/apps/web/core/components/issues/issue-layouts/list/headers/group-by-card.tsx b/apps/web/core/components/issues/issue-layouts/list/headers/group-by-card.tsx
index 64062dfff5..3b1396cfc2 100644
--- a/apps/web/core/components/issues/issue-layouts/list/headers/group-by-card.tsx
+++ b/apps/web/core/components/issues/issue-layouts/list/headers/group-by-card.tsx
@@ -2,7 +2,6 @@ import { useState } from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
import { CircleDashed } from "lucide-react";
-import { WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
import { PlusIcon } from "@plane/propel/icons";
// types
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
@@ -15,7 +14,6 @@ import { ExistingIssuesListModal } from "@/components/core/modals/existing-issue
import { MultipleSelectGroupAction } from "@/components/core/multiple-select";
import { CreateUpdateIssueModal } from "@/components/issues/issue-modal/modal";
// constants
-import { captureClick } from "@/helpers/event-tracker.helper";
import { useIssueStoreType } from "@/hooks/use-issue-layout-store";
import type { TSelectionHelper } from "@/hooks/use-multiple-select";
// plane-web
@@ -132,7 +130,6 @@ export const HeaderGroupByCard = observer(function HeaderGroupByCard(props: IHea
>
{
- captureClick({ elementName: WORK_ITEM_TRACKER_EVENTS.create });
setIsOpen(true);
}}
>
@@ -140,7 +137,6 @@ export const HeaderGroupByCard = observer(function HeaderGroupByCard(props: IHea
{
- captureClick({ elementName: WORK_ITEM_TRACKER_EVENTS.add_existing });
setOpenExistingIssueListModal(true);
}}
>
@@ -151,7 +147,6 @@ export const HeaderGroupByCard = observer(function HeaderGroupByCard(props: IHea
{
- captureClick({ elementName: WORK_ITEM_TRACKER_EVENTS.create });
setIsOpen(true);
}}
>
diff --git a/apps/web/core/components/issues/issue-layouts/properties/all-properties.tsx b/apps/web/core/components/issues/issue-layouts/properties/all-properties.tsx
index 9d5a23b3d1..d0358d46d9 100644
--- a/apps/web/core/components/issues/issue-layouts/properties/all-properties.tsx
+++ b/apps/web/core/components/issues/issue-layouts/properties/all-properties.tsx
@@ -5,8 +5,6 @@ import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// icons
import { Paperclip } from "lucide-react";
-// types
-import { WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
// i18n
import { useTranslation } from "@plane/i18n";
import { LinkIcon, StartDatePropertyIcon, ViewsIcon, DueDatePropertyIcon } from "@plane/propel/icons";
@@ -29,8 +27,6 @@ import { MemberDropdown } from "@/components/dropdowns/member/dropdown";
import { ModuleDropdown } from "@/components/dropdowns/module/dropdown";
import { PriorityDropdown } from "@/components/dropdowns/priority";
import { StateDropdown } from "@/components/dropdowns/state/dropdown";
-// helpers
-import { captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useProjectEstimates } from "@/hooks/store/estimates";
import { useIssues } from "@/hooks/store/use-issues";
@@ -105,44 +101,20 @@ export const IssueProperties = observer(function IssueProperties(props: IIssuePr
[workspaceSlug, issue, changeModulesInIssue, addCycleToIssue, removeCycleFromIssue]
);
- const handleState = (stateId: string) => {
- if (updateIssue)
- updateIssue(issue.project_id, issue.id, { state_id: stateId }).then(() => {
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issue.id },
- });
- });
+ const handleState = async (stateId: string) => {
+ if (updateIssue) await updateIssue(issue.project_id, issue.id, { state_id: stateId });
};
- const handlePriority = (value: TIssuePriorities) => {
- if (updateIssue)
- updateIssue(issue.project_id, issue.id, { priority: value }).then(() => {
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issue.id },
- });
- });
+ const handlePriority = async (value: TIssuePriorities) => {
+ if (updateIssue) await updateIssue(issue.project_id, issue.id, { priority: value });
};
- const handleLabel = (ids: string[]) => {
- if (updateIssue)
- updateIssue(issue.project_id, issue.id, { label_ids: ids }).then(() => {
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issue.id },
- });
- });
+ const handleLabel = async (ids: string[]) => {
+ if (updateIssue) await updateIssue(issue.project_id, issue.id, { label_ids: ids });
};
- const handleAssignee = (ids: string[]) => {
- if (updateIssue)
- updateIssue(issue.project_id, issue.id, { assignee_ids: ids }).then(() => {
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issue.id },
- });
- });
+ const handleAssignee = async (ids: string[]) => {
+ if (updateIssue) await updateIssue(issue.project_id, issue.id, { assignee_ids: ids });
};
const handleModule = useCallback(
@@ -157,11 +129,6 @@ export const IssueProperties = observer(function IssueProperties(props: IIssuePr
else modulesToAdd.push(moduleId);
if (modulesToAdd.length > 0) issueOperations.addModulesToIssue(modulesToAdd);
if (modulesToRemove.length > 0) issueOperations.removeModulesFromIssue(modulesToRemove);
-
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issue.id },
- });
},
[issueOperations, issue]
);
@@ -171,47 +138,22 @@ export const IssueProperties = observer(function IssueProperties(props: IIssuePr
if (!issue || issue.cycle_id === cycleId) return;
if (cycleId) issueOperations.addIssueToCycle?.(cycleId);
else issueOperations.removeIssueFromCycle?.();
-
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issue.id },
- });
},
[issue, issueOperations]
);
- const handleStartDate = (date: Date | null) => {
+ const handleStartDate = async (date: Date | null) => {
if (updateIssue)
- updateIssue(issue.project_id, issue.id, { start_date: date ? renderFormattedPayloadDate(date) : null }).then(
- () => {
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issue.id },
- });
- }
- );
+ await updateIssue(issue.project_id, issue.id, { start_date: date ? renderFormattedPayloadDate(date) : null });
};
- const handleTargetDate = (date: Date | null) => {
+ const handleTargetDate = async (date: Date | null) => {
if (updateIssue)
- updateIssue(issue.project_id, issue.id, { target_date: date ? renderFormattedPayloadDate(date) : null }).then(
- () => {
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issue.id },
- });
- }
- );
+ await updateIssue(issue.project_id, issue.id, { target_date: date ? renderFormattedPayloadDate(date) : null });
};
- const handleEstimate = (value: string | undefined) => {
- if (updateIssue)
- updateIssue(issue.project_id, issue.id, { estimate_point: value }).then(() => {
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issue.id },
- });
- });
+ const handleEstimate = async (value: string | undefined) => {
+ if (updateIssue) await updateIssue(issue.project_id, issue.id, { estimate_point: value });
};
const workItemLink = generateWorkItemLink({
diff --git a/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/all-issue.tsx b/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/all-issue.tsx
index ee6ac4ceb4..fecff54e5f 100644
--- a/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/all-issue.tsx
+++ b/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/all-issue.tsx
@@ -3,14 +3,12 @@ import { omit } from "lodash-es";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// plane imports
-import { ARCHIVABLE_STATE_GROUPS, WORK_ITEM_TRACKER_ELEMENTS } from "@plane/constants";
+import { ARCHIVABLE_STATE_GROUPS } from "@plane/constants";
import type { TIssue } from "@plane/types";
import { EIssuesStoreType } from "@plane/types";
-import type { TContextMenuItem } from "@plane/ui";
import { ContextMenu, CustomMenu } from "@plane/ui";
import { cn } from "@plane/utils";
// hooks
-import { captureClick } from "@/helpers/event-tracker.helper";
import { useProject } from "@/hooks/store/use-project";
import { useProjectState } from "@/hooks/store/use-project-state";
// plane-web components
@@ -88,9 +86,7 @@ export const AllIssueQuickActions = observer(function AllIssueQuickActions(props
const CONTEXT_MENU_ITEMS = MENU_ITEMS.map(function CONTEXT_MENU_ITEMS(item) {
return {
...item,
-
onClick: () => {
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.GLOBAL_VIEW });
item.action();
},
};
@@ -180,7 +176,6 @@ export const AllIssueQuickActions = observer(function AllIssueQuickActions(props
{
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.GLOBAL_VIEW });
nestedItem.action();
}}
className={cn(
@@ -216,7 +211,6 @@ export const AllIssueQuickActions = observer(function AllIssueQuickActions(props
{
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.GLOBAL_VIEW });
item.action();
}}
className={cn(
diff --git a/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/archived-issue.tsx b/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/archived-issue.tsx
index 6c217a270b..cf51cefd13 100644
--- a/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/archived-issue.tsx
+++ b/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/archived-issue.tsx
@@ -2,13 +2,11 @@ import { useState } from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// ui
-import { EUserPermissions, EUserPermissionsLevel, WORK_ITEM_TRACKER_ELEMENTS } from "@plane/constants";
+import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { EIssuesStoreType } from "@plane/types";
-import type { TContextMenuItem } from "@plane/ui";
import { ContextMenu, CustomMenu } from "@plane/ui";
import { cn } from "@plane/utils";
// hooks
-import { captureClick } from "@/helpers/event-tracker.helper";
import { useIssues } from "@/hooks/store/use-issues";
import { useUserPermissions } from "@/hooks/store/user";
// local imports
@@ -66,7 +64,6 @@ export const ArchivedIssueQuickActions = observer(function ArchivedIssueQuickAct
...item,
onClick: () => {
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.ARCHIVED });
item.action();
},
};
@@ -99,7 +96,6 @@ export const ArchivedIssueQuickActions = observer(function ArchivedIssueQuickAct
key={item.key}
onClick={() => {
item.action();
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.ARCHIVED });
}}
className={cn(
"flex items-center gap-2",
diff --git a/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/cycle-issue.tsx b/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/cycle-issue.tsx
index a7bc06c353..57de8584e1 100644
--- a/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/cycle-issue.tsx
+++ b/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/cycle-issue.tsx
@@ -3,19 +3,12 @@ import { omit } from "lodash-es";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// plane imports
-import {
- ARCHIVABLE_STATE_GROUPS,
- EUserPermissions,
- EUserPermissionsLevel,
- WORK_ITEM_TRACKER_ELEMENTS,
-} from "@plane/constants";
+import { ARCHIVABLE_STATE_GROUPS, EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import type { TIssue } from "@plane/types";
import { EIssuesStoreType } from "@plane/types";
-import type { TContextMenuItem } from "@plane/ui";
import { ContextMenu, CustomMenu } from "@plane/ui";
import { cn } from "@plane/utils";
// hooks
-import { captureClick } from "@/helpers/event-tracker.helper";
import { useIssues } from "@/hooks/store/use-issues";
import { useProject } from "@/hooks/store/use-project";
import { useProjectState } from "@/hooks/store/use-project-state";
@@ -107,7 +100,6 @@ export const CycleIssueQuickActions = observer(function CycleIssueQuickActions(p
...item,
onClick: () => {
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.CYCLE });
item.action();
},
};
@@ -197,7 +189,6 @@ export const CycleIssueQuickActions = observer(function CycleIssueQuickActions(p
{
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.CYCLE });
nestedItem.action();
}}
className={cn(
@@ -233,7 +224,6 @@ export const CycleIssueQuickActions = observer(function CycleIssueQuickActions(p
{
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.CYCLE });
item.action();
}}
className={cn(
diff --git a/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/issue-detail.tsx b/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/issue-detail.tsx
index 2df9463012..c28a67f642 100644
--- a/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/issue-detail.tsx
+++ b/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/issue-detail.tsx
@@ -4,19 +4,12 @@ import { observer } from "mobx-react";
import { useParams, usePathname } from "next/navigation";
import { Ellipsis } from "lucide-react";
// plane imports
-import {
- ARCHIVABLE_STATE_GROUPS,
- EUserPermissions,
- EUserPermissionsLevel,
- WORK_ITEM_TRACKER_ELEMENTS,
-} from "@plane/constants";
+import { ARCHIVABLE_STATE_GROUPS, EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import type { TIssue } from "@plane/types";
import { EIssuesStoreType } from "@plane/types";
-import type { TContextMenuItem } from "@plane/ui";
import { ContextMenu, CustomMenu } from "@plane/ui";
import { cn } from "@plane/utils";
// hooks
-import { captureClick } from "@/helpers/event-tracker.helper";
import { useIssues } from "@/hooks/store/use-issues";
import { useProject } from "@/hooks/store/use-project";
import { useProjectState } from "@/hooks/store/use-project-state";
@@ -186,7 +179,6 @@ export const WorkItemDetailQuickActions = observer(function WorkItemDetailQuickA
...item,
onClick: () => {
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.PROJECT_VIEW });
item.action();
},
};
@@ -286,7 +278,6 @@ export const WorkItemDetailQuickActions = observer(function WorkItemDetailQuickA
{
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.PROJECT_VIEW });
nestedItem.action();
}}
className={cn(
@@ -322,7 +313,6 @@ export const WorkItemDetailQuickActions = observer(function WorkItemDetailQuickA
{
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.PROJECT_VIEW });
item.action();
}}
className={cn(
diff --git a/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/module-issue.tsx b/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/module-issue.tsx
index 235456a4d9..b8b70edccd 100644
--- a/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/module-issue.tsx
+++ b/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/module-issue.tsx
@@ -3,19 +3,12 @@ import { omit } from "lodash-es";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// plane imports
-import {
- ARCHIVABLE_STATE_GROUPS,
- EUserPermissions,
- EUserPermissionsLevel,
- WORK_ITEM_TRACKER_ELEMENTS,
-} from "@plane/constants";
+import { ARCHIVABLE_STATE_GROUPS, EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import type { TIssue } from "@plane/types";
import { EIssuesStoreType } from "@plane/types";
-import type { TContextMenuItem } from "@plane/ui";
import { ContextMenu, CustomMenu } from "@plane/ui";
import { cn } from "@plane/utils";
// hooks
-import { captureClick } from "@/helpers/event-tracker.helper";
import { useIssues } from "@/hooks/store/use-issues";
import { useProject } from "@/hooks/store/use-project";
import { useProjectState } from "@/hooks/store/use-project-state";
@@ -107,7 +100,6 @@ export const ModuleIssueQuickActions = observer(function ModuleIssueQuickActions
...item,
onClick: () => {
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.MODULE });
item.action();
},
};
@@ -196,7 +188,6 @@ export const ModuleIssueQuickActions = observer(function ModuleIssueQuickActions
{
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.MODULE });
nestedItem.action();
}}
className={cn(
@@ -232,7 +223,6 @@ export const ModuleIssueQuickActions = observer(function ModuleIssueQuickActions
{
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.MODULE });
item.action();
}}
className={cn(
diff --git a/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/project-issue.tsx b/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/project-issue.tsx
index fd53961c1b..4f5cc2768a 100644
--- a/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/project-issue.tsx
+++ b/apps/web/core/components/issues/issue-layouts/quick-action-dropdowns/project-issue.tsx
@@ -3,19 +3,12 @@ import { omit } from "lodash-es";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// plane imports
-import {
- ARCHIVABLE_STATE_GROUPS,
- EUserPermissions,
- EUserPermissionsLevel,
- WORK_ITEM_TRACKER_ELEMENTS,
-} from "@plane/constants";
+import { ARCHIVABLE_STATE_GROUPS, EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import type { TIssue } from "@plane/types";
import { EIssuesStoreType } from "@plane/types";
-import type { TContextMenuItem } from "@plane/ui";
import { ContextMenu, CustomMenu } from "@plane/ui";
import { cn } from "@plane/utils";
// hooks
-import { captureClick } from "@/helpers/event-tracker.helper";
import { useIssues } from "@/hooks/store/use-issues";
import { useProject } from "@/hooks/store/use-project";
import { useProjectState } from "@/hooks/store/use-project-state";
@@ -108,7 +101,6 @@ export const ProjectIssueQuickActions = observer(function ProjectIssueQuickActio
...item,
onClick: () => {
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.PROJECT_VIEW });
item.action();
},
};
@@ -197,7 +189,6 @@ export const ProjectIssueQuickActions = observer(function ProjectIssueQuickActio
{
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.PROJECT_VIEW });
nestedItem.action();
}}
className={cn(
@@ -233,7 +224,6 @@ export const ProjectIssueQuickActions = observer(function ProjectIssueQuickActio
{
- captureClick({ elementName: WORK_ITEM_TRACKER_ELEMENTS.QUICK_ACTIONS.PROJECT_VIEW });
item.action();
}}
className={cn(
diff --git a/apps/web/core/components/issues/issue-layouts/quick-add/root.tsx b/apps/web/core/components/issues/issue-layouts/quick-add/root.tsx
index 33238b67e2..d0505121de 100644
--- a/apps/web/core/components/issues/issue-layouts/quick-add/root.tsx
+++ b/apps/web/core/components/issues/issue-layouts/quick-add/root.tsx
@@ -4,16 +4,12 @@ import { observer } from "mobx-react";
import { useParams } from "next/navigation";
import type { UseFormRegister } from "react-hook-form";
import { useForm } from "react-hook-form";
-
// plane imports
-import { WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { PlusIcon } from "@plane/propel/icons";
import { setPromiseToast } from "@plane/propel/toast";
import type { IProject, TIssue, EIssueLayoutTypes } from "@plane/types";
import { cn, createIssuePayload } from "@plane/utils";
-// helpers
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// plane web imports
import { QuickAddIssueFormRoot } from "@/plane-web/components/issues/quick-add";
// local imports
@@ -128,20 +124,7 @@ export const QuickAddIssueRoot = observer(function QuickAddIssueRoot(props: TQui
},
});
- await quickAddPromise
- .then((res) => {
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.create,
- payload: { id: res?.id },
- });
- })
- .catch((error) => {
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.create,
- payload: { id: payload.id },
- error: error as Error,
- });
- });
+ await quickAddPromise;
}
};
diff --git a/apps/web/core/components/issues/issue-layouts/spreadsheet/columns/cycle-column.tsx b/apps/web/core/components/issues/issue-layouts/spreadsheet/columns/cycle-column.tsx
index d349c7031d..624adacd0f 100644
--- a/apps/web/core/components/issues/issue-layouts/spreadsheet/columns/cycle-column.tsx
+++ b/apps/web/core/components/issues/issue-layouts/spreadsheet/columns/cycle-column.tsx
@@ -1,13 +1,11 @@
-import React, { useCallback } from "react";
+import { useCallback } from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// types
-import { WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
import type { TIssue } from "@plane/types";
// components
import { CycleDropdown } from "@/components/dropdowns/cycle";
// hooks
-import { captureSuccess } from "@/helpers/event-tracker.helper";
import { useIssuesStore } from "@/hooks/use-issue-layout-store";
type Props = {
@@ -30,12 +28,6 @@ export const SpreadsheetCycleColumn = observer(function SpreadsheetCycleColumn(p
if (!workspaceSlug || !issue || !issue.project_id || issue.cycle_id === cycleId) return;
if (cycleId) await addCycleToIssue(workspaceSlug.toString(), issue.project_id, cycleId, issue.id);
else await removeCycleFromIssue(workspaceSlug.toString(), issue.project_id, issue.id);
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: {
- id: issue.id,
- },
- });
},
[workspaceSlug, issue, addCycleToIssue, removeCycleFromIssue]
);
diff --git a/apps/web/core/components/issues/issue-layouts/spreadsheet/columns/module-column.tsx b/apps/web/core/components/issues/issue-layouts/spreadsheet/columns/module-column.tsx
index d8357ecb3f..4717a57255 100644
--- a/apps/web/core/components/issues/issue-layouts/spreadsheet/columns/module-column.tsx
+++ b/apps/web/core/components/issues/issue-layouts/spreadsheet/columns/module-column.tsx
@@ -1,15 +1,12 @@
-import React, { useCallback } from "react";
+import { useCallback } from "react";
import { xor } from "lodash-es";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// types
-import { WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
import type { TIssue } from "@plane/types";
// components
import { ModuleDropdown } from "@/components/dropdowns/module/dropdown";
-// constants
// hooks
-import { captureSuccess } from "@/helpers/event-tracker.helper";
import { useIssuesStore } from "@/hooks/use-issue-layout-store";
type Props = {
@@ -39,13 +36,6 @@ export const SpreadsheetModuleColumn = observer(function SpreadsheetModuleColumn
else modulesToAdd.push(moduleId);
}
changeModulesInIssue(workspaceSlug.toString(), issue.project_id, issue.id, modulesToAdd, modulesToRemove);
-
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: {
- id: issue.id,
- },
- });
},
[workspaceSlug, issue, changeModulesInIssue]
);
diff --git a/apps/web/core/components/issues/issue-layouts/spreadsheet/issue-column.tsx b/apps/web/core/components/issues/issue-layouts/spreadsheet/issue-column.tsx
index bac5e953c9..9265d0005f 100644
--- a/apps/web/core/components/issues/issue-layouts/spreadsheet/issue-column.tsx
+++ b/apps/web/core/components/issues/issue-layouts/spreadsheet/issue-column.tsx
@@ -1,10 +1,7 @@
import { useRef } from "react";
import { observer } from "mobx-react";
// types
-import { WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
import type { IIssueDisplayProperties, TIssue } from "@plane/types";
-// hooks
-import { captureSuccess } from "@/helpers/event-tracker.helper";
// components
import { SPREADSHEET_COLUMNS } from "@/plane-web/components/issues/issue-layouts/utils";
import { shouldRenderColumn } from "@/plane-web/helpers/issue-filter.helper";
@@ -30,6 +27,10 @@ export const IssueColumn = observer(function IssueColumn(props: Props) {
if (!Column) return null;
+ const handleUpdateIssue = async (issue: TIssue, data: Partial) => {
+ if (updateIssue) await updateIssue(issue.project_id, issue.id, data);
+ };
+
return (
) =>
- updateIssue &&
- updateIssue(issue.project_id, issue.id, data).then(() => {
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: {
- id: issue.id,
- },
- });
- })
- }
+ onChange={handleUpdateIssue}
disabled={disableUserActions}
onClose={() => tableCellRef?.current?.focus()}
/>
diff --git a/apps/web/core/components/issues/issue-modal/base.tsx b/apps/web/core/components/issues/issue-modal/base.tsx
index 22d5cda2ae..f6dfe63a81 100644
--- a/apps/web/core/components/issues/issue-modal/base.tsx
+++ b/apps/web/core/components/issues/issue-modal/base.tsx
@@ -1,8 +1,7 @@
-import React, { useEffect, useRef, useState } from "react";
+import { useEffect, useRef, useState } from "react";
import { xor } from "lodash-es";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
-import { WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
// Plane imports
import { useTranslation } from "@plane/i18n";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
@@ -10,7 +9,6 @@ import type { TBaseIssue, TIssue } from "@plane/types";
import { EIssuesStoreType } from "@plane/types";
import { EModalPosition, EModalWidth, ModalCore } from "@plane/ui";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useIssueModal } from "@/hooks/context/use-issue-modal";
import { useCycle } from "@/hooks/store/use-cycle";
import { useIssueDetail } from "@/hooks/store/use-issue-detail";
@@ -241,10 +239,6 @@ export const CreateUpdateIssueModalBase = observer(function CreateUpdateIssueMod
/>
),
});
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.create,
- payload: { id: response.id },
- });
if (!createMore) handleClose();
if (createMore && issueTitleRef) issueTitleRef?.current?.focus();
setDescription("");
@@ -256,11 +250,6 @@ export const CreateUpdateIssueModalBase = observer(function CreateUpdateIssueMod
title: t("error"),
message: error?.error ?? t(is_draft_issue ? "draft_creation_failed" : "issue_creation_failed"),
});
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.create,
- payload: { id: payload.id },
- error: error as Error,
- });
throw error;
}
};
@@ -328,10 +317,6 @@ export const CreateUpdateIssueModalBase = observer(function CreateUpdateIssueMod
/>
) : undefined,
});
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: data.id },
- });
handleClose();
} catch (error: any) {
console.error(error);
@@ -340,11 +325,6 @@ export const CreateUpdateIssueModalBase = observer(function CreateUpdateIssueMod
title: t("error"),
message: error?.error ?? t("issue_could_not_be_updated"),
});
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: data.id },
- error: error as Error,
- });
}
};
diff --git a/apps/web/core/components/issues/issue-modal/draft-issue-layout.tsx b/apps/web/core/components/issues/issue-modal/draft-issue-layout.tsx
index 074482bb22..bb9082422e 100644
--- a/apps/web/core/components/issues/issue-modal/draft-issue-layout.tsx
+++ b/apps/web/core/components/issues/issue-modal/draft-issue-layout.tsx
@@ -1,17 +1,12 @@
-import React, { useState } from "react";
+import { useState } from "react";
import { isEmpty } from "lodash-es";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
-import { WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
+// Plane imports
import { useTranslation } from "@plane/i18n";
-// types
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { TIssue } from "@plane/types";
-// ui
-// components
import { isEmptyHtmlString } from "@plane/utils";
-// helpers
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useIssueModal } from "@/hooks/context/use-issue-modal";
import { useWorkspaceDraftIssues } from "@/hooks/store/workspace-draft";
@@ -90,26 +85,17 @@ export const DraftIssueLayout = observer(function DraftIssueLayout(props: DraftI
title: `${t("success")}!`,
message: t("workspace_draft_issues.toasts.created.success"),
});
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.draft.create,
- payload: { id: res?.id },
- });
onChange(null);
setIssueDiscardModal(false);
onClose();
return res;
})
- .catch((error) => {
+ .catch((_error) => {
setToast({
type: TOAST_TYPE.ERROR,
title: `${t("error")}!`,
message: t("workspace_draft_issues.toasts.created.error"),
});
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.draft.create,
- payload: { id: payload.id },
- error,
- });
});
if (response && handleCreateUpdatePropertyValues) {
diff --git a/apps/web/core/components/issues/peek-overview/header.tsx b/apps/web/core/components/issues/peek-overview/header.tsx
index 623c63c036..98393c3957 100644
--- a/apps/web/core/components/issues/peek-overview/header.tsx
+++ b/apps/web/core/components/issues/peek-overview/header.tsx
@@ -1,10 +1,8 @@
-import type { FC } from "react";
import { useRef } from "react";
import { observer } from "mobx-react";
import Link from "next/link";
import { MoveDiagonal, MoveRight } from "lucide-react";
// plane imports
-import { WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { CenterPanelIcon, CopyLinkIcon, FullScreenPanelIcon, SidePanelIcon } from "@plane/propel/icons";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
@@ -13,13 +11,11 @@ import type { TNameDescriptionLoader } from "@plane/types";
import { EIssuesStoreType } from "@plane/types";
import { CustomSelect } from "@plane/ui";
import { copyUrlToClipboard, generateWorkItemLink } from "@plane/utils";
-// helpers
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
+// hooks
import { useIssueDetail } from "@/hooks/store/use-issue-detail";
import { useIssues } from "@/hooks/store/use-issues";
import { useProject } from "@/hooks/store/use-project";
import { useUser } from "@/hooks/store/user";
-// hooks
import { usePlatformOS } from "@/hooks/use-platform-os";
// local imports
import { IssueSubscription } from "../issue-detail/subscription";
@@ -132,42 +128,21 @@ export const IssuePeekOverviewHeader = observer(function IssuePeekOverviewHeader
return deleteIssue(workspaceSlug, projectId, issueId).then(() => {
setPeekIssue(undefined);
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.delete,
- payload: { id: issueId },
- });
});
- } catch (error) {
+ } catch (_error) {
setToast({
title: t("toast.error"),
type: TOAST_TYPE.ERROR,
message: t("entity.delete.failed", { entity: t("issue.label", { count: 1 }) }),
});
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.delete,
- payload: { id: issueId },
- error: error as Error,
- });
}
};
const handleArchiveIssue = async () => {
- try {
- await archiveIssue(workspaceSlug, projectId, issueId);
- // check and remove if issue is peeked
- if (getIsIssuePeeked(issueId)) {
- removeRoutePeekId();
- }
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.archive,
- payload: { id: issueId },
- });
- } catch (error) {
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.archive,
- payload: { id: issueId },
- error: error as Error,
- });
+ await archiveIssue(workspaceSlug, projectId, issueId);
+ // check and remove if issue is peeked
+ if (getIsIssuePeeked(issueId)) {
+ removeRoutePeekId();
}
};
diff --git a/apps/web/core/components/issues/peek-overview/root.tsx b/apps/web/core/components/issues/peek-overview/root.tsx
index ee0fe9d32a..42bdd0c573 100644
--- a/apps/web/core/components/issues/peek-overview/root.tsx
+++ b/apps/web/core/components/issues/peek-overview/root.tsx
@@ -1,16 +1,14 @@
-import type { FC } from "react";
import { useState, useMemo, useCallback } from "react";
import { observer } from "mobx-react";
import { usePathname } from "next/navigation";
// Plane imports
import useSWR from "swr";
-import { EUserPermissions, EUserPermissionsLevel, WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
+import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { TOAST_TYPE, setPromiseToast, setToast } from "@plane/propel/toast";
import type { IWorkItemPeekOverview, TIssue } from "@plane/types";
import { EIssueServiceType, EIssuesStoreType } from "@plane/types";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useIssueDetail } from "@/hooks/store/use-issue-detail";
import { useIssues } from "@/hooks/store/use-issues";
import { useUserPermissions } from "@/hooks/store/user";
@@ -77,18 +75,9 @@ export const IssuePeekOverview = observer(function IssuePeekOverview(props: IWor
.updateIssue(workspaceSlug, projectId, issueId, data)
.then(async () => {
fetchActivities(workspaceSlug, projectId, issueId);
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- });
return;
})
.catch((error) => {
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- error: error as Error,
- });
setToast({
title: t("toast.error"),
type: TOAST_TYPE.ERROR,
@@ -100,40 +89,23 @@ export const IssuePeekOverview = observer(function IssuePeekOverview(props: IWor
remove: async (workspaceSlug: string, projectId: string, issueId: string) => {
try {
return issues?.removeIssue(workspaceSlug, projectId, issueId).then(() => {
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.delete,
- payload: { id: issueId },
- });
removeRoutePeekId();
return;
});
- } catch (error) {
+ } catch (_error) {
setToast({
title: t("toast.error"),
type: TOAST_TYPE.ERROR,
message: t("entity.delete.failed", { entity: t("issue.label", { count: 1 }) }),
});
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.delete,
- payload: { id: issueId },
- error: error as Error,
- });
}
},
archive: async (workspaceSlug: string, projectId: string, issueId: string) => {
try {
if (!issues?.archiveIssue) return;
await issues.archiveIssue(workspaceSlug, projectId, issueId);
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.archive,
- payload: { id: issueId },
- });
} catch (error) {
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.archive,
- payload: { id: issueId },
- error: error as Error,
- });
+ console.error("Error archiving the issue", error);
}
},
restore: async (workspaceSlug: string, projectId: string, issueId: string) => {
@@ -144,62 +116,35 @@ export const IssuePeekOverview = observer(function IssuePeekOverview(props: IWor
title: t("issue.restore.success.title"),
message: t("issue.restore.success.message"),
});
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.restore,
- payload: { id: issueId },
- });
- } catch (error) {
+ } catch (_error) {
setToast({
type: TOAST_TYPE.ERROR,
title: t("toast.error"),
message: t("issue.restore.failed.message"),
});
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.restore,
- payload: { id: issueId },
- error: error as Error,
- });
}
},
addCycleToIssue: async (workspaceSlug: string, projectId: string, cycleId: string, issueId: string) => {
try {
await issues.addCycleToIssue(workspaceSlug, projectId, cycleId, issueId);
fetchActivities(workspaceSlug, projectId, issueId);
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- });
- } catch (error) {
+ } catch (_error) {
setToast({
type: TOAST_TYPE.ERROR,
title: t("toast.error"),
message: t("issue.add.cycle.failed"),
});
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- error: error as Error,
- });
}
},
addIssueToCycle: async (workspaceSlug: string, projectId: string, cycleId: string, issueIds: string[]) => {
try {
await issues.addIssueToCycle(workspaceSlug, projectId, cycleId, issueIds);
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueIds },
- });
- } catch (error) {
+ } catch (_error) {
setToast({
type: TOAST_TYPE.ERROR,
title: t("toast.error"),
message: t("issue.add.cycle.failed"),
});
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueIds },
- error: error as Error,
- });
}
},
removeIssueFromCycle: async (workspaceSlug: string, projectId: string, cycleId: string, issueId: string) => {
@@ -218,16 +163,8 @@ export const IssuePeekOverview = observer(function IssuePeekOverview(props: IWor
});
await removeFromCyclePromise;
fetchActivities(workspaceSlug, projectId, issueId);
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- });
} catch (error) {
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- error: error as Error,
- });
+ console.error("Error removing issue from cycle", error);
}
},
changeModulesInIssue: async (
@@ -245,10 +182,6 @@ export const IssuePeekOverview = observer(function IssuePeekOverview(props: IWor
removeModuleIds
);
fetchActivities(workspaceSlug, projectId, issueId);
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- });
return promise;
},
removeIssueFromModule: async (workspaceSlug: string, projectId: string, moduleId: string, issueId: string) => {
@@ -267,16 +200,8 @@ export const IssuePeekOverview = observer(function IssuePeekOverview(props: IWor
});
await removeFromModulePromise;
fetchActivities(workspaceSlug, projectId, issueId);
- captureSuccess({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- });
} catch (error) {
- captureError({
- eventName: WORK_ITEM_TRACKER_EVENTS.update,
- payload: { id: issueId },
- error: error as Error,
- });
+ console.error("Error removing issue from module", error);
}
},
}),
diff --git a/apps/web/core/components/issues/workspace-draft/root.tsx b/apps/web/core/components/issues/workspace-draft/root.tsx
index 7fc987992d..fd1d167429 100644
--- a/apps/web/core/components/issues/workspace-draft/root.tsx
+++ b/apps/web/core/components/issues/workspace-draft/root.tsx
@@ -1,15 +1,13 @@
-import type { FC } from "react";
import { Fragment } from "react";
import { observer } from "mobx-react";
import useSWR from "swr";
// plane imports
-import { EUserPermissionsLevel, EDraftIssuePaginationType, PROJECT_TRACKER_ELEMENTS } from "@plane/constants";
+import { EUserPermissionsLevel, EDraftIssuePaginationType } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { EmptyStateDetailed } from "@plane/propel/empty-state";
import { EUserWorkspaceRoles } from "@plane/types";
// components
import { cn } from "@plane/utils";
-import { captureClick } from "@/helpers/event-tracker.helper";
// hooks
import { useCommandPalette } from "@/hooks/store/use-command-palette";
import { useProject } from "@/hooks/store/use-project";
@@ -72,7 +70,6 @@ export const WorkspaceDraftIssuesRoot = observer(function WorkspaceDraftIssuesRo
label: t("workspace_projects.empty_state.no_projects.primary_button.text"),
onClick: () => {
toggleCreateProjectModal(true);
- captureClick({ elementName: PROJECT_TRACKER_ELEMENTS.EMPTY_STATE_CREATE_PROJECT_BUTTON });
},
disabled: !hasMemberLevelPermission,
variant: "primary",
diff --git a/apps/web/core/components/labels/create-update-label-inline.tsx b/apps/web/core/components/labels/create-update-label-inline.tsx
index e9c2fc85dc..73cf4ebe80 100644
--- a/apps/web/core/components/labels/create-update-label-inline.tsx
+++ b/apps/web/core/components/labels/create-update-label-inline.tsx
@@ -11,7 +11,6 @@ import { Button } from "@plane/propel/button";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IIssueLabel } from "@plane/types";
import { Input } from "@plane/ui";
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// error codes
const errorCodes = {
@@ -87,25 +86,10 @@ export const CreateUpdateLabelInline = observer(
await labelOperationsCallbacks
.createLabel(formData)
.then((res) => {
- captureSuccess({
- eventName: PROJECT_SETTINGS_TRACKER_EVENTS.label_created,
- payload: {
- name: res.name,
- id: res.id,
- },
- });
handleClose();
reset(defaultValues);
})
.catch((error) => {
- captureError({
- eventName: PROJECT_SETTINGS_TRACKER_EVENTS.label_created,
- payload: {
- name: formData.name,
- },
- error,
- });
-
const errorMessage = getErrorMessage(error, "create");
setToast({
title: "Error!",
@@ -122,25 +106,10 @@ export const CreateUpdateLabelInline = observer(
await labelOperationsCallbacks
.updateLabel(labelToUpdate.id, formData)
.then((res) => {
- captureSuccess({
- eventName: PROJECT_SETTINGS_TRACKER_EVENTS.label_updated,
- payload: {
- name: res.name,
- id: res.id,
- },
- });
reset(defaultValues);
handleClose();
})
.catch((error) => {
- captureError({
- eventName: PROJECT_SETTINGS_TRACKER_EVENTS.label_updated,
- payload: {
- name: formData.name,
- id: labelToUpdate.id,
- },
- error,
- });
const errorMessage = getErrorMessage(error, "update");
setToast({
title: "Oops!",
diff --git a/apps/web/core/components/labels/delete-label-modal.tsx b/apps/web/core/components/labels/delete-label-modal.tsx
index eb3dc77bbe..3528f2963c 100644
--- a/apps/web/core/components/labels/delete-label-modal.tsx
+++ b/apps/web/core/components/labels/delete-label-modal.tsx
@@ -1,14 +1,12 @@
-import React, { useState } from "react";
+import { useState } from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// types
-import { PROJECT_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IIssueLabel } from "@plane/types";
// ui
import { AlertModalCore } from "@plane/ui";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useLabel } from "@/hooks/store/use-label";
type Props = {
@@ -38,27 +36,10 @@ export const DeleteLabelModal = observer(function DeleteLabelModal(props: Props)
await deleteLabel(workspaceSlug.toString(), projectId.toString(), data.id)
.then(() => {
- captureSuccess({
- eventName: PROJECT_SETTINGS_TRACKER_EVENTS.label_deleted,
- payload: {
- name: data.name,
- project_id: projectId,
- },
- });
handleClose();
})
.catch((err) => {
setIsDeleteLoading(false);
-
- captureError({
- eventName: PROJECT_SETTINGS_TRACKER_EVENTS.label_deleted,
- payload: {
- name: data.name,
- project_id: projectId,
- },
- error: err,
- });
-
const error = err?.error || "Label could not be deleted. Please try again.";
setToast({
type: TOAST_TYPE.ERROR,
diff --git a/apps/web/core/components/labels/project-setting-label-group.tsx b/apps/web/core/components/labels/project-setting-label-group.tsx
index 2400f28159..e6c507dc80 100644
--- a/apps/web/core/components/labels/project-setting-label-group.tsx
+++ b/apps/web/core/components/labels/project-setting-label-group.tsx
@@ -1,16 +1,11 @@
import type { Dispatch, SetStateAction } from "react";
-import React, { useState } from "react";
+import { useState } from "react";
import { observer } from "mobx-react";
-
import { Disclosure, Transition } from "@headlessui/react";
-import { PROJECT_SETTINGS_TRACKER_ELEMENTS } from "@plane/constants";
+// plane imports
import { EditIcon, TrashIcon, ChevronDownIcon } from "@plane/propel/icons";
-// store
-// icons
-// types
import type { IIssueLabel } from "@plane/types";
// components
-import { captureClick } from "@/helpers/event-tracker.helper";
import type { TLabelOperationsCallbacks } from "./create-update-label-inline";
import { CreateUpdateLabelInline } from "./create-update-label-inline";
import type { ICustomMenuItem } from "./label-block/label-item-block";
@@ -55,9 +50,6 @@ export const ProjectSettingLabelGroup = observer(function ProjectSettingLabelGro
{
CustomIcon: EditIcon,
onClick: () => {
- captureClick({
- elementName: PROJECT_SETTINGS_TRACKER_ELEMENTS.LABELS_CONTEXT_MENU,
- });
setEditLabelForm(true);
setIsUpdating(true);
},
@@ -68,9 +60,6 @@ export const ProjectSettingLabelGroup = observer(function ProjectSettingLabelGro
{
CustomIcon: TrashIcon,
onClick: () => {
- captureClick({
- elementName: PROJECT_SETTINGS_TRACKER_ELEMENTS.LABELS_CONTEXT_MENU,
- });
handleLabelDelete(label);
},
isVisible: true,
diff --git a/apps/web/core/components/labels/project-setting-label-item.tsx b/apps/web/core/components/labels/project-setting-label-item.tsx
index 98de2e6096..53c26f3753 100644
--- a/apps/web/core/components/labels/project-setting-label-item.tsx
+++ b/apps/web/core/components/labels/project-setting-label-item.tsx
@@ -1,13 +1,10 @@
import type { Dispatch, SetStateAction } from "react";
-import React, { useState } from "react";
+import { useState } from "react";
import { useParams } from "next/navigation";
-
-import { PROJECT_SETTINGS_TRACKER_ELEMENTS } from "@plane/constants";
import { EditIcon, CloseIcon } from "@plane/propel/icons";
// types
import type { IIssueLabel } from "@plane/types";
// hooks
-import { captureClick } from "@/helpers/event-tracker.helper";
import { useLabel } from "@/hooks/store/use-label";
// components
import type { TLabelOperationsCallbacks } from "./create-update-label-inline";
@@ -73,9 +70,6 @@ export function ProjectSettingLabelItem(props: Props) {
onClick: () => {
setEditLabelForm(true);
setIsUpdating(true);
- captureClick({
- elementName: PROJECT_SETTINGS_TRACKER_ELEMENTS.LABELS_CONTEXT_MENU,
- });
},
isVisible: true,
text: "Edit label",
diff --git a/apps/web/core/components/labels/project-setting-label-list.tsx b/apps/web/core/components/labels/project-setting-label-list.tsx
index f407ed14aa..1791c003b9 100644
--- a/apps/web/core/components/labels/project-setting-label-list.tsx
+++ b/apps/web/core/components/labels/project-setting-label-list.tsx
@@ -1,8 +1,8 @@
-import React, { useState, useRef } from "react";
+import { useState, useRef } from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// plane imports
-import { EUserPermissions, EUserPermissionsLevel, PROJECT_SETTINGS_TRACKER_ELEMENTS } from "@plane/constants";
+import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { EmptyStateCompact } from "@plane/propel/empty-state";
import type { IIssueLabel } from "@plane/types";
@@ -15,7 +15,6 @@ import {
ProjectSettingLabelItem,
} from "@/components/labels";
// hooks
-import { captureClick } from "@/helpers/event-tracker.helper";
import { useLabel } from "@/hooks/store/use-label";
import { useUserPermissions } from "@/hooks/store/user";
// local imports
@@ -81,9 +80,6 @@ export const ProjectSettingsLabelList = observer(function ProjectSettingsLabelLi
label: t("common.add_label"),
onClick: () => {
newLabel();
- captureClick({
- elementName: PROJECT_SETTINGS_TRACKER_ELEMENTS.LABELS_HEADER_CREATE_BUTTON,
- });
},
}}
showButton={isEditable}
@@ -117,9 +113,6 @@ export const ProjectSettingsLabelList = observer(function ProjectSettingsLabelLi
label: t("settings_empty_state.labels.cta_primary"),
onClick: () => {
newLabel();
- captureClick({
- elementName: PROJECT_SETTINGS_TRACKER_ELEMENTS.LABELS_EMPTY_STATE_CREATE_BUTTON,
- });
},
},
]}
diff --git a/apps/web/core/components/modules/analytics-sidebar/root.tsx b/apps/web/core/components/modules/analytics-sidebar/root.tsx
index 297cdedecc..aa768730bb 100644
--- a/apps/web/core/components/modules/analytics-sidebar/root.tsx
+++ b/apps/web/core/components/modules/analytics-sidebar/root.tsx
@@ -1,17 +1,10 @@
-import React, { useEffect, useState } from "react";
+import { useEffect, useState } from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
import { Controller, useForm } from "react-hook-form";
import { Info, SquareUser } from "lucide-react";
import { Disclosure, Transition } from "@headlessui/react";
-import {
- MODULE_STATUS,
- EUserPermissions,
- EUserPermissionsLevel,
- EEstimateSystem,
- MODULE_TRACKER_EVENTS,
- MODULE_TRACKER_ELEMENTS,
-} from "@plane/constants";
+import { MODULE_STATUS, EUserPermissions, EUserPermissionsLevel, EEstimateSystem } from "@plane/constants";
// plane types
import { useTranslation } from "@plane/i18n";
import {
@@ -33,7 +26,6 @@ import { getDate, renderFormattedPayloadDate } from "@plane/utils";
import { DateRangeDropdown } from "@/components/dropdowns/date-range";
import { MemberDropdown } from "@/components/dropdowns/member/dropdown";
import { CreateUpdateModuleLinkModal, ModuleAnalyticsProgress, ModuleLinksList } from "@/components/modules";
-import { captureElementAndEvent, captureSuccess, captureError } from "@/helpers/event-tracker.helper";
// hooks
import { useProjectEstimates } from "@/hooks/store/estimates";
import { useModule } from "@/hooks/store/use-module";
@@ -79,98 +71,39 @@ export const ModuleAnalyticsSidebar = observer(function ModuleAnalyticsSidebar(p
defaultValues,
});
- const submitChanges = (data: Partial) => {
+ const submitChanges = async (data: Partial) => {
if (!workspaceSlug || !projectId || !moduleId) return;
- updateModuleDetails(workspaceSlug.toString(), projectId.toString(), moduleId.toString(), data)
- .then((res) => {
- captureElementAndEvent({
- element: {
- elementName: MODULE_TRACKER_ELEMENTS.RIGHT_SIDEBAR,
- },
- event: {
- eventName: MODULE_TRACKER_EVENTS.update,
- payload: { id: res.id },
- state: "SUCCESS",
- },
- });
- })
- .catch((error) => {
- captureError({
- eventName: MODULE_TRACKER_EVENTS.update,
- payload: { id: moduleId },
- error,
- });
- });
+ await updateModuleDetails(workspaceSlug.toString(), projectId.toString(), moduleId.toString(), data);
};
const handleCreateLink = async (formData: ModuleLink) => {
if (!workspaceSlug || !projectId || !moduleId) return;
-
const payload = { metadata: {}, ...formData };
-
- await createModuleLink(workspaceSlug.toString(), projectId.toString(), moduleId.toString(), payload)
- .then(() =>
- captureSuccess({
- eventName: MODULE_TRACKER_EVENTS.link.create,
- payload: { id: moduleId },
- })
- )
- .catch((error) => {
- captureError({
- eventName: MODULE_TRACKER_EVENTS.link.create,
- payload: { id: moduleId },
- error,
- });
- });
+ await createModuleLink(workspaceSlug.toString(), projectId.toString(), moduleId.toString(), payload);
};
const handleUpdateLink = async (formData: ModuleLink, linkId: string) => {
if (!workspaceSlug || !projectId) return;
-
const payload = { metadata: {}, ...formData };
-
- await updateModuleLink(workspaceSlug.toString(), projectId.toString(), moduleId.toString(), linkId, payload)
- .then(() =>
- captureSuccess({
- eventName: MODULE_TRACKER_EVENTS.link.update,
- payload: { id: moduleId },
- })
- )
- .catch((error) => {
- captureError({
- eventName: MODULE_TRACKER_EVENTS.link.update,
- payload: { id: moduleId },
- error,
- });
- });
+ await updateModuleLink(workspaceSlug.toString(), projectId.toString(), moduleId.toString(), linkId, payload);
};
const handleDeleteLink = async (linkId: string) => {
if (!workspaceSlug || !projectId) return;
-
- deleteModuleLink(workspaceSlug.toString(), projectId.toString(), moduleId.toString(), linkId)
- .then(() => {
- captureSuccess({
- eventName: MODULE_TRACKER_EVENTS.link.delete,
- payload: { id: moduleId },
- });
- setToast({
- type: TOAST_TYPE.SUCCESS,
- title: "Success!",
- message: "Module link deleted successfully.",
- });
- })
- .catch(() => {
- setToast({
- type: TOAST_TYPE.ERROR,
- title: "Error!",
- message: "Some error occurred",
- });
- captureError({
- eventName: MODULE_TRACKER_EVENTS.link.delete,
- payload: { id: moduleId },
- });
+ try {
+ await deleteModuleLink(workspaceSlug.toString(), projectId.toString(), moduleId.toString(), linkId);
+ setToast({
+ type: TOAST_TYPE.SUCCESS,
+ title: "Success!",
+ message: "Module link deleted successfully.",
});
+ } catch (_error) {
+ setToast({
+ type: TOAST_TYPE.ERROR,
+ title: "Error!",
+ message: "Some error occurred",
+ });
+ }
};
const handleDateChange = async (startDate: Date | undefined, targetDate: Date | undefined) => {
diff --git a/apps/web/core/components/modules/delete-module-modal.tsx b/apps/web/core/components/modules/delete-module-modal.tsx
index 755e3789db..a803ebe658 100644
--- a/apps/web/core/components/modules/delete-module-modal.tsx
+++ b/apps/web/core/components/modules/delete-module-modal.tsx
@@ -1,16 +1,14 @@
-import React, { useState } from "react";
+import { useState } from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// types
-import { MODULE_TRACKER_EVENTS, PROJECT_ERROR_MESSAGES } from "@plane/constants";
+import { PROJECT_ERROR_MESSAGES } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IModule } from "@plane/types";
// ui
import { AlertModalCore } from "@plane/ui";
// constants
-// helpers
-import { captureSuccess, captureError } from "@/helpers/event-tracker.helper";
// hooks
import { useModule } from "@/hooks/store/use-module";
import { useAppRouter } from "@/hooks/use-app-router";
@@ -51,10 +49,6 @@ export const DeleteModuleModal = observer(function DeleteModuleModal(props: Prop
title: "Success!",
message: "Module deleted successfully.",
});
- captureSuccess({
- eventName: MODULE_TRACKER_EVENTS.delete,
- payload: { id: data.id },
- });
})
.catch((errors) => {
const isPermissionError = errors?.error === "You don't have the required permissions.";
@@ -66,11 +60,6 @@ export const DeleteModuleModal = observer(function DeleteModuleModal(props: Prop
type: TOAST_TYPE.ERROR,
message: currentError.i18n_message && t(currentError.i18n_message),
});
- captureError({
- eventName: MODULE_TRACKER_EVENTS.delete,
- payload: { id: data.id },
- error: errors,
- });
})
.finally(() => handleClose());
};
diff --git a/apps/web/core/components/modules/modal.tsx b/apps/web/core/components/modules/modal.tsx
index 9fad3c7630..c71bc5f9f5 100644
--- a/apps/web/core/components/modules/modal.tsx
+++ b/apps/web/core/components/modules/modal.tsx
@@ -1,17 +1,12 @@
-import React, { useEffect, useState } from "react";
+import { useEffect, useState } from "react";
import { observer } from "mobx-react";
import { useForm } from "react-hook-form";
-// types
-import { MODULE_TRACKER_EVENTS } from "@plane/constants";
+// Plane imports
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IModule } from "@plane/types";
-// ui
import { EModalPosition, EModalWidth, ModalCore } from "@plane/ui";
// components
import { ModuleForm } from "@/components/modules";
-// constants
-// helpers
-import { captureSuccess, captureError } from "@/helpers/event-tracker.helper";
// hooks
import { useModule } from "@/hooks/store/use-module";
import { useProject } from "@/hooks/store/use-project";
@@ -64,10 +59,6 @@ export const CreateUpdateModuleModal = observer(function CreateUpdateModuleModal
title: "Success!",
message: "Module created successfully.",
});
- captureSuccess({
- eventName: MODULE_TRACKER_EVENTS.create,
- payload: { id: res.id },
- });
})
.catch((err) => {
setToast({
@@ -75,11 +66,6 @@ export const CreateUpdateModuleModal = observer(function CreateUpdateModuleModal
title: "Error!",
message: err?.detail ?? err?.error ?? "Module could not be created. Please try again.",
});
- captureError({
- eventName: MODULE_TRACKER_EVENTS.create,
- payload: { id: data?.id },
- error: err,
- });
});
};
@@ -96,10 +82,6 @@ export const CreateUpdateModuleModal = observer(function CreateUpdateModuleModal
title: "Success!",
message: "Module updated successfully.",
});
- captureSuccess({
- eventName: MODULE_TRACKER_EVENTS.update,
- payload: { id: res.id },
- });
})
.catch((err) => {
setToast({
@@ -107,11 +89,6 @@ export const CreateUpdateModuleModal = observer(function CreateUpdateModuleModal
title: "Error!",
message: err?.detail ?? err?.error ?? "Module could not be updated. Please try again.",
});
- captureError({
- eventName: MODULE_TRACKER_EVENTS.update,
- payload: { id: data.id },
- error: err,
- });
});
};
diff --git a/apps/web/core/components/modules/module-card-item.tsx b/apps/web/core/components/modules/module-card-item.tsx
index eb519a1b37..69a8b5dbf1 100644
--- a/apps/web/core/components/modules/module-card-item.tsx
+++ b/apps/web/core/components/modules/module-card-item.tsx
@@ -11,8 +11,6 @@ import {
EUserPermissions,
EUserPermissionsLevel,
IS_FAVORITE_MENU_OPEN,
- MODULE_TRACKER_EVENTS,
- MODULE_TRACKER_ELEMENTS,
} from "@plane/constants";
import { useLocalStorage } from "@plane/hooks";
import { WorkItemsIcon } from "@plane/propel/icons";
@@ -26,8 +24,6 @@ import { DateRangeDropdown } from "@/components/dropdowns/date-range";
import { ButtonAvatars } from "@/components/dropdowns/member/avatar";
import { ModuleQuickActions } from "@/components/modules";
import { ModuleStatusDropdown } from "@/components/modules/module-status-dropdown";
-// helpers
-import { captureElementAndEvent } from "@/helpers/event-tracker.helper";
// hooks
import { useMember } from "@/hooks/store/use-member";
import { useModule } from "@/hooks/store/use-module";
@@ -72,16 +68,6 @@ export const ModuleCardItem = observer(function ModuleCardItem(props: Props) {
const addToFavoritePromise = addModuleToFavorites(workspaceSlug.toString(), projectId.toString(), moduleId).then(
() => {
if (!storedValue) toggleFavoriteMenu(true);
- captureElementAndEvent({
- element: {
- elementName: MODULE_TRACKER_ELEMENTS.CARD_ITEM,
- },
- event: {
- eventName: MODULE_TRACKER_EVENTS.favorite,
- payload: { id: moduleId },
- state: "SUCCESS",
- },
- });
}
);
@@ -107,18 +93,7 @@ export const ModuleCardItem = observer(function ModuleCardItem(props: Props) {
workspaceSlug.toString(),
projectId.toString(),
moduleId
- ).then(() => {
- captureElementAndEvent({
- element: {
- elementName: MODULE_TRACKER_ELEMENTS.CARD_ITEM,
- },
- event: {
- eventName: MODULE_TRACKER_EVENTS.unfavorite,
- payload: { id: moduleId },
- state: "SUCCESS",
- },
- });
- });
+ );
setPromiseToast(removeFromFavoritePromise, {
loading: "Removing module from favorites...",
diff --git a/apps/web/core/components/modules/module-list-item-action.tsx b/apps/web/core/components/modules/module-list-item-action.tsx
index 16495004f4..999cc5a938 100644
--- a/apps/web/core/components/modules/module-list-item-action.tsx
+++ b/apps/web/core/components/modules/module-list-item-action.tsx
@@ -1,10 +1,8 @@
-import type { FC } from "react";
import React from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
-// icons
import { SquareUser } from "lucide-react";
-// types
+// Plane imports
import {
MODULE_STATUS,
EUserPermissions,
@@ -18,16 +16,12 @@ import { useTranslation } from "@plane/i18n";
import { TOAST_TYPE, setPromiseToast, setToast } from "@plane/propel/toast";
import { Tooltip } from "@plane/propel/tooltip";
import type { IModule } from "@plane/types";
-// ui
import { FavoriteStar } from "@plane/ui";
-// components
import { renderFormattedPayloadDate, getDate } from "@plane/utils";
+// components
import { DateRangeDropdown } from "@/components/dropdowns/date-range";
import { ModuleQuickActions } from "@/components/modules";
import { ModuleStatusDropdown } from "@/components/modules/module-status-dropdown";
-// constants
-// helpers
-import { captureElementAndEvent, captureError } from "@/helpers/event-tracker.helper";
// hooks
import { useMember } from "@/hooks/store/use-member";
import { useModule } from "@/hooks/store/use-module";
@@ -69,28 +63,12 @@ export const ModuleListItemAction = observer(function ModuleListItemAction(props
e.preventDefault();
if (!workspaceSlug || !projectId) return;
- const addToFavoritePromise = addModuleToFavorites(workspaceSlug.toString(), projectId.toString(), moduleId)
- .then(() => {
+ const addToFavoritePromise = addModuleToFavorites(workspaceSlug.toString(), projectId.toString(), moduleId).then(
+ () => {
// open favorites menu if closed
if (!storedValue) toggleFavoriteMenu(true);
- captureElementAndEvent({
- element: {
- elementName: MODULE_TRACKER_ELEMENTS.LIST_ITEM,
- },
- event: {
- eventName: MODULE_TRACKER_EVENTS.favorite,
- payload: { id: moduleId },
- state: "SUCCESS",
- },
- });
- })
- .catch((error) => {
- captureError({
- eventName: MODULE_TRACKER_EVENTS.favorite,
- payload: { id: moduleId },
- error,
- });
- });
+ }
+ );
setPromiseToast(addToFavoritePromise, {
loading: "Adding module to favorites...",
@@ -114,26 +92,7 @@ export const ModuleListItemAction = observer(function ModuleListItemAction(props
workspaceSlug.toString(),
projectId.toString(),
moduleId
- )
- .then(() => {
- captureElementAndEvent({
- element: {
- elementName: MODULE_TRACKER_ELEMENTS.LIST_ITEM,
- },
- event: {
- eventName: MODULE_TRACKER_EVENTS.unfavorite,
- payload: { id: moduleId },
- state: "SUCCESS",
- },
- });
- })
- .catch((error) => {
- captureError({
- eventName: MODULE_TRACKER_EVENTS.unfavorite,
- payload: { id: moduleId },
- error,
- });
- });
+ );
setPromiseToast(removeFromFavoritePromise, {
loading: "Removing module from favorites...",
diff --git a/apps/web/core/components/modules/quick-actions.tsx b/apps/web/core/components/modules/quick-actions.tsx
index 711cb603ab..4638cd2603 100644
--- a/apps/web/core/components/modules/quick-actions.tsx
+++ b/apps/web/core/components/modules/quick-actions.tsx
@@ -1,14 +1,8 @@
import { useState } from "react";
import { observer } from "mobx-react";
import { MoreHorizontal } from "lucide-react";
-
// plane imports
-import {
- EUserPermissions,
- EUserPermissionsLevel,
- MODULE_TRACKER_ELEMENTS,
- MODULE_TRACKER_EVENTS,
-} from "@plane/constants";
+import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { IconButton } from "@plane/propel/icon-button";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
@@ -18,8 +12,6 @@ import { copyUrlToClipboard, cn } from "@plane/utils";
// components
import { useModuleMenuItems } from "@/components/common/quick-actions-helper";
import { ArchiveModuleModal, CreateUpdateModuleModal, DeleteModuleModal } from "@/components/modules";
-// helpers
-import { captureClick, captureSuccess, captureError } from "@/helpers/event-tracker.helper";
// hooks
import { useModule } from "@/hooks/store/use-module";
import { useUserPermissions } from "@/hooks/store/user";
@@ -68,32 +60,23 @@ export const ModuleQuickActions = observer(function ModuleQuickActions(props: Pr
});
const handleOpenInNewTab = () => window.open(`/${moduleLink}`, "_blank");
- const handleRestoreModule = async () =>
- await restoreModule(workspaceSlug, projectId, moduleId)
- .then(() => {
- setToast({
- type: TOAST_TYPE.SUCCESS,
- title: "Restore success",
- message: "Your module can be found in project modules.",
- });
- captureSuccess({
- eventName: MODULE_TRACKER_EVENTS.restore,
- payload: { id: moduleId },
- });
- router.push(`/${workspaceSlug}/projects/${projectId}/archives/modules`);
- })
- .catch((error) => {
- setToast({
- type: TOAST_TYPE.ERROR,
- title: "Error!",
- message: "Module could not be restored. Please try again.",
- });
- captureError({
- eventName: MODULE_TRACKER_EVENTS.restore,
- payload: { id: moduleId },
- error,
- });
+ const handleRestoreModule = async () => {
+ try {
+ await restoreModule(workspaceSlug, projectId, moduleId);
+ setToast({
+ type: TOAST_TYPE.SUCCESS,
+ title: "Restore success",
+ message: "Your module can be found in project modules.",
});
+ router.push(`/${workspaceSlug}/projects/${projectId}/archives/modules`);
+ } catch (_error) {
+ setToast({
+ type: TOAST_TYPE.ERROR,
+ title: "Error!",
+ message: "Module could not be restored. Please try again.",
+ });
+ }
+ };
// Use unified menu hook from plane-web (resolves to CE or EE)
const menuResult = useModuleMenuItems({
@@ -119,9 +102,6 @@ export const ModuleQuickActions = observer(function ModuleQuickActions(props: Pr
...item,
onClick: () => {
- captureClick({
- elementName: MODULE_TRACKER_ELEMENTS.CONTEXT_MENU,
- });
item.action();
},
};
@@ -162,9 +142,6 @@ export const ModuleQuickActions = observer(function ModuleQuickActions(props: Pr
{
- captureClick({
- elementName: MODULE_TRACKER_ELEMENTS.QUICK_ACTIONS,
- });
item.action();
}}
className={cn(
diff --git a/apps/web/core/components/navigation/project-actions-menu.tsx b/apps/web/core/components/navigation/project-actions-menu.tsx
index 1eab05815b..0637e9b9cb 100644
--- a/apps/web/core/components/navigation/project-actions-menu.tsx
+++ b/apps/web/core/components/navigation/project-actions-menu.tsx
@@ -1,4 +1,3 @@
-import type { FC } from "react";
import { useState, useRef } from "react";
import { useNavigate } from "react-router";
import { LogOut, MoreHorizontal, Settings, Share2, ArchiveIcon } from "lucide-react";
diff --git a/apps/web/core/components/onboarding/create-workspace.tsx b/apps/web/core/components/onboarding/create-workspace.tsx
index 163c606cb9..4f145e1bef 100644
--- a/apps/web/core/components/onboarding/create-workspace.tsx
+++ b/apps/web/core/components/onboarding/create-workspace.tsx
@@ -2,12 +2,7 @@ import { useState } from "react";
import { observer } from "mobx-react";
import { Controller, useForm } from "react-hook-form";
// constants
-import {
- ORGANIZATION_SIZE,
- RESTRICTED_URLS,
- WORKSPACE_TRACKER_EVENTS,
- WORKSPACE_TRACKER_ELEMENTS,
-} from "@plane/constants";
+import { ORGANIZATION_SIZE, RESTRICTED_URLS } from "@plane/constants";
// types
import { useTranslation } from "@plane/i18n";
import { Button } from "@plane/propel/button";
@@ -16,7 +11,6 @@ import type { IUser, IWorkspace, TOnboardingSteps } from "@plane/types";
// ui
import { CustomSelect, Input, Spinner } from "@plane/ui";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useWorkspace } from "@/hooks/store/use-workspace";
import { useUserProfile, useUserSettings } from "@/hooks/store/user";
// services
@@ -61,47 +55,26 @@ export const CreateWorkspace = observer(function CreateWorkspace(props: Props) {
const handleCreateWorkspace = async (formData: IWorkspace) => {
if (isSubmitting) return;
- await workspaceService
- .workspaceSlugCheck(formData.slug)
- .then(async (res) => {
- if (res.status === true && !RESTRICTED_URLS.includes(formData.slug)) {
- setSlugError(false);
-
- await createWorkspace(formData)
- .then(async (workspaceResponse) => {
- setToast({
- type: TOAST_TYPE.SUCCESS,
- title: t("workspace_creation.toast.success.title"),
- message: t("workspace_creation.toast.success.message"),
- });
- captureSuccess({
- eventName: WORKSPACE_TRACKER_EVENTS.create,
- payload: { slug: formData.slug },
- });
- await fetchWorkspaces();
- await completeStep(workspaceResponse.id);
- })
- .catch(() => {
- captureError({
- eventName: WORKSPACE_TRACKER_EVENTS.create,
- payload: { slug: formData.slug },
- error: new Error("Error creating workspace"),
- });
- setToast({
- type: TOAST_TYPE.ERROR,
- title: t("workspace_creation.toast.error.title"),
- message: t("workspace_creation.toast.error.message"),
- });
- });
- } else setSlugError(true);
- })
- .catch(() =>
+ try {
+ const res = await workspaceService.workspaceSlugCheck(formData.slug);
+ if (res?.status === true && !RESTRICTED_URLS.includes(formData.slug)) {
+ setSlugError(false);
+ const workspaceResponse = await createWorkspace(formData);
setToast({
- type: TOAST_TYPE.ERROR,
- title: t("workspace_creation.toast.error.title"),
- message: t("workspace_creation.toast.error.message"),
- })
- );
+ type: TOAST_TYPE.SUCCESS,
+ title: t("workspace_creation.toast.success.title"),
+ message: t("workspace_creation.toast.success.message"),
+ });
+ await fetchWorkspaces();
+ await completeStep(workspaceResponse.id);
+ } else setSlugError(true);
+ } catch (_error) {
+ setToast({
+ type: TOAST_TYPE.ERROR,
+ title: t("workspace_creation.toast.error.title"),
+ message: t("workspace_creation.toast.error.message"),
+ });
+ }
};
const completeStep = async (workspaceId: string) => {
@@ -284,14 +257,7 @@ export const CreateWorkspace = observer(function CreateWorkspace(props: Props) {
)}
-
+
{isSubmitting ? : t("workspace_creation.button.default")}
diff --git a/apps/web/core/components/onboarding/invitations.tsx b/apps/web/core/components/onboarding/invitations.tsx
index 7c04a3f655..457fb32650 100644
--- a/apps/web/core/components/onboarding/invitations.tsx
+++ b/apps/web/core/components/onboarding/invitations.tsx
@@ -1,6 +1,6 @@
-import React, { useState } from "react";
+import { useState } from "react";
// plane imports
-import { ROLE, MEMBER_TRACKER_EVENTS, MEMBER_TRACKER_ELEMENTS } from "@plane/constants";
+import { ROLE } from "@plane/constants";
// types
import { Button } from "@plane/propel/button";
import type { IWorkspaceMemberInvitation } from "@plane/types";
@@ -11,7 +11,6 @@ import { truncateText } from "@plane/utils";
// helpers
import { WorkspaceLogo } from "@/components/workspace/logo";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useWorkspace } from "@/hooks/store/use-workspace";
import { useUserSettings } from "@/hooks/store/user";
// services
@@ -43,31 +42,15 @@ export function Invitations(props: Props) {
const submitInvitations = async () => {
const invitation = invitations?.find((invitation) => invitation.id === invitationsRespond[0]);
-
if (invitationsRespond.length <= 0 && !invitation?.role) return;
-
setIsJoiningWorkspaces(true);
-
try {
await workspaceService.joinWorkspaces({ invitations: invitationsRespond });
- captureSuccess({
- eventName: MEMBER_TRACKER_EVENTS.accept,
- payload: {
- member_id: invitation?.id,
- },
- });
await fetchWorkspaces();
await fetchCurrentUserSettings();
await handleNextStep();
- } catch (error: any) {
+ } catch (error) {
console.error(error);
- captureError({
- eventName: MEMBER_TRACKER_EVENTS.accept,
- payload: {
- member_id: invitation?.id,
- },
- error: error,
- });
setIsJoiningWorkspaces(false);
}
};
@@ -114,7 +97,6 @@ export function Invitations(props: Props) {
className="w-full"
onClick={submitInvitations}
disabled={isJoiningWorkspaces || !invitationsRespond.length}
- data-ph-element={MEMBER_TRACKER_ELEMENTS.ONBOARDING_JOIN_WORKSPACE}
>
{isJoiningWorkspaces ? : "Continue to workspace"}
diff --git a/apps/web/core/components/onboarding/invite-members.tsx b/apps/web/core/components/onboarding/invite-members.tsx
index f78d114a0b..9f2464f4f4 100644
--- a/apps/web/core/components/onboarding/invite-members.tsx
+++ b/apps/web/core/components/onboarding/invite-members.tsx
@@ -15,7 +15,7 @@ import { XCircle } from "lucide-react";
import { Listbox } from "@headlessui/react";
// plane imports
import type { EUserPermissions } from "@plane/constants";
-import { ROLE, ROLE_DETAILS, MEMBER_TRACKER_EVENTS, MEMBER_TRACKER_ELEMENTS } from "@plane/constants";
+import { ROLE, ROLE_DETAILS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
// types
import { Button } from "@plane/propel/button";
@@ -24,8 +24,6 @@ import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IUser, IWorkspace } from "@plane/types";
// ui
import { Input, Spinner } from "@plane/ui";
-// helpers
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// services
import { WorkspaceService } from "@/plane-web/services";
// components
@@ -294,28 +292,14 @@ export function InviteMembers(props: Props) {
})),
})
.then(async () => {
- captureSuccess({
- eventName: MEMBER_TRACKER_EVENTS.invite,
- payload: {
- workspace: workspace.slug,
- },
- });
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",
message: "Invitations sent successfully.",
});
-
await nextStep();
})
.catch((err) => {
- captureError({
- eventName: MEMBER_TRACKER_EVENTS.invite,
- payload: {
- workspace: workspace.slug,
- },
- error: err,
- });
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
@@ -399,7 +383,6 @@ export function InviteMembers(props: Props) {
size="xl"
className="w-full"
disabled={isInvitationDisabled || !isValid || isSubmitting}
- data-ph-element={MEMBER_TRACKER_ELEMENTS.ONBOARDING_INVITE_MEMBER}
>
{isSubmitting ? : "Continue"}
diff --git a/apps/web/core/components/onboarding/profile-setup.tsx b/apps/web/core/components/onboarding/profile-setup.tsx
index 95bc3c2210..0374a8ee05 100644
--- a/apps/web/core/components/onboarding/profile-setup.tsx
+++ b/apps/web/core/components/onboarding/profile-setup.tsx
@@ -1,13 +1,8 @@
-import React, { useMemo, useState } from "react";
+import { useMemo, useState } from "react";
import { observer } from "mobx-react";
import { Controller, useForm } from "react-hook-form";
import { Eye, EyeOff } from "lucide-react";
-import {
- AUTH_TRACKER_EVENTS,
- E_PASSWORD_STRENGTH,
- ONBOARDING_TRACKER_ELEMENTS,
- USER_TRACKER_EVENTS,
-} from "@plane/constants";
+import { E_PASSWORD_STRENGTH } from "@plane/constants";
// types
import { useTranslation } from "@plane/i18n";
import { Button } from "@plane/propel/button";
@@ -18,10 +13,7 @@ import { Input, PasswordStrengthIndicator, Spinner } from "@plane/ui";
// components
import { cn, getFileURL, getPasswordStrength } from "@plane/utils";
import { UserImageUploadModal } from "@/components/core/modals/user-image-upload-modal";
-// constants
-// helpers
// hooks
-import { captureError, captureSuccess, captureView } from "@/helpers/event-tracker.helper";
import { useUser, useUserProfile } from "@/hooks/store/user";
// services
import { AuthService } from "@/services/auth.service";
@@ -118,18 +110,7 @@ export const ProfileSetup = observer(function ProfileSetup(props: Props) {
const handleSetPassword = async (password: string) => {
const token = await authService.requestCSRFToken().then((data) => data?.csrf_token);
- await authService
- .setPassword(token, { password })
- .then(() => {
- captureSuccess({
- eventName: AUTH_TRACKER_EVENTS.password_created,
- });
- })
- .catch(() => {
- captureError({
- eventName: AUTH_TRACKER_EVENTS.password_created,
- });
- });
+ await authService.setPassword(token, { password });
};
const handleSubmitProfileSetup = async (formData: TProfileSetupFormValues) => {
@@ -148,13 +129,6 @@ export const ProfileSetup = observer(function ProfileSetup(props: Props) {
updateUserProfile(profileUpdatePayload),
totalSteps > 2 && stepChange({ profile_complete: true }),
]);
- captureSuccess({
- eventName: USER_TRACKER_EVENTS.add_details,
- payload: {
- use_case: profileUpdatePayload.use_case,
- role: formData.role,
- },
- });
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success",
@@ -165,9 +139,6 @@ export const ProfileSetup = observer(function ProfileSetup(props: Props) {
finishOnboarding();
}
} catch {
- captureError({
- eventName: USER_TRACKER_EVENTS.add_details,
- });
setToast({
type: TOAST_TYPE.ERROR,
title: "Error",
@@ -188,20 +159,11 @@ export const ProfileSetup = observer(function ProfileSetup(props: Props) {
formData.password && handleSetPassword(formData.password),
]).then(() => {
if (formData.password) {
- captureView({
- elementName: ONBOARDING_TRACKER_ELEMENTS.PASSWORD_CREATION_SELECTED,
- });
} else {
- captureView({
- elementName: ONBOARDING_TRACKER_ELEMENTS.PASSWORD_CREATION_SKIPPED,
- });
+ setProfileSetupStep(EProfileSetupSteps.USER_PERSONALIZATION);
}
- setProfileSetupStep(EProfileSetupSteps.USER_PERSONALIZATION);
});
} catch {
- captureError({
- eventName: USER_TRACKER_EVENTS.add_details,
- });
setToast({
type: TOAST_TYPE.ERROR,
title: "Error",
@@ -220,13 +182,6 @@ export const ProfileSetup = observer(function ProfileSetup(props: Props) {
updateUserProfile(profileUpdatePayload),
totalSteps > 2 && stepChange({ profile_complete: true }),
]);
- captureSuccess({
- eventName: USER_TRACKER_EVENTS.add_details,
- payload: {
- use_case: profileUpdatePayload.use_case,
- role: formData.role,
- },
- });
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success",
@@ -237,9 +192,6 @@ export const ProfileSetup = observer(function ProfileSetup(props: Props) {
finishOnboarding();
}
} catch {
- captureError({
- eventName: USER_TRACKER_EVENTS.add_details,
- });
setToast({
type: TOAST_TYPE.ERROR,
title: "Error",
@@ -250,9 +202,6 @@ export const ProfileSetup = observer(function ProfileSetup(props: Props) {
const onSubmit = async (formData: TProfileSetupFormValues) => {
if (!user) return;
- captureView({
- elementName: ONBOARDING_TRACKER_ELEMENTS.PROFILE_SETUP_FORM,
- });
if (profileSetupStep === EProfileSetupSteps.ALL) await handleSubmitProfileSetup(formData);
if (profileSetupStep === EProfileSetupSteps.USER_DETAILS) await handleSubmitUserDetail(formData);
if (profileSetupStep === EProfileSetupSteps.USER_PERSONALIZATION) await handleSubmitUserPersonalization(formData);
diff --git a/apps/web/core/components/onboarding/root.tsx b/apps/web/core/components/onboarding/root.tsx
index 22fbf9ccc7..b839066fbe 100644
--- a/apps/web/core/components/onboarding/root.tsx
+++ b/apps/web/core/components/onboarding/root.tsx
@@ -1,13 +1,9 @@
-import type { FC } from "react";
import { useCallback, useEffect, useState } from "react";
import { observer } from "mobx-react";
// plane imports
-import { USER_TRACKER_EVENTS } from "@plane/constants";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IWorkspaceMemberInvitation, TOnboardingStep, TOnboardingSteps, TUserProfile } from "@plane/types";
import { EOnboardingSteps } from "@plane/types";
-// helpers
-import { captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useWorkspace } from "@/hooks/store/use-workspace";
import { useUser, useUserProfile } from "@/hooks/store/user";
@@ -34,24 +30,15 @@ export const OnboardingRoot = observer(function OnboardingRoot({ invitations = [
// complete onboarding
const finishOnboarding = useCallback(async () => {
if (!user) return;
-
- await finishUserOnboarding()
- .then(() => {
- captureSuccess({
- eventName: USER_TRACKER_EVENTS.onboarding_complete,
- payload: {
- email: user.email,
- user_id: user.id,
- },
- });
- })
- .catch(() => {
- setToast({
- type: TOAST_TYPE.ERROR,
- title: "Failed",
- message: "Failed to finish onboarding, Please try again later.",
- });
+ try {
+ await finishUserOnboarding();
+ } catch (_error) {
+ setToast({
+ type: TOAST_TYPE.ERROR,
+ title: "Failed",
+ message: "Failed to finish onboarding, Please try again later.",
});
+ }
}, [user, finishUserOnboarding]);
// handle step change
diff --git a/apps/web/core/components/onboarding/steps/profile/root.tsx b/apps/web/core/components/onboarding/steps/profile/root.tsx
index a6530e47cb..06a1062490 100644
--- a/apps/web/core/components/onboarding/steps/profile/root.tsx
+++ b/apps/web/core/components/onboarding/steps/profile/root.tsx
@@ -1,10 +1,9 @@
-import type { FC } from "react";
import { useMemo, useState } from "react";
import { observer } from "mobx-react";
import { Controller, useForm } from "react-hook-form";
import { ImageIcon } from "lucide-react";
// plane imports
-import { E_PASSWORD_STRENGTH, ONBOARDING_TRACKER_ELEMENTS, USER_TRACKER_EVENTS } from "@plane/constants";
+import { E_PASSWORD_STRENGTH } from "@plane/constants";
import { Button } from "@plane/propel/button";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IUser } from "@plane/types";
@@ -12,8 +11,6 @@ import { EOnboardingSteps } from "@plane/types";
import { cn, getFileURL, getPasswordStrength } from "@plane/utils";
// components
import { UserImageUploadModal } from "@/components/core/modals/user-image-upload-modal";
-// helpers
-import { captureError, captureView } from "@/helpers/event-tracker.helper";
// hooks
import { useInstance } from "@/hooks/store/use-instance";
import { useUser, useUserProfile } from "@/hooks/store/user";
@@ -94,9 +91,6 @@ export const ProfileSetupStep = observer(function ProfileSetupStep({ handleStepC
formData.password && handleSetPassword(formData.password),
]);
} catch {
- captureError({
- eventName: USER_TRACKER_EVENTS.add_details,
- });
setToast({
type: TOAST_TYPE.ERROR,
title: "Error",
@@ -107,15 +101,11 @@ export const ProfileSetupStep = observer(function ProfileSetupStep({ handleStepC
const onSubmit = async (formData: TProfileSetupFormValues) => {
if (!user) return;
- captureView({
- elementName: ONBOARDING_TRACKER_ELEMENTS.PROFILE_SETUP_FORM,
- });
updateUserProfile({
has_marketing_email_consent: formData.has_marketing_email_consent,
});
- await handleSubmitUserDetail(formData).then(() => {
- handleStepChange(EOnboardingSteps.PROFILE_SETUP);
- });
+ await handleSubmitUserDetail(formData);
+ handleStepChange(EOnboardingSteps.PROFILE_SETUP);
};
const handleDelete = (url: string | null | undefined) => {
diff --git a/apps/web/core/components/onboarding/steps/role/root.tsx b/apps/web/core/components/onboarding/steps/role/root.tsx
index 63342cce21..824f5763bf 100644
--- a/apps/web/core/components/onboarding/steps/role/root.tsx
+++ b/apps/web/core/components/onboarding/steps/role/root.tsx
@@ -1,16 +1,12 @@
-import type { FC } from "react";
import { observer } from "mobx-react";
import { Controller, useForm } from "react-hook-form";
import { Box, PenTool, Rocket, Monitor, RefreshCw } from "lucide-react";
// plane imports
-import { ONBOARDING_TRACKER_ELEMENTS, USER_TRACKER_EVENTS } from "@plane/constants";
import { Button } from "@plane/propel/button";
import { CheckIcon, ViewsIcon } from "@plane/propel/icons";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { TUserProfile } from "@plane/types";
import { EOnboardingSteps } from "@plane/types";
-// helpers
-import { captureError, captureSuccess, captureView } from "@/helpers/event-tracker.helper";
// hooks
import { useUserProfile } from "@/hooks/store/user";
// local components
@@ -61,22 +57,12 @@ export const RoleSetupStep = observer(function RoleSetupStep({ handleStepChange
updateUserProfile(profileUpdatePayload),
// totalSteps > 2 && stepChange({ profile_complete: true }),
]);
- captureSuccess({
- eventName: USER_TRACKER_EVENTS.add_details,
- payload: {
- use_case: formData.use_case,
- role: formData.role,
- },
- });
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success",
message: "Profile setup completed!",
});
} catch {
- captureError({
- eventName: USER_TRACKER_EVENTS.add_details,
- });
setToast({
type: TOAST_TYPE.ERROR,
title: "Error",
@@ -87,12 +73,8 @@ export const RoleSetupStep = observer(function RoleSetupStep({ handleStepChange
const onSubmit = async (formData: TProfileSetupFormValues) => {
if (!profile) return;
- captureView({
- elementName: ONBOARDING_TRACKER_ELEMENTS.PROFILE_SETUP_FORM,
- });
- await handleSubmitUserPersonalization(formData).then(() => {
- handleStepChange(EOnboardingSteps.ROLE_SETUP);
- });
+ await handleSubmitUserPersonalization(formData);
+ handleStepChange(EOnboardingSteps.ROLE_SETUP);
};
const handleSkip = () => {
diff --git a/apps/web/core/components/onboarding/steps/team/root.tsx b/apps/web/core/components/onboarding/steps/team/root.tsx
index a5263d01d9..b088e7c144 100644
--- a/apps/web/core/components/onboarding/steps/team/root.tsx
+++ b/apps/web/core/components/onboarding/steps/team/root.tsx
@@ -9,26 +9,19 @@ import type {
UseFormWatch,
} from "react-hook-form";
import { Controller, useFieldArray, useForm } from "react-hook-form";
-// icons
import { usePopper } from "react-popper";
import { XCircle } from "lucide-react";
import { Listbox } from "@headlessui/react";
// plane imports
import type { EUserPermissions } from "@plane/constants";
-import { ROLE, ROLE_DETAILS, MEMBER_TRACKER_EVENTS, MEMBER_TRACKER_ELEMENTS } from "@plane/constants";
+import { ROLE, ROLE_DETAILS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { Button } from "@plane/propel/button";
import { PlusIcon, CheckIcon, ChevronDownIcon } from "@plane/propel/icons";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
-// types
import { EOnboardingSteps } from "@plane/types";
-// ui
import { Input, Spinner } from "@plane/ui";
-// constants
-// helpers
-
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useWorkspace } from "@/hooks/store/use-workspace";
// services
import { WorkspaceService } from "@/plane-web/services";
@@ -299,28 +292,14 @@ export const InviteTeamStep = observer(function InviteTeamStep(props: Props) {
})),
})
.then(async () => {
- captureSuccess({
- eventName: MEMBER_TRACKER_EVENTS.invite,
- payload: {
- workspace: workspace.slug,
- },
- });
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",
message: "Invitations sent successfully.",
});
-
await nextStep();
})
.catch((err) => {
- captureError({
- eventName: MEMBER_TRACKER_EVENTS.invite,
- payload: {
- workspace: workspace.slug,
- },
- error: err,
- });
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
@@ -399,7 +378,6 @@ export const InviteTeamStep = observer(function InviteTeamStep(props: Props) {
size="xl"
className="w-full"
disabled={isInvitationDisabled || !isValid || isSubmitting}
- data-ph-element={MEMBER_TRACKER_ELEMENTS.ONBOARDING_INVITE_MEMBER}
>
{isSubmitting ? : "Continue"}
diff --git a/apps/web/core/components/onboarding/steps/usecase/root.tsx b/apps/web/core/components/onboarding/steps/usecase/root.tsx
index a33eac894b..63a3401497 100644
--- a/apps/web/core/components/onboarding/steps/usecase/root.tsx
+++ b/apps/web/core/components/onboarding/steps/usecase/root.tsx
@@ -1,17 +1,13 @@
-import type { FC } from "react";
import { observer } from "mobx-react";
import { Controller, useForm } from "react-hook-form";
-
// plane imports
-import { ONBOARDING_TRACKER_ELEMENTS, USER_TRACKER_EVENTS, USE_CASES } from "@plane/constants";
+import { USE_CASES } from "@plane/constants";
import { Button } from "@plane/propel/button";
import { CheckIcon } from "@plane/propel/icons";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { TUserProfile } from "@plane/types";
import { EOnboardingSteps } from "@plane/types";
import { cn } from "@plane/utils";
-// helpers
-import { captureError, captureSuccess, captureView } from "@/helpers/event-tracker.helper";
// hooks
import { useUserProfile } from "@/hooks/store/user";
// local imports
@@ -52,21 +48,12 @@ export const UseCaseSetupStep = observer(function UseCaseSetupStep({ handleStepC
updateUserProfile(profileUpdatePayload),
// totalSteps > 2 && stepChange({ profile_complete: true }),
]);
- captureSuccess({
- eventName: USER_TRACKER_EVENTS.add_details,
- payload: {
- use_case: profileUpdatePayload.use_case,
- },
- });
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success",
message: "Profile setup completed!",
});
} catch {
- captureError({
- eventName: USER_TRACKER_EVENTS.add_details,
- });
setToast({
type: TOAST_TYPE.ERROR,
title: "Error",
@@ -78,12 +65,8 @@ export const UseCaseSetupStep = observer(function UseCaseSetupStep({ handleStepC
// on submit
const onSubmit = async (formData: TProfileSetupFormValues) => {
if (!profile) return;
- captureView({
- elementName: ONBOARDING_TRACKER_ELEMENTS.PROFILE_SETUP_FORM,
- });
- await handleSubmitUserPersonalization(formData).then(() => {
- handleStepChange(EOnboardingSteps.USE_CASE_SETUP);
- });
+ await handleSubmitUserPersonalization(formData);
+ handleStepChange(EOnboardingSteps.USE_CASE_SETUP);
};
// handle skip
diff --git a/apps/web/core/components/onboarding/steps/workspace/create.tsx b/apps/web/core/components/onboarding/steps/workspace/create.tsx
index 53a5c454a7..6100f75c1a 100644
--- a/apps/web/core/components/onboarding/steps/workspace/create.tsx
+++ b/apps/web/core/components/onboarding/steps/workspace/create.tsx
@@ -3,20 +3,13 @@ import { observer } from "mobx-react";
import { Controller, useForm } from "react-hook-form";
import { CircleCheck } from "lucide-react";
// plane imports
-import {
- ORGANIZATION_SIZE,
- RESTRICTED_URLS,
- WORKSPACE_TRACKER_ELEMENTS,
- WORKSPACE_TRACKER_EVENTS,
-} from "@plane/constants";
+import { ORGANIZATION_SIZE, RESTRICTED_URLS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { Button } from "@plane/propel/button";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IUser, IWorkspace } from "@plane/types";
import { Spinner } from "@plane/ui";
import { cn } from "@plane/utils";
-// helpers
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useWorkspace } from "@/hooks/store/use-workspace";
import { useUserProfile, useUserSettings } from "@/hooks/store/user";
@@ -82,19 +75,10 @@ export const WorkspaceCreateStep = observer(function WorkspaceCreateStep({
title: t("workspace_creation.toast.success.title"),
message: t("workspace_creation.toast.success.message"),
});
- captureSuccess({
- eventName: WORKSPACE_TRACKER_EVENTS.create,
- payload: { slug: formData.slug },
- });
await fetchWorkspaces();
await completeStep(workspaceResponse.id);
onComplete(formData.organization_size === "Just myself");
} catch {
- captureError({
- eventName: WORKSPACE_TRACKER_EVENTS.create,
- payload: { slug: formData.slug },
- error: new Error("Error creating workspace"),
- });
setToast({
type: TOAST_TYPE.ERROR,
title: t("workspace_creation.toast.error.title"),
@@ -299,14 +283,7 @@ export const WorkspaceCreateStep = observer(function WorkspaceCreateStep({
-
+
{isSubmitting ? : t("workspace_creation.button.default")}
{hasInvitations && (
diff --git a/apps/web/core/components/onboarding/steps/workspace/join-invites.tsx b/apps/web/core/components/onboarding/steps/workspace/join-invites.tsx
index 7cc70e8d7f..98511293c0 100644
--- a/apps/web/core/components/onboarding/steps/workspace/join-invites.tsx
+++ b/apps/web/core/components/onboarding/steps/workspace/join-invites.tsx
@@ -1,14 +1,12 @@
-import React, { useState } from "react";
+import { useState } from "react";
// plane imports
-import { MEMBER_TRACKER_ELEMENTS, MEMBER_TRACKER_EVENTS, ROLE } from "@plane/constants";
+import { ROLE } from "@plane/constants";
import { Button } from "@plane/propel/button";
import type { IWorkspaceMemberInvitation } from "@plane/types";
import { Checkbox, Spinner } from "@plane/ui";
import { truncateText } from "@plane/utils";
// constants
import { WorkspaceLogo } from "@/components/workspace/logo";
-// helpers
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useWorkspace } from "@/hooks/store/use-workspace";
import { useUserSettings } from "@/hooks/store/user";
@@ -52,24 +50,11 @@ export function WorkspaceJoinInvitesStep(props: Props) {
try {
await workspaceService.joinWorkspaces({ invitations: invitationsRespond });
- captureSuccess({
- eventName: MEMBER_TRACKER_EVENTS.accept,
- payload: {
- member_id: invitation?.id,
- },
- });
await fetchWorkspaces();
await fetchCurrentUserSettings();
await handleNextStep();
} catch (error: any) {
console.error(error);
- captureError({
- eventName: MEMBER_TRACKER_EVENTS.accept,
- payload: {
- member_id: invitation?.id,
- },
- error: error,
- });
setIsJoiningWorkspaces(false);
}
};
@@ -114,7 +99,6 @@ export function WorkspaceJoinInvitesStep(props: Props) {
className="w-full"
onClick={submitInvitations}
disabled={isJoiningWorkspaces || !invitationsRespond.length}
- data-ph-element={MEMBER_TRACKER_ELEMENTS.ONBOARDING_JOIN_WORKSPACE}
>
{isJoiningWorkspaces ? : "Continue"}
diff --git a/apps/web/core/components/pages/dropdowns/actions.tsx b/apps/web/core/components/pages/dropdowns/actions.tsx
index 07180394ff..0b300a757e 100644
--- a/apps/web/core/components/pages/dropdowns/actions.tsx
+++ b/apps/web/core/components/pages/dropdowns/actions.tsx
@@ -3,9 +3,8 @@ import { observer } from "mobx-react";
import { useParams } from "next/navigation";
import { ArchiveRestoreIcon, FileOutput, LockKeyhole, LockKeyholeOpen } from "lucide-react";
// constants
-import { EPageAccess, PROJECT_PAGE_TRACKER_ELEMENTS } from "@plane/constants";
+import { EPageAccess } from "@plane/constants";
// plane editor
-import type { EditorRefApi } from "@plane/editor";
import { LinkIcon, CopyIcon, LockIcon, NewTabIcon, ArchiveIcon, TrashIcon, GlobeIcon } from "@plane/propel/icons";
// plane ui
import type { TContextMenuItem } from "@plane/ui";
@@ -13,9 +12,7 @@ import { ContextMenu, CustomMenu } from "@plane/ui";
// components
import { cn } from "@plane/utils";
import { DeletePageModal } from "@/components/pages/modals/delete-page-modal";
-// helpers
// hooks
-import { captureClick } from "@/helpers/event-tracker.helper";
import { usePageOperations } from "@/hooks/use-page-operations";
// plane web components
import { MovePageModal } from "@/plane-web/components/pages";
@@ -82,9 +79,6 @@ export const PageActions = observer(function PageActions(props: Props) {
{
key: "toggle-lock",
action: () => {
- captureClick({
- elementName: PROJECT_PAGE_TRACKER_ELEMENTS.LOCK_BUTTON,
- });
pageOperations.toggleLock();
},
title: is_locked ? "Unlock" : "Lock",
@@ -94,9 +88,6 @@ export const PageActions = observer(function PageActions(props: Props) {
{
key: "toggle-access",
action: () => {
- captureClick({
- elementName: PROJECT_PAGE_TRACKER_ELEMENTS.ACCESS_TOGGLE,
- });
pageOperations.toggleAccess();
},
title: access === EPageAccess.PUBLIC ? "Make private" : "Make public",
@@ -120,9 +111,6 @@ export const PageActions = observer(function PageActions(props: Props) {
{
key: "make-a-copy",
action: () => {
- captureClick({
- elementName: PROJECT_PAGE_TRACKER_ELEMENTS.DUPLICATE_BUTTON,
- });
pageOperations.duplicate();
},
title: "Make a copy",
@@ -132,9 +120,6 @@ export const PageActions = observer(function PageActions(props: Props) {
{
key: "archive-restore",
action: () => {
- captureClick({
- elementName: PROJECT_PAGE_TRACKER_ELEMENTS.ARCHIVE_BUTTON,
- });
pageOperations.toggleArchive();
},
title: archived_at ? "Restore" : "Archive",
@@ -144,9 +129,6 @@ export const PageActions = observer(function PageActions(props: Props) {
{
key: "delete",
action: () => {
- captureClick({
- elementName: PROJECT_PAGE_TRACKER_ELEMENTS.CONTEXT_MENU,
- });
setDeletePageModal(true);
},
title: "Delete",
diff --git a/apps/web/core/components/pages/header/favorite-control.tsx b/apps/web/core/components/pages/header/favorite-control.tsx
index ea5ea44c8e..7e74abba72 100644
--- a/apps/web/core/components/pages/header/favorite-control.tsx
+++ b/apps/web/core/components/pages/header/favorite-control.tsx
@@ -1,11 +1,7 @@
import { observer } from "mobx-react";
import { Star } from "lucide-react";
-// constants
-import { PROJECT_PAGE_TRACKER_ELEMENTS } from "@plane/constants";
// ui
import { IconButton } from "@plane/propel/icon-button";
-// helpers
-import { captureClick } from "@/helpers/event-tracker.helper";
// hooks
import { usePageOperations } from "@/hooks/use-page-operations";
// store
@@ -31,9 +27,6 @@ export const PageFavoriteControl = observer(function PageFavoriteControl({ page
size="lg"
icon={Star}
onClick={() => {
- captureClick({
- elementName: PROJECT_PAGE_TRACKER_ELEMENTS.FAVORITE_BUTTON,
- });
pageOperations.toggleFavorite();
}}
aria-label={is_favorite ? "Remove favorite" : "Add to favorites"}
diff --git a/apps/web/core/components/pages/list/block-item-action.tsx b/apps/web/core/components/pages/list/block-item-action.tsx
index 278a83dd48..c8034e7bfe 100644
--- a/apps/web/core/components/pages/list/block-item-action.tsx
+++ b/apps/web/core/components/pages/list/block-item-action.tsx
@@ -1,13 +1,10 @@
import { observer } from "mobx-react";
import { Earth, Info, Minus } from "lucide-react";
// plane imports
-import { PROJECT_PAGE_TRACKER_ELEMENTS } from "@plane/constants";
import { LockIcon } from "@plane/propel/icons";
import { Tooltip } from "@plane/propel/tooltip";
import { Avatar, FavoriteStar } from "@plane/ui";
import { renderFormattedDate, getFileURL } from "@plane/utils";
-// helpers
-import { captureClick } from "@/helpers/event-tracker.helper";
// hooks
import { useMember } from "@/hooks/store/use-member";
import { usePageOperations } from "@/hooks/use-page-operations";
@@ -65,9 +62,6 @@ export const BlockItemAction = observer(function BlockItemAction(props: Props) {
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
- captureClick({
- elementName: PROJECT_PAGE_TRACKER_ELEMENTS.FAVORITE_BUTTON,
- });
pageOperations.toggleFavorite();
}}
selected={is_favorite}
diff --git a/apps/web/core/components/pages/modals/create-page-modal.tsx b/apps/web/core/components/pages/modals/create-page-modal.tsx
index f398be341a..927c0f268f 100644
--- a/apps/web/core/components/pages/modals/create-page-modal.tsx
+++ b/apps/web/core/components/pages/modals/create-page-modal.tsx
@@ -1,13 +1,10 @@
-import type { FC } from "react";
import { useEffect, useState } from "react";
// constants
import type { EPageAccess } from "@plane/constants";
-import { PROJECT_PAGE_TRACKER_EVENTS } from "@plane/constants";
import type { TPage } from "@plane/types";
// ui
import { EModalPosition, EModalWidth, ModalCore } from "@plane/ui";
// hooks
-import { captureSuccess, captureError } from "@/helpers/event-tracker.helper";
import { useAppRouter } from "@/hooks/use-app-router";
// plane web hooks
import type { EPageStoreType } from "@/plane-web/hooks/store";
@@ -64,20 +61,11 @@ export function CreatePageModal(props: Props) {
try {
const pageData = await createPage(pageFormData);
if (pageData) {
- captureSuccess({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.create,
- payload: {
- id: pageData.id,
- },
- });
handleStateClear();
if (redirectionEnabled) router.push(`/${workspaceSlug}/projects/${projectId}/pages/${pageData.id}`);
}
- } catch (error: any) {
- captureError({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.create,
- error,
- });
+ } catch (error) {
+ console.error(error);
}
};
diff --git a/apps/web/core/components/pages/modals/delete-page-modal.tsx b/apps/web/core/components/pages/modals/delete-page-modal.tsx
index 4c91aecf15..701431c18e 100644
--- a/apps/web/core/components/pages/modals/delete-page-modal.tsx
+++ b/apps/web/core/components/pages/modals/delete-page-modal.tsx
@@ -2,13 +2,10 @@ import { useState } from "react";
import { observer } from "mobx-react";
// ui
import { useParams } from "next/navigation";
-import { PROJECT_PAGE_TRACKER_EVENTS } from "@plane/constants";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import { AlertModalCore } from "@plane/ui";
import { getPageName } from "@plane/utils";
// constants
-// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// plane web hooks
import { useAppRouter } from "@/hooks/use-app-router";
import type { EPageStoreType } from "@/plane-web/hooks/store";
@@ -46,12 +43,6 @@ export const DeletePageModal = observer(function DeletePageModal(props: TConfirm
setIsDeleting(true);
await removePage({ pageId })
.then(() => {
- captureSuccess({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.delete,
- payload: {
- id: pageId,
- },
- });
handleClose();
setToast({
type: TOAST_TYPE.SUCCESS,
@@ -64,12 +55,6 @@ export const DeletePageModal = observer(function DeletePageModal(props: TConfirm
}
})
.catch(() => {
- captureError({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.delete,
- payload: {
- id: pageId,
- },
- });
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
diff --git a/apps/web/core/components/pages/pages-list-main-content.tsx b/apps/web/core/components/pages/pages-list-main-content.tsx
index 58e239140b..e41d0f8858 100644
--- a/apps/web/core/components/pages/pages-list-main-content.tsx
+++ b/apps/web/core/components/pages/pages-list-main-content.tsx
@@ -2,12 +2,7 @@ import { useState } from "react";
import { observer } from "mobx-react";
// plane imports
import { useParams, useRouter } from "next/navigation";
-import {
- EUserPermissionsLevel,
- EPageAccess,
- PROJECT_PAGE_TRACKER_ELEMENTS,
- PROJECT_PAGE_TRACKER_EVENTS,
-} from "@plane/constants";
+import { EUserPermissionsLevel, EPageAccess } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { EmptyStateDetailed } from "@plane/propel/empty-state";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
@@ -15,7 +10,6 @@ import type { TPage, TPageNavigationTabs } from "@plane/types";
import { EUserProjectRoles } from "@plane/types";
// components
import { PageLoader } from "@/components/pages/loaders/page-loader";
-import { captureClick, captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useProject } from "@/hooks/store/use-project";
import { useUserPermissions } from "@/hooks/store/user";
// plane web hooks
@@ -60,23 +54,10 @@ export const PagesListMainContent = observer(function PagesListMainContent(props
await createPage(payload)
.then((res) => {
- captureSuccess({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.create,
- payload: {
- id: res?.id,
- state: "SUCCESS",
- },
- });
const pageId = `/${workspaceSlug}/projects/${currentProjectDetails?.id}/pages/${res?.id}`;
router.push(pageId);
})
.catch((err) => {
- captureError({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.create,
- payload: {
- state: "ERROR",
- },
- });
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
@@ -100,7 +81,6 @@ export const PagesListMainContent = observer(function PagesListMainContent(props
label: t("project_empty_state.pages.cta_primary"),
onClick: () => {
handleCreatePage();
- captureClick({ elementName: PROJECT_PAGE_TRACKER_ELEMENTS.EMPTY_STATE_CREATE_BUTTON });
},
variant: "primary",
disabled: !canPerformEmptyStateActions || isCreatingPage,
@@ -120,7 +100,6 @@ export const PagesListMainContent = observer(function PagesListMainContent(props
label: t("project_empty_state.pages.cta_primary"),
onClick: () => {
handleCreatePage();
- captureClick({ elementName: PROJECT_PAGE_TRACKER_ELEMENTS.EMPTY_STATE_CREATE_BUTTON });
},
variant: "primary",
disabled: !canPerformEmptyStateActions || isCreatingPage,
@@ -139,7 +118,6 @@ export const PagesListMainContent = observer(function PagesListMainContent(props
label: t("project_empty_state.pages.cta_primary"),
onClick: () => {
handleCreatePage();
- captureClick({ elementName: PROJECT_PAGE_TRACKER_ELEMENTS.EMPTY_STATE_CREATE_BUTTON });
},
variant: "primary",
disabled: !canPerformEmptyStateActions || isCreatingPage,
diff --git a/apps/web/core/components/profile/form.tsx b/apps/web/core/components/profile/form.tsx
index 2a25b24e97..ec9d52bb29 100644
--- a/apps/web/core/components/profile/form.tsx
+++ b/apps/web/core/components/profile/form.tsx
@@ -4,7 +4,6 @@ import { Controller, useForm } from "react-hook-form";
import { CircleUserRound } from "lucide-react";
import { Disclosure, Transition } from "@headlessui/react";
// plane imports
-import { PROFILE_SETTINGS_TRACKER_ELEMENTS, PROFILE_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { Button } from "@plane/propel/button";
import { ChevronDownIcon } from "@plane/propel/icons";
@@ -21,7 +20,6 @@ import { UserImageUploadModal } from "@/components/core/modals/user-image-upload
import { CoverImage } from "@/components/common/cover-image";
// helpers
import { handleCoverImageChange } from "@/helpers/cover-image.helper";
-import { captureSuccess, captureError } from "@/helpers/event-tracker.helper";
// hooks
import { useInstance } from "@/hooks/store/use-instance";
import { useUser, useUserProfile } from "@/hooks/store/user";
@@ -164,16 +162,9 @@ export const ProfileForm = observer(function ProfileForm(props: TProfileFormProp
});
updateUserAndProfile
.then(() => {
- captureSuccess({
- eventName: PROFILE_SETTINGS_TRACKER_EVENTS.update_profile,
- });
return;
})
- .catch(() => {
- captureError({
- eventName: PROFILE_SETTINGS_TRACKER_EVENTS.update_profile,
- });
- });
+ .catch(() => {});
};
return (
@@ -385,12 +376,7 @@ export const ProfileForm = observer(function ProfileForm(props: TProfileFormProp
-
+
{isLoading ? t("saving") : t("save_changes")}
@@ -417,11 +403,7 @@ export const ProfileForm = observer(function ProfileForm(props: TProfileFormProp
{t("deactivate_account_description")}
- setDeactivateAccountModal(true)}
- data-ph-element={PROFILE_SETTINGS_TRACKER_ELEMENTS.DEACTIVATE_ACCOUNT_BUTTON}
- >
+ setDeactivateAccountModal(true)}>
{t("deactivate_account")}
diff --git a/apps/web/core/components/profile/notification/email-notification-form.tsx b/apps/web/core/components/profile/notification/email-notification-form.tsx
index 39e9d382cb..8ab4fac880 100644
--- a/apps/web/core/components/profile/notification/email-notification-form.tsx
+++ b/apps/web/core/components/profile/notification/email-notification-form.tsx
@@ -1,14 +1,11 @@
-import type { FC } from "react";
-import React, { useEffect } from "react";
+import { useEffect } from "react";
import { Controller, useForm } from "react-hook-form";
-import { PROFILE_SETTINGS_TRACKER_ELEMENTS, PROFILE_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IUserEmailNotificationSettings } from "@plane/types";
// ui
import { ToggleSwitch } from "@plane/ui";
// services
-import { captureClick, captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { UserService } from "@/services/user.service";
// types
interface IEmailNotificationFormProps {
@@ -33,25 +30,12 @@ export function EmailNotificationForm(props: IEmailNotificationFormProps) {
await userService.updateCurrentUserEmailNotificationSettings({
[key]: value,
});
- captureSuccess({
- eventName: PROFILE_SETTINGS_TRACKER_EVENTS.notifications_updated,
- payload: {
- [key]: value,
- },
- });
setToast({
title: t("success"),
type: TOAST_TYPE.SUCCESS,
message: t("email_notification_setting_updated_successfully"),
});
- } catch (err) {
- console.error(err);
- captureError({
- eventName: PROFILE_SETTINGS_TRACKER_EVENTS.notifications_updated,
- payload: {
- [key]: value,
- },
- });
+ } catch (_error) {
setToast({
title: t("error"),
type: TOAST_TYPE.ERROR,
@@ -82,9 +66,6 @@ export function EmailNotificationForm(props: IEmailNotificationFormProps) {
value={value}
onChange={(newValue) => {
onChange(newValue);
- captureClick({
- elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.PROPERTY_CHANGES_TOGGLE,
- });
handleSettingChange("property_change", newValue);
}}
size="sm"
@@ -107,9 +88,6 @@ export function EmailNotificationForm(props: IEmailNotificationFormProps) {
value={value}
onChange={(newValue) => {
onChange(newValue);
- captureClick({
- elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.STATE_CHANGES_TOGGLE,
- });
handleSettingChange("state_change", newValue);
}}
size="sm"
@@ -154,9 +132,6 @@ export function EmailNotificationForm(props: IEmailNotificationFormProps) {
value={value}
onChange={(newValue) => {
onChange(newValue);
- captureClick({
- elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.COMMENTS_TOGGLE,
- });
handleSettingChange("comment", newValue);
}}
size="sm"
@@ -179,9 +154,6 @@ export function EmailNotificationForm(props: IEmailNotificationFormProps) {
value={value}
onChange={(newValue) => {
onChange(newValue);
- captureClick({
- elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.MENTIONS_TOGGLE,
- });
handleSettingChange("mention", newValue);
}}
size="sm"
diff --git a/apps/web/core/components/profile/preferences/language-timezone.tsx b/apps/web/core/components/profile/preferences/language-timezone.tsx
index 677ae2bcbd..ef2de25298 100644
--- a/apps/web/core/components/profile/preferences/language-timezone.tsx
+++ b/apps/web/core/components/profile/preferences/language-timezone.tsx
@@ -1,10 +1,8 @@
import { observer } from "mobx-react";
-import { PROFILE_SETTINGS_TRACKER_ELEMENTS, PROFILE_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
import { SUPPORTED_LANGUAGES, useTranslation } from "@plane/i18n";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import { CustomSelect } from "@plane/ui";
import { TimezoneSelect } from "@/components/global";
-import { captureElementAndEvent } from "@/helpers/event-tracker.helper";
import { useUser, useUserProfile } from "@/hooks/store/user";
export const LanguageTimezone = observer(function LanguageTimezone() {
@@ -17,81 +15,38 @@ export const LanguageTimezone = observer(function LanguageTimezone() {
const { updateUserProfile } = useUserProfile();
const { t } = useTranslation();
- const handleTimezoneChange = (value: string) => {
- updateCurrentUser({ user_timezone: value })
- .then(() => {
- captureElementAndEvent({
- element: {
- elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.TIMEZONE_DROPDOWN,
- },
- event: {
- eventName: PROFILE_SETTINGS_TRACKER_EVENTS.timezone_updated,
- payload: {
- timezone: value,
- },
- state: "SUCCESS",
- },
- });
- setToast({
- title: "Success!",
- message: "Timezone updated successfully",
- type: TOAST_TYPE.SUCCESS,
- });
- })
- .catch(() => {
- captureElementAndEvent({
- element: {
- elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.TIMEZONE_DROPDOWN,
- },
- event: {
- eventName: PROFILE_SETTINGS_TRACKER_EVENTS.timezone_updated,
- state: "ERROR",
- },
- });
- setToast({
- title: "Error!",
- message: "Failed to update timezone",
- type: TOAST_TYPE.ERROR,
- });
+ const handleTimezoneChange = async (value: string) => {
+ try {
+ await updateCurrentUser({ user_timezone: value });
+ setToast({
+ title: "Success!",
+ message: "Timezone updated successfully",
+ type: TOAST_TYPE.SUCCESS,
});
+ } catch (_error) {
+ setToast({
+ title: "Error!",
+ message: "Failed to update timezone",
+ type: TOAST_TYPE.ERROR,
+ });
+ }
};
- const handleLanguageChange = (value: string) => {
- updateUserProfile({ language: value })
- .then(() => {
- captureElementAndEvent({
- element: {
- elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.LANGUAGE_DROPDOWN,
- },
- event: {
- eventName: PROFILE_SETTINGS_TRACKER_EVENTS.language_updated,
- payload: {
- language: value,
- },
- state: "SUCCESS",
- },
- });
- setToast({
- title: "Success!",
- message: "Language updated successfully",
- type: TOAST_TYPE.SUCCESS,
- });
- })
- .catch(() => {
- captureElementAndEvent({
- element: {
- elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.LANGUAGE_DROPDOWN,
- },
- event: {
- eventName: PROFILE_SETTINGS_TRACKER_EVENTS.language_updated,
- state: "ERROR",
- },
- });
- setToast({
- title: "Error!",
- message: "Failed to update language",
- type: TOAST_TYPE.ERROR,
- });
+
+ const handleLanguageChange = async (value: string) => {
+ try {
+ await updateUserProfile({ language: value });
+ setToast({
+ title: "Success!",
+ message: "Language updated successfully",
+ type: TOAST_TYPE.SUCCESS,
});
+ } catch (_error) {
+ setToast({
+ title: "Error!",
+ message: "Failed to update language",
+ type: TOAST_TYPE.ERROR,
+ });
+ }
};
const getLanguageLabel = (value: string) => {
diff --git a/apps/web/core/components/profile/start-of-week-preference.tsx b/apps/web/core/components/profile/start-of-week-preference.tsx
index 259e570a7f..d95a0857be 100644
--- a/apps/web/core/components/profile/start-of-week-preference.tsx
+++ b/apps/web/core/components/profile/start-of-week-preference.tsx
@@ -1,16 +1,10 @@
-import React from "react";
import { observer } from "mobx-react";
// plane imports
-import {
- PROFILE_SETTINGS_TRACKER_ELEMENTS,
- PROFILE_SETTINGS_TRACKER_EVENTS,
- START_OF_THE_WEEK_OPTIONS,
-} from "@plane/constants";
+import { START_OF_THE_WEEK_OPTIONS } from "@plane/constants";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { EStartOfTheWeek } from "@plane/types";
import { CustomSelect } from "@plane/ui";
// hooks
-import { captureElementAndEvent } from "@/helpers/event-tracker.helper";
import { useUserProfile } from "@/hooks/store/user";
import { PreferencesSection } from "../preferences/section";
@@ -23,6 +17,15 @@ export const StartOfWeekPreference = observer(function StartOfWeekPreference(pro
// hooks
const { data: userProfile, updateUserProfile } = useUserProfile();
+ const handleStartOfWeekChange = async (val: number) => {
+ try {
+ await updateUserProfile({ start_of_the_week: val });
+ setToast({ type: TOAST_TYPE.SUCCESS, title: "Success", message: "First day of the week updated successfully" });
+ } catch (_error) {
+ setToast({ type: TOAST_TYPE.ERROR, title: "Update failed", message: "Please try again later." });
+ }
+ };
+
return (
{
- updateUserProfile({ start_of_the_week: val })
- .then(() => {
- captureElementAndEvent({
- element: {
- elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.FIRST_DAY_OF_WEEK_DROPDOWN,
- },
- event: {
- eventName: PROFILE_SETTINGS_TRACKER_EVENTS.first_day_updated,
- payload: {
- start_of_the_week: val,
- },
- state: "SUCCESS",
- },
- });
- setToast({
- type: TOAST_TYPE.SUCCESS,
- title: "Success",
- message: "First day of the week updated successfully",
- });
- })
- .catch(() => {
- captureElementAndEvent({
- element: {
- elementName: PROFILE_SETTINGS_TRACKER_ELEMENTS.FIRST_DAY_OF_WEEK_DROPDOWN,
- },
- event: {
- eventName: PROFILE_SETTINGS_TRACKER_EVENTS.first_day_updated,
- state: "ERROR",
- },
- });
- setToast({ type: TOAST_TYPE.ERROR, title: "Update failed", message: "Please try again later." });
- });
- }}
+ onChange={handleStartOfWeekChange}
input
maxHeight="lg"
>
diff --git a/apps/web/core/components/project-states/create-update/create.tsx b/apps/web/core/components/project-states/create-update/create.tsx
index 7cded141b5..a47eaed264 100644
--- a/apps/web/core/components/project-states/create-update/create.tsx
+++ b/apps/web/core/components/project-states/create-update/create.tsx
@@ -1,22 +1,20 @@
import { useState } from "react";
import { observer } from "mobx-react";
-import { STATE_TRACKER_EVENTS, STATE_GROUPS } from "@plane/constants";
+import { STATE_GROUPS } from "@plane/constants";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IState, TStateGroups, TStateOperationsCallbacks } from "@plane/types";
// components
import { StateForm } from "@/components/project-states";
-// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
type TStateCreate = {
groupKey: TStateGroups;
- shouldTrackEvents: boolean;
+ shouldTrackEvents?: boolean;
createStateCallback: TStateOperationsCallbacks["createState"];
handleClose: () => void;
};
export const StateCreate = observer(function StateCreate(props: TStateCreate) {
- const { groupKey, shouldTrackEvents, createStateCallback, handleClose } = props;
+ const { groupKey, createStateCallback, handleClose } = props;
// states
const [loader, setLoader] = useState(false);
@@ -31,14 +29,7 @@ export const StateCreate = observer(function StateCreate(props: TStateCreate) {
try {
const response = await createStateCallback({ ...formData, group: groupKey });
- if (shouldTrackEvents)
- captureSuccess({
- eventName: STATE_TRACKER_EVENTS.create,
- payload: {
- state_group: groupKey,
- id: response.id,
- },
- });
+
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",
@@ -48,13 +39,6 @@ export const StateCreate = observer(function StateCreate(props: TStateCreate) {
return { status: "success" };
} catch (error) {
const errorStatus = error as { status: number; data: { error: string } };
- if (shouldTrackEvents)
- captureError({
- eventName: STATE_TRACKER_EVENTS.create,
- payload: {
- state_group: groupKey,
- },
- });
if (errorStatus?.status === 400) {
setToast({
type: TOAST_TYPE.ERROR,
diff --git a/apps/web/core/components/project-states/create-update/update.tsx b/apps/web/core/components/project-states/create-update/update.tsx
index a71e913e9e..beeec8ef25 100644
--- a/apps/web/core/components/project-states/create-update/update.tsx
+++ b/apps/web/core/components/project-states/create-update/update.tsx
@@ -1,12 +1,9 @@
import { useState } from "react";
import { observer } from "mobx-react";
-import { STATE_TRACKER_EVENTS } from "@plane/constants";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IState, TStateOperationsCallbacks } from "@plane/types";
// components
import { StateForm } from "@/components/project-states";
-// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
type TStateUpdate = {
state: IState;
@@ -16,7 +13,7 @@ type TStateUpdate = {
};
export const StateUpdate = observer(function StateUpdate(props: TStateUpdate) {
- const { state, updateStateCallback, shouldTrackEvents, handleClose } = props;
+ const { state, updateStateCallback, handleClose } = props;
// states
const [loader, setLoader] = useState(false);
@@ -30,15 +27,6 @@ export const StateUpdate = observer(function StateUpdate(props: TStateUpdate) {
try {
await updateStateCallback(state.id, formData);
- if (shouldTrackEvents) {
- captureSuccess({
- eventName: STATE_TRACKER_EVENTS.update,
- payload: {
- state_group: state.group,
- id: state.id,
- },
- });
- }
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",
@@ -61,15 +49,6 @@ export const StateUpdate = observer(function StateUpdate(props: TStateUpdate) {
title: "Error!",
message: "State could not be updated. Please try again.",
});
- if (shouldTrackEvents) {
- captureError({
- eventName: STATE_TRACKER_EVENTS.update,
- payload: {
- state_group: state.group,
- id: state.id,
- },
- });
- }
return { status: "error" };
}
}
diff --git a/apps/web/core/components/project-states/options/delete.tsx b/apps/web/core/components/project-states/options/delete.tsx
index dc554012bb..7048bf4b1e 100644
--- a/apps/web/core/components/project-states/options/delete.tsx
+++ b/apps/web/core/components/project-states/options/delete.tsx
@@ -1,7 +1,6 @@
import { useState } from "react";
import { observer } from "mobx-react";
import { Loader } from "lucide-react";
-import { STATE_TRACKER_EVENTS, STATE_TRACKER_ELEMENTS } from "@plane/constants";
import { CloseIcon } from "@plane/propel/icons";
// plane imports
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
@@ -10,18 +9,17 @@ import type { IState, TStateOperationsCallbacks } from "@plane/types";
import { AlertModalCore } from "@plane/ui";
import { cn } from "@plane/utils";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { usePlatformOS } from "@/hooks/use-platform-os";
type TStateDelete = {
totalStates: number;
state: IState;
deleteStateCallback: TStateOperationsCallbacks["deleteState"];
- shouldTrackEvents: boolean;
+ shouldTrackEvents?: boolean;
};
export const StateDelete = observer(function StateDelete(props: TStateDelete) {
- const { totalStates, state, deleteStateCallback, shouldTrackEvents } = props;
+ const { totalStates, state, deleteStateCallback } = props;
// hooks
const { isMobile } = usePlatformOS();
// states
@@ -37,26 +35,9 @@ export const StateDelete = observer(function StateDelete(props: TStateDelete) {
try {
await deleteStateCallback(state.id);
- if (shouldTrackEvents) {
- captureSuccess({
- eventName: STATE_TRACKER_EVENTS.delete,
- payload: {
- id: state.id,
- },
- });
- }
-
setIsDelete(false);
} catch (error) {
const errorStatus = error as { status: number; data: { error: string } };
- if (shouldTrackEvents) {
- captureError({
- eventName: STATE_TRACKER_EVENTS.delete,
- payload: {
- id: state.id,
- },
- });
- }
if (errorStatus.status === 400) {
setToast({
type: TOAST_TYPE.ERROR,
@@ -99,7 +80,6 @@ export const StateDelete = observer(function StateDelete(props: TStateDelete) {
)}
disabled={isDeleteDisabled}
onClick={() => setIsDeleteModal(true)}
- data-ph-element={STATE_TRACKER_ELEMENTS.STATE_LIST_DELETE_BUTTON}
>
{
- captureSuccess({
- eventName: STATE_TRACKER_EVENTS.delete,
- payload: {
- id: data.id,
- },
- });
handleClose();
})
.catch((err) => {
@@ -60,12 +51,6 @@ export const StateDeleteModal = observer(function StateDeleteModal(props: TState
title: "Error!",
message: "State could not be deleted. Please try again.",
});
- captureError({
- eventName: STATE_TRACKER_EVENTS.delete,
- payload: {
- id: data.id,
- },
- });
})
.finally(() => {
setIsDeleteLoading(false);
diff --git a/apps/web/core/components/project/card-list.tsx b/apps/web/core/components/project/card-list.tsx
index 24efb4802e..01e7842379 100644
--- a/apps/web/core/components/project/card-list.tsx
+++ b/apps/web/core/components/project/card-list.tsx
@@ -1,13 +1,12 @@
import { observer } from "mobx-react";
// plane imports
-import { EUserPermissionsLevel, EUserPermissions, PROJECT_TRACKER_ELEMENTS } from "@plane/constants";
+import { EUserPermissionsLevel, EUserPermissions } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { EmptyStateDetailed } from "@plane/propel/empty-state";
import { ContentWrapper } from "@plane/ui";
// components
import { calculateTotalFilters } from "@plane/utils";
import { ProjectsLoader } from "@/components/ui/loader/projects-loader";
-import { captureClick } from "@/helpers/event-tracker.helper";
// hooks
import { useCommandPalette } from "@/hooks/store/use-command-palette";
import { useProject } from "@/hooks/store/use-project";
@@ -62,7 +61,6 @@ export const ProjectCardList = observer(function ProjectCardList(props: TProject
label: t("workspace_projects.empty_state.general.primary_button.text"),
onClick: () => {
toggleCreateProjectModal(true);
- captureClick({ elementName: PROJECT_TRACKER_ELEMENTS.EMPTY_STATE_CREATE_PROJECT_BUTTON });
},
disabled: !canPerformEmptyStateActions,
variant: "primary",
diff --git a/apps/web/core/components/project/create/header.tsx b/apps/web/core/components/project/create/header.tsx
index abbaf259bc..3e6c1384cc 100644
--- a/apps/web/core/components/project/create/header.tsx
+++ b/apps/web/core/components/project/create/header.tsx
@@ -55,7 +55,7 @@ function ProjectCreateHeader(props: Props) {
)}
{isClosable && (
-
+
diff --git a/apps/web/core/components/project/delete-project-modal.tsx b/apps/web/core/components/project/delete-project-modal.tsx
index 8b4f33f39f..3a0276fee9 100644
--- a/apps/web/core/components/project/delete-project-modal.tsx
+++ b/apps/web/core/components/project/delete-project-modal.tsx
@@ -1,16 +1,12 @@
import { useParams } from "next/navigation";
import { Controller, useForm } from "react-hook-form";
import { AlertTriangle } from "lucide-react";
-// types
-import { PROJECT_TRACKER_EVENTS } from "@plane/constants";
+// Plane imports
import { Button } from "@plane/propel/button";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IProject } from "@plane/types";
-// ui
import { Input, EModalPosition, EModalWidth, ModalCore } from "@plane/ui";
-// constants
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useProject } from "@/hooks/store/use-project";
import { useAppRouter } from "@/hooks/use-app-router";
@@ -55,36 +51,22 @@ export function DeleteProjectModal(props: DeleteProjectModal) {
const onSubmit = async () => {
if (!workspaceSlug || !canDelete) return;
- await deleteProject(workspaceSlug.toString(), project.id)
- .then(() => {
- if (projectId && projectId.toString() === project.id) router.push(`/${workspaceSlug}/projects`);
-
- handleClose();
- captureSuccess({
- eventName: PROJECT_TRACKER_EVENTS.delete,
- payload: {
- id: project.id,
- },
- });
- setToast({
- type: TOAST_TYPE.SUCCESS,
- title: "Success!",
- message: "Project deleted successfully.",
- });
- })
- .catch(() => {
- captureError({
- eventName: PROJECT_TRACKER_EVENTS.delete,
- payload: {
- id: project.id,
- },
- });
- setToast({
- type: TOAST_TYPE.ERROR,
- title: "Error!",
- message: "Something went wrong. Please try again later.",
- });
+ try {
+ await deleteProject(workspaceSlug.toString(), project.id);
+ if (projectId && projectId.toString() === project.id) router.push(`/${workspaceSlug}/projects`);
+ handleClose();
+ setToast({
+ type: TOAST_TYPE.SUCCESS,
+ title: "Success!",
+ message: "Project deleted successfully.",
});
+ } catch (_error) {
+ setToast({
+ type: TOAST_TYPE.ERROR,
+ title: "Error!",
+ message: "Something went wrong. Please try again later.",
+ });
+ }
};
return (
diff --git a/apps/web/core/components/project/form.tsx b/apps/web/core/components/project/form.tsx
index cc405aaab6..634275c40f 100644
--- a/apps/web/core/components/project/form.tsx
+++ b/apps/web/core/components/project/form.tsx
@@ -1,7 +1,7 @@
import { useEffect, useState } from "react";
import { Controller, useForm } from "react-hook-form";
import { Info } from "lucide-react";
-import { NETWORK_CHOICES, PROJECT_TRACKER_ELEMENTS, PROJECT_TRACKER_EVENTS } from "@plane/constants";
+import { NETWORK_CHOICES } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
// plane imports
import { Button } from "@plane/propel/button";
@@ -18,7 +18,6 @@ import { ImagePickerPopover } from "@/components/core/image-picker-popover";
import { TimezoneSelect } from "@/components/global";
// helpers
import { handleCoverImageChange } from "@/helpers/cover-image.helper";
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useProject } from "@/hooks/store/use-project";
import { usePlatformOS } from "@/hooks/use-platform-os";
@@ -87,12 +86,6 @@ export function ProjectDetailsForm(props: IProjectDetailsForm) {
if (!workspaceSlug || !project) return;
return updateProject(workspaceSlug.toString(), project.id, payload)
.then(() => {
- captureSuccess({
- eventName: PROJECT_TRACKER_EVENTS.update,
- payload: {
- id: projectId,
- },
- });
setToast({
type: TOAST_TYPE.SUCCESS,
title: t("toast.success"),
@@ -101,13 +94,6 @@ export function ProjectDetailsForm(props: IProjectDetailsForm) {
})
.catch((err) => {
try {
- captureError({
- eventName: PROJECT_TRACKER_EVENTS.update,
- payload: {
- id: projectId,
- },
- });
-
// Handle the new error format where codes are nested in arrays under field names
const errorData = err ?? {};
@@ -437,14 +423,7 @@ export function ProjectDetailsForm(props: IProjectDetailsForm) {
<>
-
+
{isLoading ? t("updating") : t("common.update_project")}
diff --git a/apps/web/core/components/project/leave-project-modal.tsx b/apps/web/core/components/project/leave-project-modal.tsx
index 20a81e9f65..202a43f38c 100644
--- a/apps/web/core/components/project/leave-project-modal.tsx
+++ b/apps/web/core/components/project/leave-project-modal.tsx
@@ -1,18 +1,13 @@
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
import { Controller, useForm } from "react-hook-form";
-// headless ui
import { AlertTriangleIcon } from "lucide-react";
-// types
-import { MEMBER_TRACKER_EVENTS } from "@plane/constants";
+// Plane imports
import { Button } from "@plane/propel/button";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IProject } from "@plane/types";
-// ui
import { Input, EModalPosition, EModalWidth, ModalCore } from "@plane/ui";
-// constants
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useUserPermissions } from "@/hooks/store/user";
import { useAppRouter } from "@/hooks/use-app-router";
@@ -62,21 +57,8 @@ export const LeaveProjectModal = observer(function LeaveProjectModal(props: ILea
return leaveProject(workspaceSlug.toString(), project.id)
.then(() => {
handleClose();
- captureSuccess({
- eventName: MEMBER_TRACKER_EVENTS.project.leave,
- payload: {
- project: project.id,
- },
- });
})
.catch((err) => {
- captureError({
- eventName: MEMBER_TRACKER_EVENTS.project.leave,
- payload: {
- project: project.id,
- },
- error: err,
- });
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
diff --git a/apps/web/core/components/project/member-list-item.tsx b/apps/web/core/components/project/member-list-item.tsx
index b3589a74ca..4955f85c48 100644
--- a/apps/web/core/components/project/member-list-item.tsx
+++ b/apps/web/core/components/project/member-list-item.tsx
@@ -1,10 +1,7 @@
import { observer } from "mobx-react";
// plane imports
-import { MEMBER_TRACKER_EVENTS } from "@plane/constants";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import { Table } from "@plane/ui";
-// helpers
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useMember } from "@/hooks/store/use-member";
import { useUser, useUserPermissions } from "@/hooks/store/user";
@@ -45,21 +42,8 @@ export const ProjectMemberListItem = observer(function ProjectMemberListItem(pro
await leaveProject(workspaceSlug.toString(), projectId.toString())
.then(async () => {
router.push(`/${workspaceSlug}/projects`);
- captureSuccess({
- eventName: MEMBER_TRACKER_EVENTS.project.leave,
- payload: {
- project: projectId,
- },
- });
})
.catch((err) => {
- captureError({
- eventName: MEMBER_TRACKER_EVENTS.project.leave,
- payload: {
- project: projectId,
- },
- error: err,
- });
setToast({
type: TOAST_TYPE.ERROR,
title: "You can’t leave this project yet.",
diff --git a/apps/web/core/components/project/send-project-invitation-modal.tsx b/apps/web/core/components/project/send-project-invitation-modal.tsx
index 8b1391da88..e2b8ef68e1 100644
--- a/apps/web/core/components/project/send-project-invitation-modal.tsx
+++ b/apps/web/core/components/project/send-project-invitation-modal.tsx
@@ -2,7 +2,7 @@ import React, { useEffect } from "react";
import { observer } from "mobx-react";
import { useForm, Controller, useFieldArray } from "react-hook-form";
// plane imports
-import { ROLE, EUserPermissions, MEMBER_TRACKER_EVENTS } from "@plane/constants";
+import { ROLE, EUserPermissions } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { Button } from "@plane/propel/button";
import { PlusIcon, CloseIcon, ChevronDownIcon } from "@plane/propel/icons";
@@ -11,7 +11,6 @@ import { Avatar, CustomSelect, CustomSearchSelect, EModalPosition, EModalWidth,
// helpers
import { getFileURL } from "@plane/utils";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useMember } from "@/hooks/store/use-member";
import { useUserPermissions } from "@/hooks/store/user";
@@ -86,23 +85,9 @@ export const SendProjectInvitationModal = observer(function SendProjectInvitatio
type: TOAST_TYPE.SUCCESS,
message: "Members added successfully.",
});
-
- captureSuccess({
- eventName: MEMBER_TRACKER_EVENTS.project.add,
- payload: {
- members: [...payload.members.map((member) => member.member_id)],
- },
- });
})
.catch((error) => {
console.error(error);
- captureError({
- eventName: MEMBER_TRACKER_EVENTS.project.add,
- payload: {
- members: [...payload.members.map((member) => member.member_id)],
- },
- error: error,
- });
})
.finally(() => {
reset(defaultValues);
diff --git a/apps/web/core/components/project/settings/features-list.tsx b/apps/web/core/components/project/settings/features-list.tsx
index a2fa4ccdef..fcfab32ae0 100644
--- a/apps/web/core/components/project/settings/features-list.tsx
+++ b/apps/web/core/components/project/settings/features-list.tsx
@@ -1,14 +1,11 @@
import { observer } from "mobx-react";
// plane imports
-import { PROJECT_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { setPromiseToast } from "@plane/propel/toast";
import { Tooltip } from "@plane/propel/tooltip";
import type { IProject } from "@plane/types";
// components
import { SettingsHeading } from "@/components/settings/heading";
-// helpers
-import { captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useProject } from "@/hooks/store/use-project";
import { useUser } from "@/hooks/store/user";
@@ -53,12 +50,6 @@ export const ProjectFeaturesList = observer(function ProjectFeaturesList(props:
},
});
void updateProjectPromise.then(() => {
- captureSuccess({
- eventName: PROJECT_TRACKER_EVENTS.feature_toggled,
- payload: {
- feature_key: featureKey,
- },
- });
return undefined;
});
};
diff --git a/apps/web/core/components/views/delete-view-modal.tsx b/apps/web/core/components/views/delete-view-modal.tsx
index b1810b30ff..f657fb60e8 100644
--- a/apps/web/core/components/views/delete-view-modal.tsx
+++ b/apps/web/core/components/views/delete-view-modal.tsx
@@ -1,15 +1,12 @@
-import React, { useState } from "react";
+import { useState } from "react";
import { observer } from "mobx-react";
import { useParams, useRouter } from "next/navigation";
// types
-import { PROJECT_VIEW_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IProjectView } from "@plane/types";
// ui
import { AlertModalCore } from "@plane/ui";
-// helpers
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useProjectView } from "@/hooks/store/use-project-view";
@@ -36,41 +33,24 @@ export const DeleteProjectViewModal = observer(function DeleteProjectViewModal(p
const handleDeleteView = async () => {
if (!workspaceSlug || !projectId) return;
-
- setIsDeleteLoading(true);
-
- await deleteView(workspaceSlug.toString(), projectId.toString(), data.id)
- .then(() => {
- handleClose();
- router.push(`/${workspaceSlug}/projects/${projectId}/views`);
- setToast({
- type: TOAST_TYPE.SUCCESS,
- title: "Success!",
- message: "View deleted successfully.",
- });
- captureSuccess({
- eventName: PROJECT_VIEW_TRACKER_EVENTS.delete,
- payload: {
- view_id: data.id,
- },
- });
- })
- .catch(() => {
- setToast({
- type: TOAST_TYPE.ERROR,
- title: "Error!",
- message: "View could not be deleted. Please try again.",
- });
- captureError({
- eventName: PROJECT_VIEW_TRACKER_EVENTS.delete,
- payload: {
- view_id: data.id,
- },
- });
- })
- .finally(() => {
- setIsDeleteLoading(false);
+ try {
+ setIsDeleteLoading(true);
+ await deleteView(workspaceSlug.toString(), projectId.toString(), data.id);
+ handleClose();
+ router.push(`/${workspaceSlug}/projects/${projectId}/views`);
+ setToast({
+ type: TOAST_TYPE.SUCCESS,
+ title: "Success!",
+ message: "View deleted successfully.",
});
+ } catch (_error) {
+ setToast({
+ type: TOAST_TYPE.ERROR,
+ title: "Error!",
+ message: "View could not be deleted. Please try again.",
+ });
+ }
+ setIsDeleteLoading(false);
};
return (
diff --git a/apps/web/core/components/views/modal.tsx b/apps/web/core/components/views/modal.tsx
index 289d1d44be..785e901ff0 100644
--- a/apps/web/core/components/views/modal.tsx
+++ b/apps/web/core/components/views/modal.tsx
@@ -1,14 +1,11 @@
-import type { FC } from "react";
import { observer } from "mobx-react";
// types
-import { PROJECT_VIEW_TRACKER_EVENTS } from "@plane/constants";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IProjectView } from "@plane/types";
import { EIssuesStoreType } from "@plane/types";
// ui
import { EModalPosition, EModalWidth, ModalCore } from "@plane/ui";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useIssues } from "@/hooks/store/use-issues";
import { useProjectView } from "@/hooks/store/use-project-view";
import { useWorkItemFilters } from "@/hooks/store/work-item-filters/use-work-item-filters";
@@ -42,60 +39,37 @@ export const CreateUpdateProjectViewModal = observer(function CreateUpdateProjec
};
const handleCreateView = async (payload: IProjectView) => {
- await createView(workspaceSlug, projectId, payload)
- .then((res) => {
- handleClose();
- router.push(`/${workspaceSlug}/projects/${projectId}/views/${res.id}`);
- setToast({
- type: TOAST_TYPE.SUCCESS,
- title: "Success!",
- message: "View created successfully.",
- });
- captureSuccess({
- eventName: PROJECT_VIEW_TRACKER_EVENTS.create,
- payload: {
- view_id: res.id,
- },
- });
- })
- .catch(() => {
- setToast({
- type: TOAST_TYPE.ERROR,
- title: "Error!",
- message: "Something went wrong. Please try again.",
- });
- captureError({
- eventName: PROJECT_VIEW_TRACKER_EVENTS.create,
- });
+ try {
+ const res = await createView(workspaceSlug, projectId, payload);
+ handleClose();
+ router.push(`/${workspaceSlug}/projects/${projectId}/views/${res.id}`);
+ setToast({
+ type: TOAST_TYPE.SUCCESS,
+ title: "Success!",
+ message: "View created successfully.",
});
+ } catch (_error) {
+ setToast({
+ type: TOAST_TYPE.ERROR,
+ title: "Error!",
+ message: "Failed to create view. Please try again.",
+ });
+ }
};
const handleUpdateView = async (payload: IProjectView) => {
- await updateView(workspaceSlug, projectId, data?.id as string, payload)
- .then((viewDetails) => {
- mutateFilters(workspaceSlug, viewDetails.id, viewDetails);
- resetExpression(EIssuesStoreType.PROJECT_VIEW, viewDetails.id, viewDetails.rich_filters);
- handleClose();
- captureSuccess({
- eventName: PROJECT_VIEW_TRACKER_EVENTS.update,
- payload: {
- view_id: data?.id,
- },
- });
- })
- .catch((err) => {
- setToast({
- type: TOAST_TYPE.ERROR,
- title: "Error!",
- message: err?.detail ?? "Something went wrong. Please try again.",
- });
- captureError({
- eventName: PROJECT_VIEW_TRACKER_EVENTS.update,
- payload: {
- view_id: data?.id,
- },
- });
+ try {
+ const viewDetails = await updateView(workspaceSlug, projectId, data?.id as string, payload);
+ mutateFilters(workspaceSlug, viewDetails.id, viewDetails);
+ resetExpression(EIssuesStoreType.PROJECT_VIEW, viewDetails.id, viewDetails.rich_filters);
+ handleClose();
+ } catch (_error) {
+ setToast({
+ type: TOAST_TYPE.ERROR,
+ title: "Error!",
+ message: "Failed to update view. Please try again.",
});
+ }
};
const handleFormSubmit = async (formData: IProjectView) => {
diff --git a/apps/web/core/components/views/quick-actions.tsx b/apps/web/core/components/views/quick-actions.tsx
index dbab8280b8..6e1faad59e 100644
--- a/apps/web/core/components/views/quick-actions.tsx
+++ b/apps/web/core/components/views/quick-actions.tsx
@@ -2,7 +2,7 @@ import { useState } from "react";
import { observer } from "mobx-react";
import { MoreHorizontal } from "lucide-react";
// types
-import { EUserPermissions, EUserPermissionsLevel, PROJECT_VIEW_TRACKER_ELEMENTS } from "@plane/constants";
+import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { IconButton } from "@plane/propel/icon-button";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IProjectView } from "@plane/types";
@@ -12,7 +12,6 @@ import { ContextMenu, CustomMenu } from "@plane/ui";
import { copyUrlToClipboard, cn } from "@plane/utils";
// helpers
import { useViewMenuItems } from "@/components/common/quick-actions-helper";
-import { captureClick } from "@/helpers/event-tracker.helper";
// hooks
import { useUser, useUserPermissions } from "@/hooks/store/user";
import { PublishViewModal, useViewPublish } from "@/plane-web/components/views/publish";
@@ -77,9 +76,7 @@ export const ViewQuickActions = observer(function ViewQuickActions(props: Props)
const CONTEXT_MENU_ITEMS = MENU_ITEMS.map(function CONTEXT_MENU_ITEMS(item) {
return {
...item,
-
action: () => {
- captureClick({ elementName: PROJECT_VIEW_TRACKER_ELEMENTS.LIST_ITEM_CONTEXT_MENU });
item.action();
},
};
@@ -110,7 +107,6 @@ export const ViewQuickActions = observer(function ViewQuickActions(props: Props)
{
- captureClick({ elementName: PROJECT_VIEW_TRACKER_ELEMENTS.QUICK_ACTIONS });
item.action();
}}
className={cn(
diff --git a/apps/web/core/components/web-hooks/create-webhook-modal.tsx b/apps/web/core/components/web-hooks/create-webhook-modal.tsx
index 49f8b6c313..e3c36746a2 100644
--- a/apps/web/core/components/web-hooks/create-webhook-modal.tsx
+++ b/apps/web/core/components/web-hooks/create-webhook-modal.tsx
@@ -1,7 +1,6 @@
-import React, { useState } from "react";
+import { useState } from "react";
import { useParams } from "next/navigation";
// types
-import { WORKSPACE_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IWebhook, IWorkspace, TWebhookEventTypes } from "@plane/types";
@@ -10,7 +9,6 @@ import { EModalPosition, EModalWidth, ModalCore } 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";
@@ -68,12 +66,6 @@ export function CreateWebhookModal(props: ICreateWebhookModal) {
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"),
@@ -86,13 +78,6 @@ export function CreateWebhookModal(props: ICreateWebhookModal) {
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"),
diff --git a/apps/web/core/components/web-hooks/delete-webhook-modal.tsx b/apps/web/core/components/web-hooks/delete-webhook-modal.tsx
index f370b8b606..11d72cd904 100644
--- a/apps/web/core/components/web-hooks/delete-webhook-modal.tsx
+++ b/apps/web/core/components/web-hooks/delete-webhook-modal.tsx
@@ -1,11 +1,9 @@
import { useState } from "react";
import { useParams } from "next/navigation";
// ui
-import { WORKSPACE_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import { AlertModalCore } from "@plane/ui";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useWebhook } from "@/hooks/store/use-webhook";
import { useAppRouter } from "@/hooks/use-app-router";
@@ -31,39 +29,23 @@ export function DeleteWebhookModal(props: IDeleteWebhook) {
const handleDelete = async () => {
if (!workspaceSlug || !webhookId) return;
-
setIsDeleting(true);
-
- 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) => {
- 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));
+ try {
+ await removeWebhook(workspaceSlug.toString(), webhookId.toString());
+ router.replace(`/${workspaceSlug}/settings/webhooks/`);
+ setToast({
+ type: TOAST_TYPE.SUCCESS,
+ title: "Success!",
+ message: "Webhook deleted successfully.",
+ });
+ } catch (_error) {
+ setToast({
+ type: TOAST_TYPE.ERROR,
+ title: "Error!",
+ message: "Webhook could not be deleted. Please try again.",
+ });
+ }
+ setIsDeleting(false);
};
return (
diff --git a/apps/web/core/components/web-hooks/form/toggle.tsx b/apps/web/core/components/web-hooks/form/toggle.tsx
index b83f88cc26..88aca446df 100644
--- a/apps/web/core/components/web-hooks/form/toggle.tsx
+++ b/apps/web/core/components/web-hooks/form/toggle.tsx
@@ -1,12 +1,9 @@
import type { Control } from "react-hook-form";
import { Controller } from "react-hook-form";
// constants
-import { WORKSPACE_SETTINGS_TRACKER_ELEMENTS } from "@plane/constants";
import type { IWebhook } from "@plane/types";
// ui
import { ToggleSwitch } from "@plane/ui";
-// hooks
-import { captureClick } from "@/helpers/event-tracker.helper";
interface IWebHookToggle {
control: Control;
@@ -23,9 +20,6 @@ export function WebhookToggle({ control }: IWebHookToggle) {
{
- captureClick({
- elementName: WORKSPACE_SETTINGS_TRACKER_ELEMENTS.WEBHOOK_DETAILS_PAGE_TOGGLE_SWITCH,
- });
onChange(val);
}}
size="sm"
diff --git a/apps/web/core/components/web-hooks/webhooks-list-item.tsx b/apps/web/core/components/web-hooks/webhooks-list-item.tsx
index 023bb13991..1355406f7a 100644
--- a/apps/web/core/components/web-hooks/webhooks-list-item.tsx
+++ b/apps/web/core/components/web-hooks/webhooks-list-item.tsx
@@ -1,14 +1,10 @@
-import type { FC } from "react";
import Link from "next/link";
import { useParams } from "next/navigation";
-import { WORKSPACE_SETTINGS_TRACKER_ELEMENTS, WORKSPACE_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
+// Plane imports
import type { IWebhook } from "@plane/types";
-// hooks
import { ToggleSwitch } from "@plane/ui";
-import { captureElementAndEvent } from "@/helpers/event-tracker.helper";
+// hooks
import { useWebhook } from "@/hooks/store/use-webhook";
-// ui
-// types
interface IWebhookListItem {
webhook: IWebhook;
@@ -21,37 +17,9 @@ export function WebhooksListItem(props: IWebhookListItem) {
// store hooks
const { updateWebhook } = useWebhook();
- const handleToggle = () => {
+ const handleToggle = async () => {
if (!workspaceSlug || !webhook.id) return;
- updateWebhook(workspaceSlug.toString(), webhook.id, { is_active: !webhook.is_active })
- .then(() => {
- captureElementAndEvent({
- element: {
- elementName: WORKSPACE_SETTINGS_TRACKER_ELEMENTS.WEBHOOK_LIST_ITEM_TOGGLE_SWITCH,
- },
- event: {
- eventName: WORKSPACE_SETTINGS_TRACKER_EVENTS.webhook_toggled,
- state: "SUCCESS",
- payload: {
- webhook: webhook.url,
- },
- },
- });
- })
- .catch(() => {
- captureElementAndEvent({
- element: {
- elementName: WORKSPACE_SETTINGS_TRACKER_ELEMENTS.WEBHOOK_LIST_ITEM_TOGGLE_SWITCH,
- },
- event: {
- eventName: WORKSPACE_SETTINGS_TRACKER_EVENTS.webhook_toggled,
- state: "ERROR",
- payload: {
- webhook: webhook.url,
- },
- },
- });
- });
+ await updateWebhook(workspaceSlug.toString(), webhook.id, { is_active: !webhook.is_active });
};
return (
diff --git a/apps/web/core/components/work-item-filters/filters-hoc/project-level.tsx b/apps/web/core/components/work-item-filters/filters-hoc/project-level.tsx
index b076ff03fd..2c3f42207c 100644
--- a/apps/web/core/components/work-item-filters/filters-hoc/project-level.tsx
+++ b/apps/web/core/components/work-item-filters/filters-hoc/project-level.tsx
@@ -2,7 +2,7 @@ import { useCallback, useMemo, useState } from "react";
import { isEqual, cloneDeep } from "lodash-es";
import { observer } from "mobx-react";
// plane imports
-import { EUserPermissionsLevel, PROJECT_VIEW_TRACKER_EVENTS } from "@plane/constants";
+import { EUserPermissionsLevel } from "@plane/constants";
import { setToast, TOAST_TYPE } from "@plane/propel/toast";
import type { IProjectView, TWorkItemFilterExpression } from "@plane/types";
import { EUserProjectRoles, EViewAccess } from "@plane/types";
@@ -10,7 +10,6 @@ import { EUserProjectRoles, EViewAccess } from "@plane/types";
import { removeNillKeys } from "@/components/issues/issue-layouts/utils";
import { CreateUpdateProjectViewModal } from "@/components/views/modal";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useCycle } from "@/hooks/store/use-cycle";
import { useLabel } from "@/hooks/store/use-label";
import { useMember } from "@/hooks/store/use-member";
@@ -153,12 +152,6 @@ export const ProjectLevelWorkItemFiltersHOC = observer(function ProjectLevelWork
title: "Success!",
message: "Your view has been updated successfully.",
});
- captureSuccess({
- eventName: PROJECT_VIEW_TRACKER_EVENTS.update,
- payload: {
- view_id: viewDetails.id,
- },
- });
})
.catch(() => {
setToast({
@@ -166,12 +159,6 @@ export const ProjectLevelWorkItemFiltersHOC = observer(function ProjectLevelWork
title: "Error!",
message: "Your view could not be updated. Please try again.",
});
- captureError({
- eventName: PROJECT_VIEW_TRACKER_EVENTS.update,
- payload: {
- view_id: viewDetails.id,
- },
- });
});
},
[viewDetails, updateView, workspaceSlug, projectId, getViewFilterPayload]
diff --git a/apps/web/core/components/work-item-filters/filters-hoc/workspace-level.tsx b/apps/web/core/components/work-item-filters/filters-hoc/workspace-level.tsx
index 59842f8e94..5f15f8fe1c 100644
--- a/apps/web/core/components/work-item-filters/filters-hoc/workspace-level.tsx
+++ b/apps/web/core/components/work-item-filters/filters-hoc/workspace-level.tsx
@@ -2,7 +2,7 @@ import { useCallback, useMemo, useState } from "react";
import { isEqual, cloneDeep } from "lodash-es";
import { observer } from "mobx-react";
// plane imports
-import { DEFAULT_GLOBAL_VIEWS_LIST, EUserPermissionsLevel, GLOBAL_VIEW_TRACKER_EVENTS } from "@plane/constants";
+import { DEFAULT_GLOBAL_VIEWS_LIST, EUserPermissionsLevel } from "@plane/constants";
import { setToast, TOAST_TYPE } from "@plane/propel/toast";
import type { IWorkspaceView, TWorkItemFilterExpression } from "@plane/types";
import { EUserProjectRoles, EViewAccess } from "@plane/types";
@@ -10,7 +10,6 @@ import { EUserProjectRoles, EViewAccess } from "@plane/types";
import { removeNillKeys } from "@/components/issues/issue-layouts/utils";
import { CreateUpdateWorkspaceViewModal } from "@/components/workspace/views/modal";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useGlobalView } from "@/hooks/store/use-global-view";
import { useLabel } from "@/hooks/store/use-label";
import { useMember } from "@/hooks/store/use-member";
@@ -140,12 +139,6 @@ export const WorkspaceLevelWorkItemFiltersHOC = observer(function WorkspaceLevel
title: "Success!",
message: "Your view has been updated successfully.",
});
- captureSuccess({
- eventName: GLOBAL_VIEW_TRACKER_EVENTS.update,
- payload: {
- view_id: viewDetails.id,
- },
- });
})
.catch(() => {
setToast({
@@ -153,12 +146,6 @@ export const WorkspaceLevelWorkItemFiltersHOC = observer(function WorkspaceLevel
title: "Error!",
message: "Your view could not be updated. Please try again.",
});
- captureError({
- eventName: GLOBAL_VIEW_TRACKER_EVENTS.update,
- payload: {
- view_id: viewDetails.id,
- },
- });
});
},
[viewDetails, updateGlobalView, workspaceSlug, getViewFilterPayload]
diff --git a/apps/web/core/components/workspace-notifications/sidebar/header/options/root.tsx b/apps/web/core/components/workspace-notifications/sidebar/header/options/root.tsx
index e1469e7cca..e90622de40 100644
--- a/apps/web/core/components/workspace-notifications/sidebar/header/options/root.tsx
+++ b/apps/web/core/components/workspace-notifications/sidebar/header/options/root.tsx
@@ -1,17 +1,10 @@
import { observer } from "mobx-react";
import { CheckCheck, RefreshCw } from "lucide-react";
// plane imports
-import {
- ENotificationLoader,
- ENotificationQueryParamType,
- NOTIFICATION_TRACKER_ELEMENTS,
- NOTIFICATION_TRACKER_EVENTS,
-} from "@plane/constants";
+import { ENotificationLoader, ENotificationQueryParamType } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { Tooltip } from "@plane/propel/tooltip";
import { Spinner } from "@plane/ui";
-// helpers
-import { captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useWorkspaceNotifications } from "@/hooks/store/notifications";
import { usePlatformOS } from "@/hooks/use-platform-os";
@@ -59,12 +52,8 @@ export const NotificationSidebarHeaderOptions = observer(function NotificationSi
{
- captureSuccess({
- eventName: NOTIFICATION_TRACKER_EVENTS.all_marked_read,
- });
handleMarkAllNotificationsAsRead();
}}
/>
diff --git a/apps/web/core/components/workspace-notifications/sidebar/notification-card/options/archive.tsx b/apps/web/core/components/workspace-notifications/sidebar/notification-card/options/archive.tsx
index 61c2f8ac50..3c1c76399a 100644
--- a/apps/web/core/components/workspace-notifications/sidebar/notification-card/options/archive.tsx
+++ b/apps/web/core/components/workspace-notifications/sidebar/notification-card/options/archive.tsx
@@ -1,14 +1,9 @@
import { observer } from "mobx-react";
import { ArchiveRestore } from "lucide-react";
// plane imports
-import { NOTIFICATION_TRACKER_ELEMENTS, NOTIFICATION_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { ArchiveIcon } from "@plane/propel/icons";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
-// helpers
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
-// hooks
-import { useWorkspaceNotifications } from "@/hooks/store/notifications";
// store
import type { INotification } from "@/store/notifications/notification";
// local imports
@@ -24,7 +19,6 @@ export const NotificationItemArchiveOption = observer(function NotificationItemA
) {
const { workspaceSlug, notification } = props;
// hooks
- const { currentNotificationTab } = useWorkspaceNotifications();
const { asJson: data, archiveNotification, unArchiveNotification } = notification;
const { t } = useTranslation();
@@ -32,32 +26,17 @@ export const NotificationItemArchiveOption = observer(function NotificationItemA
try {
const request = data.archived_at ? unArchiveNotification : archiveNotification;
await request(workspaceSlug);
- captureSuccess({
- eventName: data.archived_at ? NOTIFICATION_TRACKER_EVENTS.unarchive : NOTIFICATION_TRACKER_EVENTS.archive,
- payload: {
- id: data?.data?.issue?.id,
- tab: currentNotificationTab,
- },
- });
setToast({
title: data.archived_at ? t("notification.toasts.unarchived") : t("notification.toasts.archived"),
type: TOAST_TYPE.SUCCESS,
});
} catch (e) {
console.error(e);
- captureError({
- eventName: data.archived_at ? NOTIFICATION_TRACKER_EVENTS.unarchive : NOTIFICATION_TRACKER_EVENTS.archive,
- payload: {
- id: data?.data?.issue?.id,
- tab: currentNotificationTab,
- },
- });
}
};
return (
diff --git a/apps/web/core/components/workspace/create-workspace-form.tsx b/apps/web/core/components/workspace/create-workspace-form.tsx
index 8b380da8df..2af67c09e9 100644
--- a/apps/web/core/components/workspace/create-workspace-form.tsx
+++ b/apps/web/core/components/workspace/create-workspace-form.tsx
@@ -2,12 +2,7 @@ import type { Dispatch, SetStateAction } from "react";
import { useEffect, useState } from "react";
import { observer } from "mobx-react";
import { Controller, useForm } from "react-hook-form";
-import {
- ORGANIZATION_SIZE,
- RESTRICTED_URLS,
- WORKSPACE_TRACKER_ELEMENTS,
- WORKSPACE_TRACKER_EVENTS,
-} from "@plane/constants";
+import { ORGANIZATION_SIZE, RESTRICTED_URLS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { Button } from "@plane/propel/button";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
@@ -15,7 +10,6 @@ import type { IWorkspace } from "@plane/types";
// ui
import { CustomSelect, Input } from "@plane/ui";
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useWorkspace } from "@/hooks/store/use-workspace";
import { useAppRouter } from "@/hooks/use-app-router";
// services
@@ -71,13 +65,8 @@ export const CreateWorkspaceForm = observer(function CreateWorkspaceForm(props:
const res = (await workspaceService.workspaceSlugCheck(formData.slug)) as { status: boolean };
if (res.status === true && !RESTRICTED_URLS.includes(formData.slug)) {
setSlugError(false);
-
try {
const workspaceResponse = await createWorkspace(formData);
- captureSuccess({
- eventName: WORKSPACE_TRACKER_EVENTS.create,
- payload: { slug: formData.slug },
- });
setToast({
type: TOAST_TYPE.SUCCESS,
title: t("workspace_creation.toast.success.title"),
@@ -86,11 +75,6 @@ export const CreateWorkspaceForm = observer(function CreateWorkspaceForm(props:
if (onSubmit) await onSubmit(workspaceResponse);
} catch {
- captureError({
- eventName: WORKSPACE_TRACKER_EVENTS.create,
- payload: { slug: formData.slug },
- error: new Error("Error creating workspace"),
- });
setToast({
type: TOAST_TYPE.ERROR,
title: t("workspace_creation.toast.error.title"),
@@ -250,14 +234,7 @@ export const CreateWorkspaceForm = observer(function CreateWorkspaceForm(props:
{secondaryButton}
-
+
{isSubmitting ? t(primaryButtonText.loading) : t(primaryButtonText.default)}
{!secondaryButton && (
diff --git a/apps/web/core/components/workspace/delete-workspace-form.tsx b/apps/web/core/components/workspace/delete-workspace-form.tsx
index 52603caabb..c0041d8ab6 100644
--- a/apps/web/core/components/workspace/delete-workspace-form.tsx
+++ b/apps/web/core/components/workspace/delete-workspace-form.tsx
@@ -1,18 +1,14 @@
-import React from "react";
import { observer } from "mobx-react";
import { Controller, useForm } from "react-hook-form";
import { AlertTriangle } from "lucide-react";
-// types
-import { WORKSPACE_TRACKER_EVENTS } from "@plane/constants";
+// Plane Imports
import { useTranslation } from "@plane/i18n";
import { Button } from "@plane/propel/button";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IWorkspace } from "@plane/types";
-// ui
import { Input } from "@plane/ui";
-// hooks
import { cn } from "@plane/utils";
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
+// hooks
import { useWorkspace } from "@/hooks/store/use-workspace";
import { useUserSettings } from "@/hooks/store/user";
import { useAppRouter } from "@/hooks/use-app-router";
@@ -59,33 +55,23 @@ export const DeleteWorkspaceForm = observer(function DeleteWorkspaceForm(props:
const onSubmit = async () => {
if (!data || !canDelete) return;
- await deleteWorkspace(data.slug)
- .then(async () => {
- await fetchCurrentUserSettings();
- handleClose();
- router.push(getWorkspaceRedirectionUrl());
- captureSuccess({
- eventName: WORKSPACE_TRACKER_EVENTS.delete,
- payload: { slug: data.slug },
- });
- setToast({
- type: TOAST_TYPE.SUCCESS,
- title: t("workspace_settings.settings.general.delete_modal.success_title"),
- message: t("workspace_settings.settings.general.delete_modal.success_message"),
- });
- })
- .catch(() => {
- setToast({
- type: TOAST_TYPE.ERROR,
- title: t("workspace_settings.settings.general.delete_modal.error_title"),
- message: t("workspace_settings.settings.general.delete_modal.error_message"),
- });
- captureError({
- eventName: WORKSPACE_TRACKER_EVENTS.delete,
- payload: { slug: data.slug },
- error: new Error("Error deleting workspace"),
- });
+ try {
+ await deleteWorkspace(data.slug);
+ await fetchCurrentUserSettings();
+ handleClose();
+ router.push(getWorkspaceRedirectionUrl());
+ setToast({
+ type: TOAST_TYPE.SUCCESS,
+ title: t("workspace_settings.settings.general.delete_modal.success_title"),
+ message: t("workspace_settings.settings.general.delete_modal.success_message"),
});
+ } catch (_error) {
+ setToast({
+ type: TOAST_TYPE.ERROR,
+ title: t("workspace_settings.settings.general.delete_modal.error_title"),
+ message: t("workspace_settings.settings.general.delete_modal.error_message"),
+ });
+ }
};
return (
diff --git a/apps/web/core/components/workspace/settings/invitations-list-item.tsx b/apps/web/core/components/workspace/settings/invitations-list-item.tsx
index 8565436556..12b4cc821f 100644
--- a/apps/web/core/components/workspace/settings/invitations-list-item.tsx
+++ b/apps/web/core/components/workspace/settings/invitations-list-item.tsx
@@ -1,9 +1,8 @@
import { useState } from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
-
// plane imports
-import { ROLE, EUserPermissions, EUserPermissionsLevel, MEMBER_TRACKER_ELEMENTS } from "@plane/constants";
+import { ROLE, EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { LinkIcon, TrashIcon, ChevronDownIcon } from "@plane/propel/icons";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
@@ -13,7 +12,6 @@ import { cn, copyTextToClipboard } from "@plane/utils";
// components
import { ConfirmWorkspaceMemberRemove } from "@/components/workspace/confirm-workspace-member-remove";
// hooks
-import { captureClick } from "@/helpers/event-tracker.helper";
import { useMember } from "@/hooks/store/use-member";
import { useUserPermissions } from "@/hooks/store/user";
@@ -96,9 +94,6 @@ export const WorkspaceInvitationsListItem = observer(function WorkspaceInvitatio
{
key: "remove",
action: () => {
- captureClick({
- elementName: MEMBER_TRACKER_ELEMENTS.WORKSPACE_INVITATIONS_LIST_CONTEXT_MENU,
- });
setRemoveMemberModal(true);
},
title: t("common.remove"),
diff --git a/apps/web/core/components/workspace/settings/members-list-item.tsx b/apps/web/core/components/workspace/settings/members-list-item.tsx
index 31c41615db..9499110ee5 100644
--- a/apps/web/core/components/workspace/settings/members-list-item.tsx
+++ b/apps/web/core/components/workspace/settings/members-list-item.tsx
@@ -1,7 +1,6 @@
import { isEmpty } from "lodash-es";
import { observer } from "mobx-react";
// plane imports
-import { MEMBER_TRACKER_EVENTS } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IWorkspaceMember } from "@plane/types";
@@ -10,8 +9,6 @@ import { Table } from "@plane/ui";
import { MembersLayoutLoader } from "@/components/ui/loader/layouts/members-layout-loader";
import { ConfirmWorkspaceMemberRemove } from "@/components/workspace/confirm-workspace-member-remove";
import type { RowData } from "@/components/workspace/settings/member-columns";
-// helpers
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useMember } from "@/hooks/store/use-member";
import { useWorkspace } from "@/hooks/store/use-workspace";
@@ -47,22 +44,8 @@ export const WorkspaceMembersListItem = observer(function WorkspaceMembersListIt
await leaveWorkspace(workspaceSlug.toString());
await fetchCurrentUserSettings();
router.push(getWorkspaceRedirectionUrl());
- captureSuccess({
- eventName: MEMBER_TRACKER_EVENTS.workspace.leave,
- payload: {
- workspace: workspaceSlug,
- },
- });
} catch (err: unknown) {
const error = err as { error?: string };
- const errorForCapture: Error | string = err instanceof Error ? err : String(err);
- captureError({
- eventName: MEMBER_TRACKER_EVENTS.workspace.leave,
- payload: {
- workspace: workspaceSlug,
- },
- error: errorForCapture,
- });
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
diff --git a/apps/web/core/components/workspace/settings/workspace-details.tsx b/apps/web/core/components/workspace/settings/workspace-details.tsx
index bc13dfbd25..5bcc832d2d 100644
--- a/apps/web/core/components/workspace/settings/workspace-details.tsx
+++ b/apps/web/core/components/workspace/settings/workspace-details.tsx
@@ -1,15 +1,8 @@
import { useEffect, useState } from "react";
import { observer } from "mobx-react";
import { Controller, useForm } from "react-hook-form";
-
-// constants
-import {
- ORGANIZATION_SIZE,
- EUserPermissions,
- EUserPermissionsLevel,
- WORKSPACE_TRACKER_EVENTS,
- WORKSPACE_TRACKER_ELEMENTS,
-} from "@plane/constants";
+// Plane Imports
+import { ORGANIZATION_SIZE, EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import { Button } from "@plane/propel/button";
import { EditIcon } from "@plane/propel/icons";
@@ -19,9 +12,8 @@ import { CustomSelect, Input } from "@plane/ui";
import { copyUrlToClipboard, getFileURL } from "@plane/utils";
// components
import { WorkspaceImageUploadModal } from "@/components/core/modals/workspace-image-upload-modal";
-// helpers
import { TimezoneSelect } from "@/components/global/timezone-select";
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
+// hooks
import { useWorkspace } from "@/hooks/store/use-workspace";
import { useUserPermissions } from "@/hooks/store/user";
// plane web components
@@ -70,21 +62,12 @@ export const WorkspaceDetails = observer(function WorkspaceDetails() {
try {
await updateWorkspace(currentWorkspace.slug, payload);
- captureSuccess({
- eventName: WORKSPACE_TRACKER_EVENTS.update,
- payload: { slug: currentWorkspace.slug },
- });
setToast({
title: "Success!",
type: TOAST_TYPE.SUCCESS,
message: "Workspace updated successfully",
});
} catch (err: unknown) {
- captureError({
- eventName: WORKSPACE_TRACKER_EVENTS.update,
- payload: { slug: currentWorkspace.slug },
- error: err instanceof Error ? err : new Error(String(err)),
- });
console.error(err);
} finally {
setTimeout(() => {
@@ -305,7 +288,6 @@ export const WorkspaceDetails = observer(function WorkspaceDetails() {
{isAdmin && (
{
diff --git a/apps/web/core/components/workspace/sidebar/user-menu-item.tsx b/apps/web/core/components/workspace/sidebar/user-menu-item.tsx
index 183332502c..1360511bb9 100644
--- a/apps/web/core/components/workspace/sidebar/user-menu-item.tsx
+++ b/apps/web/core/components/workspace/sidebar/user-menu-item.tsx
@@ -2,15 +2,13 @@ import { observer } from "mobx-react";
import Link from "next/link";
import { useParams, usePathname } from "next/navigation";
// plane imports
-import { EUserPermissionsLevel, SIDEBAR_TRACKER_ELEMENTS } from "@plane/constants";
-
+import { EUserPermissionsLevel } from "@plane/constants";
import { useTranslation } from "@plane/i18n";
import type { EUserWorkspaceRoles } from "@plane/types";
// components
import { SidebarNavItem } from "@/components/sidebar/sidebar-navigation";
import { NotificationAppSidebarOption } from "@/components/workspace-notifications/notification-app-sidebar-option";
// hooks
-import { captureClick } from "@/helpers/event-tracker.helper";
import { useAppTheme } from "@/hooks/store/use-app-theme";
import { useUserPermissions } from "@/hooks/store/user";
@@ -44,20 +42,14 @@ export const SidebarUserMenuItem = observer(function SidebarUserMenuItem(props:
// eslint-disable-next-line @typescript-eslint/no-explicit-any
if (!allowPermissions(item.access as any, EUserPermissionsLevel.WORKSPACE, workspaceSlug.toString())) return null;
- const handleLinkClick = (itemKey: string) => {
+ const handleLinkClick = () => {
if (window.innerWidth < 768) {
toggleSidebar();
}
- captureClick({
- elementName: SIDEBAR_TRACKER_ELEMENTS.USER_MENU_ITEM,
- context: {
- destination: itemKey,
- },
- });
};
return (
- handleLinkClick(item.key)}>
+
diff --git a/apps/web/core/components/workspace/views/delete-view-modal.tsx b/apps/web/core/components/workspace/views/delete-view-modal.tsx
index 744807a0e6..6562fe5333 100644
--- a/apps/web/core/components/workspace/views/delete-view-modal.tsx
+++ b/apps/web/core/components/workspace/views/delete-view-modal.tsx
@@ -1,16 +1,12 @@
-import React, { useState } from "react";
+import { useState } from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
-// types
-import { GLOBAL_VIEW_TRACKER_EVENTS } from "@plane/constants";
+// Plane Imports
import { useTranslation } from "@plane/i18n";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IWorkspaceView } from "@plane/types";
-// ui
import { AlertModalCore } from "@plane/ui";
-// constants
// hooks
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
import { useGlobalView } from "@/hooks/store/use-global-view";
type Props = {
@@ -32,37 +28,20 @@ export const DeleteGlobalViewModal = observer(function DeleteGlobalViewModal(pro
const handleDeletion = async () => {
if (!workspaceSlug) return;
-
setIsDeleteLoading(true);
- await deleteGlobalView(workspaceSlug.toString(), data.id)
- .then(() => {
- captureSuccess({
- eventName: GLOBAL_VIEW_TRACKER_EVENTS.delete,
- payload: {
- view_id: data.id,
- },
- });
- })
- .catch((error: any) => {
- captureError({
- eventName: GLOBAL_VIEW_TRACKER_EVENTS.delete,
- payload: {
- view_id: data.id,
- },
- error: error,
- });
- setToast({
- type: TOAST_TYPE.ERROR,
- title: "Error!",
- message: error?.error ?? "Something went wrong while deleting the view. Please try again.",
- });
- })
- .finally(() => {
- setIsDeleteLoading(false);
- handleClose();
+ try {
+ await deleteGlobalView(workspaceSlug.toString(), data.id);
+ } catch (_error) {
+ setToast({
+ type: TOAST_TYPE.ERROR,
+ title: "Error!",
+ message: "Failed to delete the view. Please try again.",
});
+ }
+ setIsDeleteLoading(false);
+ handleClose();
// remove filters from local storage
localStorage.removeItem(`global_view_filters/${data.id}`);
};
diff --git a/apps/web/core/components/workspace/views/header.tsx b/apps/web/core/components/workspace/views/header.tsx
index ef09a1e233..dd26d830c7 100644
--- a/apps/web/core/components/workspace/views/header.tsx
+++ b/apps/web/core/components/workspace/views/header.tsx
@@ -1,20 +1,12 @@
-import React, { useEffect, useRef, useState } from "react";
+import { useEffect, useRef, useState } from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// plane imports
-import {
- DEFAULT_GLOBAL_VIEWS_LIST,
- EUserPermissions,
- EUserPermissionsLevel,
- GLOBAL_VIEW_TRACKER_ELEMENTS,
- GLOBAL_VIEW_TRACKER_EVENTS,
-} from "@plane/constants";
+import { DEFAULT_GLOBAL_VIEWS_LIST, EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { PlusIcon } from "@plane/propel/icons";
import type { TStaticViewTypes } from "@plane/types";
import { Header, EHeaderVariant } from "@plane/ui";
-// helpers
-import { captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useGlobalView } from "@/hooks/store/use-global-view";
import { useUserPermissions } from "@/hooks/store/user";
@@ -76,15 +68,6 @@ export const GlobalViewsHeader = observer(function GlobalViewsHeader() {
// bring the active view to the centre of the header
useEffect(() => {
if (globalViewId && currentWorkspaceViews) {
- captureSuccess({
- eventName: GLOBAL_VIEW_TRACKER_EVENTS.open,
- payload: {
- view_id: globalViewId,
- view_type: ["all-issues", "assigned", "created", "subscribed"].includes(globalViewId.toString())
- ? "Default"
- : "Custom",
- },
- });
const activeTabElement = document.querySelector(`#global-view-${globalViewId.toString()}`);
if (activeTabElement && containerRef.current) {
const containerRect = containerRef.current.getBoundingClientRect();
@@ -119,7 +102,6 @@ export const GlobalViewsHeader = observer(function GlobalViewsHeader() {
{isAuthorizedUser ? (
setCreateViewModal(true)}
>
diff --git a/apps/web/core/components/workspace/views/modal.tsx b/apps/web/core/components/workspace/views/modal.tsx
index 71483d7126..89a9102f9a 100644
--- a/apps/web/core/components/workspace/views/modal.tsx
+++ b/apps/web/core/components/workspace/views/modal.tsx
@@ -1,14 +1,10 @@
-import React from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// plane imports
-import { GLOBAL_VIEW_TRACKER_EVENTS } from "@plane/constants";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IWorkspaceView } from "@plane/types";
import { EIssuesStoreType } from "@plane/types";
import { EModalPosition, EModalWidth, ModalCore } from "@plane/ui";
-// helpers
-import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
// hooks
import { useGlobalView } from "@/hooks/store/use-global-view";
import { useWorkItemFilters } from "@/hooks/store/work-item-filters/use-work-item-filters";
@@ -40,83 +36,57 @@ export const CreateUpdateWorkspaceViewModal = observer(function CreateUpdateWork
const handleCreateView = async (payload: Partial) => {
if (!workspaceSlug) return;
- const payloadData: Partial = {
- ...payload,
- rich_filters: {
- ...payload?.rich_filters,
- },
- };
-
- await createGlobalView(workspaceSlug, payloadData)
- .then((res) => {
- captureSuccess({
- eventName: GLOBAL_VIEW_TRACKER_EVENTS.create,
- payload: {
- id: res.id,
- },
- });
- setToast({
- type: TOAST_TYPE.SUCCESS,
- title: "Success!",
- message: "View created successfully.",
- });
-
- router.push(`/${workspaceSlug}/workspace-views/${res.id}`);
- handleClose();
- })
- .catch(() => {
- captureError({
- eventName: GLOBAL_VIEW_TRACKER_EVENTS.create,
- });
- setToast({
- type: TOAST_TYPE.ERROR,
- title: "Error!",
- message: "View could not be created. Please try again.",
- });
+ try {
+ const payloadData: Partial = {
+ ...payload,
+ rich_filters: {
+ ...payload?.rich_filters,
+ },
+ };
+ const res = await createGlobalView(workspaceSlug, payloadData);
+ setToast({
+ type: TOAST_TYPE.SUCCESS,
+ title: "Success!",
+ message: "View created successfully.",
});
+ router.push(`/${workspaceSlug}/workspace-views/${res.id}`);
+ handleClose();
+ } catch (_error) {
+ setToast({
+ type: TOAST_TYPE.ERROR,
+ title: "Error!",
+ message: "View could not be created. Please try again.",
+ });
+ }
};
const handleUpdateView = async (payload: Partial) => {
if (!workspaceSlug || !data) return;
- const payloadData: Partial = {
- ...payload,
- query: {
- ...payload?.rich_filters,
- },
- };
-
- await updateGlobalView(workspaceSlug, data.id, payloadData)
- .then((res) => {
- if (res) {
- resetExpression(EIssuesStoreType.GLOBAL, data.id, res.rich_filters);
- captureSuccess({
- eventName: GLOBAL_VIEW_TRACKER_EVENTS.update,
- payload: {
- id: res.id,
- },
- });
- setToast({
- type: TOAST_TYPE.SUCCESS,
- title: "Success!",
- message: "View updated successfully.",
- });
- handleClose();
- }
- })
- .catch(() => {
- captureError({
- eventName: GLOBAL_VIEW_TRACKER_EVENTS.update,
- payload: {
- id: data.id,
- },
- });
+ try {
+ const payloadData: Partial = {
+ ...payload,
+ query: {
+ ...payload?.rich_filters,
+ },
+ };
+ const res = await updateGlobalView(workspaceSlug, data.id, payloadData);
+ if (res) {
+ resetExpression(EIssuesStoreType.GLOBAL, data.id, res.rich_filters);
setToast({
- type: TOAST_TYPE.ERROR,
- title: "Error!",
- message: "View could not be updated. Please try again.",
+ type: TOAST_TYPE.SUCCESS,
+ title: "Success!",
+ message: "View updated successfully.",
});
+ handleClose();
+ }
+ } catch (_error) {
+ setToast({
+ type: TOAST_TYPE.ERROR,
+ title: "Error!",
+ message: "View could not be updated. Please try again.",
});
+ }
};
const handleFormSubmit = async (formData: Partial) => {
diff --git a/apps/web/core/components/workspace/views/quick-action.tsx b/apps/web/core/components/workspace/views/quick-action.tsx
index 4739b2d076..0d70a3b8c4 100644
--- a/apps/web/core/components/workspace/views/quick-action.tsx
+++ b/apps/web/core/components/workspace/views/quick-action.tsx
@@ -1,14 +1,13 @@
import { useState } from "react";
import { observer } from "mobx-react";
// plane imports
-import { EUserPermissions, EUserPermissionsLevel, GLOBAL_VIEW_TRACKER_ELEMENTS } from "@plane/constants";
+import { EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import type { IWorkspaceView } from "@plane/types";
import { CustomMenu } from "@plane/ui";
import { copyUrlToClipboard, cn } from "@plane/utils";
// helpers
import { useViewMenuItems } from "@/components/common/quick-actions-helper";
-import { captureClick } from "@/helpers/event-tracker.helper";
// hooks
import { useUser, useUserPermissions } from "@/hooks/store/user";
// local imports
@@ -33,14 +32,15 @@ export const WorkspaceViewQuickActions = observer(function WorkspaceViewQuickAct
const isAdmin = allowPermissions([EUserPermissions.ADMIN], EUserPermissionsLevel.WORKSPACE);
const viewLink = `${workspaceSlug}/workspace-views/${view.id}`;
- const handleCopyText = () =>
- copyUrlToClipboard(viewLink).then(() => {
- setToast({
- type: TOAST_TYPE.SUCCESS,
- title: "Link Copied!",
- message: "View link copied to clipboard.",
- });
+ const handleCopyText = async () => {
+ await copyUrlToClipboard(viewLink);
+ setToast({
+ type: TOAST_TYPE.SUCCESS,
+ title: "Link Copied!",
+ message: "View link copied to clipboard.",
});
+ };
+
const handleOpenInNewTab = () => window.open(`/${viewLink}`, "_blank");
const MENU_ITEMS = useViewMenuItems({
@@ -70,9 +70,6 @@ export const WorkspaceViewQuickActions = observer(function WorkspaceViewQuickAct
{
- captureClick({
- elementName: GLOBAL_VIEW_TRACKER_ELEMENTS.QUICK_ACTIONS,
- });
item.action();
}}
className={cn(
diff --git a/apps/web/core/components/workspace/views/view-list-item.tsx b/apps/web/core/components/workspace/views/view-list-item.tsx
index 8f754fe592..0db808d0a0 100644
--- a/apps/web/core/components/workspace/views/view-list-item.tsx
+++ b/apps/web/core/components/workspace/views/view-list-item.tsx
@@ -2,14 +2,10 @@ import { useState } from "react";
import { observer } from "mobx-react";
import Link from "next/link";
import { useParams } from "next/navigation";
-
-import { GLOBAL_VIEW_TRACKER_ELEMENTS } from "@plane/constants";
-import { EditIcon, TrashIcon } from "@plane/propel/icons";
// plane imports
+import { EditIcon, TrashIcon } from "@plane/propel/icons";
import { CustomMenu } from "@plane/ui";
import { truncateText } from "@plane/utils";
-// helpers
-import { captureClick } from "@/helpers/event-tracker.helper";
// hooks
import { useGlobalView } from "@/hooks/store/use-global-view";
// local imports
@@ -51,9 +47,6 @@ export const GlobalViewListItem = observer(function GlobalViewListItem(props: Pr
{
- captureClick({
- elementName: GLOBAL_VIEW_TRACKER_ELEMENTS.LIST_ITEM,
- });
setUpdateViewModal(true);
}}
>
@@ -64,9 +57,6 @@ export const GlobalViewListItem = observer(function GlobalViewListItem(props: Pr
{
- captureClick({
- elementName: GLOBAL_VIEW_TRACKER_ELEMENTS.LIST_ITEM,
- });
setDeleteViewModal(true);
}}
>
diff --git a/apps/web/core/hooks/use-page-operations.ts b/apps/web/core/hooks/use-page-operations.ts
index 95537ef5dd..da63c3e768 100644
--- a/apps/web/core/hooks/use-page-operations.ts
+++ b/apps/web/core/hooks/use-page-operations.ts
@@ -1,12 +1,9 @@
import { useMemo } from "react";
// plane imports
-import { IS_FAVORITE_MENU_OPEN, PROJECT_PAGE_TRACKER_EVENTS } from "@plane/constants";
-import type { EditorRefApi } from "@plane/editor";
+import { IS_FAVORITE_MENU_OPEN } from "@plane/constants";
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
import { EPageAccess } from "@plane/types";
import { copyUrlToClipboard } from "@plane/utils";
-// helpers
-import { captureSuccess, captureError } from "@/helpers/event-tracker.helper";
// hooks
import { useCollaborativePageActions } from "@/hooks/use-collaborative-page-actions";
// store types
@@ -57,35 +54,23 @@ export const usePageOperations = (
const pageLink = getRedirectionLink();
return {
- copyLink: () => {
- copyUrlToClipboard(pageLink).then(() => {
- setToast({
- type: TOAST_TYPE.SUCCESS,
- title: "Link Copied!",
- message: "Page link copied to clipboard.",
- });
+ copyLink: async () => {
+ await copyUrlToClipboard(pageLink);
+ setToast({
+ type: TOAST_TYPE.SUCCESS,
+ title: "Link Copied!",
+ message: "Page link copied to clipboard.",
});
},
duplicate: async () => {
try {
await duplicate();
- captureSuccess({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.duplicate,
- payload: {
- id: page.id,
- state: "SUCCESS",
- },
- });
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",
message: "Page duplicated successfully.",
});
- } catch (error: any) {
- captureError({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.duplicate,
- error,
- });
+ } catch (_error) {
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
@@ -97,33 +82,16 @@ export const usePageOperations = (
openInNewTab: () => window.open(pageLink, "_blank"),
toggleAccess: async () => {
const changedPageType = access === EPageAccess.PUBLIC ? "private" : "public";
- const eventName = PROJECT_PAGE_TRACKER_EVENTS.access_update;
-
try {
if (access === EPageAccess.PUBLIC)
await executeCollaborativeAction({ type: "sendMessageToServer", message: "make-private" });
else await executeCollaborativeAction({ type: "sendMessageToServer", message: "make-public" });
-
- captureSuccess({
- eventName,
- payload: {
- id: page.id,
- from_access: access === EPageAccess.PUBLIC ? "Public" : "Private",
- to_access: access === EPageAccess.PUBLIC ? "Private" : "Public",
- state: "SUCCESS",
- },
- });
-
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",
message: `The page has been marked ${changedPageType} and moved to the ${changedPageType} section.`,
});
- } catch (error: any) {
- captureError({
- eventName,
- error,
- });
+ } catch (_error) {
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
@@ -135,23 +103,12 @@ export const usePageOperations = (
if (archived_at) {
try {
await executeCollaborativeAction({ type: "sendMessageToServer", message: "unarchive" });
- captureSuccess({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.restore,
- payload: {
- id: page.id,
- state: "SUCCESS",
- },
- });
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",
message: "Page restored successfully.",
});
- } catch (error: any) {
- captureError({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.restore,
- error,
- });
+ } catch (_error) {
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
@@ -161,23 +118,12 @@ export const usePageOperations = (
} else {
try {
await executeCollaborativeAction({ type: "sendMessageToServer", message: "archive" });
- captureSuccess({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.archive,
- payload: {
- id: page.id,
- state: "SUCCESS",
- },
- });
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",
message: "Page archived successfully.",
});
- } catch (error: any) {
- captureError({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.archive,
- error,
- });
+ } catch (_error) {
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
@@ -186,75 +132,50 @@ export const usePageOperations = (
}
}
},
- toggleFavorite: () => {
+ toggleFavorite: async () => {
if (is_favorite) {
- removePageFromFavorites()
- .then(() => {
- captureSuccess({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.unfavorite,
- payload: {
- id: page.id,
- state: "SUCCESS",
- },
- });
- setToast({
- type: TOAST_TYPE.SUCCESS,
- title: "Success!",
- message: "Page removed from favorites.",
- });
- })
- .catch((error) => {
- captureError({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.unfavorite,
- error,
- });
+ try {
+ await removePageFromFavorites();
+ setToast({
+ type: TOAST_TYPE.SUCCESS,
+ title: "Success!",
+ message: "Page removed from favorites.",
});
+ } catch (_error) {
+ setToast({
+ type: TOAST_TYPE.ERROR,
+ title: "Error!",
+ message: "Page could not be removed from favorites. Please try again later.",
+ });
+ }
} else {
- addToFavorites()
- .then(() => {
- captureSuccess({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.favorite,
- payload: {
- id: page.id,
- state: "SUCCESS",
- },
- });
- if (!isFavoriteMenuOpen) toggleFavoriteMenu(true);
- setToast({
- type: TOAST_TYPE.SUCCESS,
- title: "Success!",
- message: "Page added to favorites.",
- });
- })
- .catch((error) => {
- captureError({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.favorite,
- error,
- });
+ try {
+ await addToFavorites();
+ if (!isFavoriteMenuOpen) toggleFavoriteMenu(true);
+ setToast({
+ type: TOAST_TYPE.SUCCESS,
+ title: "Success!",
+ message: "Page added to favorites.",
});
+ } catch (_error) {
+ setToast({
+ type: TOAST_TYPE.ERROR,
+ title: "Error!",
+ message: "Page could not be added to favorites. Please try again later.",
+ });
+ }
}
},
toggleLock: async () => {
if (is_locked) {
try {
await executeCollaborativeAction({ type: "sendMessageToServer", message: "unlock" });
- captureSuccess({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.unlock,
- payload: {
- id: page.id,
- state: "SUCCESS",
- },
- });
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",
message: "Page unlocked successfully.",
});
- } catch (error: any) {
- captureError({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.unlock,
- error,
- });
+ } catch (_error) {
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
@@ -264,23 +185,12 @@ export const usePageOperations = (
} else {
try {
await executeCollaborativeAction({ type: "sendMessageToServer", message: "lock" });
- captureSuccess({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.lock,
- payload: {
- id: page.id,
- state: "SUCCESS",
- },
- });
setToast({
type: TOAST_TYPE.SUCCESS,
title: "Success!",
message: "Page locked successfully.",
});
- } catch (error: any) {
- captureError({
- eventName: PROJECT_PAGE_TRACKER_EVENTS.lock,
- error,
- });
+ } catch (_error) {
setToast({
type: TOAST_TYPE.ERROR,
title: "Error!",
@@ -300,7 +210,6 @@ export const usePageOperations = (
is_favorite,
is_locked,
isFavoriteMenuOpen,
- page.id,
removePageFromFavorites,
toggleFavoriteMenu,
]);
diff --git a/apps/web/core/lib/posthog-provider.tsx b/apps/web/core/lib/posthog-provider.tsx
deleted file mode 100644
index cb3d691a98..0000000000
--- a/apps/web/core/lib/posthog-provider.tsx
+++ /dev/null
@@ -1,120 +0,0 @@
-import type { ReactNode } from "react";
-import { lazy, Suspense, useEffect, useCallback, useRef, useState } from "react";
-import { PostHogProvider as PHProvider } from "@posthog/react";
-import { observer } from "mobx-react";
-import { useParams } from "next/navigation";
-import posthog from "posthog-js";
-// constants
-import { GROUP_WORKSPACE_TRACKER_EVENT } from "@plane/constants";
-// helpers
-import { getUserRole } from "@plane/utils";
-// hooks
-import { captureClick, joinEventGroup } from "@/helpers/event-tracker.helper";
-import { useInstance } from "@/hooks/store/use-instance";
-import { useWorkspace } from "@/hooks/store/use-workspace";
-import { useUser, useUserPermissions } from "@/hooks/store/user";
-// dynamic imports
-const PostHogPageView = lazy(function PostHogPageView() {
- return import("@/lib/posthog-view");
-});
-
-export interface IPosthogWrapper {
- children: ReactNode;
-}
-
-const PostHogProvider = observer(function PostHogProvider(props: IPosthogWrapper) {
- const { children } = props;
- const { data: user } = useUser();
- const { currentWorkspace } = useWorkspace();
- const { instance } = useInstance();
- const { workspaceSlug, projectId } = useParams();
- const { getWorkspaceRoleByWorkspaceSlug, getProjectRoleByWorkspaceSlugAndProjectId } = useUserPermissions();
- // refs
- const isInitializedRef = useRef(false);
- // states
- const [hydrated, setHydrated] = useState(false);
- // derived values
- const currentProjectRole = getProjectRoleByWorkspaceSlugAndProjectId(
- workspaceSlug?.toString(),
- projectId?.toString()
- );
- const currentWorkspaceRole = getWorkspaceRoleByWorkspaceSlug(workspaceSlug?.toString());
- const is_telemetry_enabled = instance?.is_telemetry_enabled || false;
- const is_posthog_enabled = process.env.VITE_POSTHOG_KEY && process.env.VITE_POSTHOG_HOST && is_telemetry_enabled;
-
- useEffect(() => {
- if (user && hydrated) {
- // Identify sends an event, so you want may want to limit how often you call it
- posthog?.identify(user.email, {
- id: user.id,
- first_name: user.first_name,
- last_name: user.last_name,
- email: user.email,
- workspace_role: currentWorkspaceRole ? getUserRole(currentWorkspaceRole) : undefined,
- project_role: currentProjectRole ? getUserRole(currentProjectRole) : undefined,
- });
- if (currentWorkspace) {
- joinEventGroup(GROUP_WORKSPACE_TRACKER_EVENT, currentWorkspace?.id, {
- date: new Date().toDateString(),
- workspace_id: currentWorkspace?.id,
- });
- }
- }
- }, [user, currentProjectRole, currentWorkspaceRole, currentWorkspace, hydrated]);
-
- useEffect(() => {
- if (isInitializedRef.current) return; // prevent multiple initializations
- const posthogKey = process.env.VITE_POSTHOG_KEY;
- const posthogHost = process.env.VITE_POSTHOG_HOST;
- const isDebugMode = process.env.VITE_POSTHOG_DEBUG === "1";
- if (posthogKey && posthogHost && !posthog.__loaded) {
- posthog.init(posthogKey, {
- api_host: posthogHost,
- ui_host: posthogHost,
- debug: isDebugMode, // Debug mode based on the environment variable
- autocapture: false,
- capture_pageview: false, // Disable automatic pageview capture, as we capture manually
- capture_pageleave: true,
- disable_session_recording: true,
- });
- isInitializedRef.current = true;
- setHydrated(true);
- }
- }, []);
-
- const clickHandler = useCallback((event: MouseEvent) => {
- const target = event.target as HTMLElement;
- // Use closest to find the nearest parent element with data-ph-element attribute
- const elementWithAttribute = target.closest("[data-ph-element]") as HTMLElement;
- if (elementWithAttribute) {
- const element = elementWithAttribute.getAttribute("data-ph-element");
- if (element) {
- captureClick({ elementName: element });
- }
- }
- }, []);
-
- useEffect(() => {
- if (!is_posthog_enabled || !hydrated) return;
-
- document.addEventListener("click", clickHandler);
-
- return () => {
- document.removeEventListener("click", clickHandler);
- };
- }, [hydrated, is_posthog_enabled, clickHandler]);
-
- if (is_posthog_enabled && hydrated)
- return (
-
-
-
-
- {children}
-
- );
-
- return <>{children}>;
-});
-
-export default PostHogProvider;
diff --git a/apps/web/core/lib/posthog-view.tsx b/apps/web/core/lib/posthog-view.tsx
deleted file mode 100644
index 1c29ea5670..0000000000
--- a/apps/web/core/lib/posthog-view.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { useEffect } from "react";
-import { usePathname, useSearchParams } from "next/navigation";
-// posthog
-import { usePostHog } from "posthog-js/react";
-
-export default function PostHogPageView(): null {
- const pathname = usePathname();
- const searchParams = useSearchParams();
- const posthog = usePostHog();
- useEffect(() => {
- // Track pageviews
- if (pathname && posthog) {
- let url = window.origin + pathname;
- if (searchParams.toString()) {
- url = url + `?${searchParams.toString()}`;
- }
- posthog.capture("$pageview", {
- $current_url: url,
- });
- }
- }, [pathname, searchParams, posthog]);
-
- return null;
-}
diff --git a/apps/web/helpers/event-tracker.helper.ts b/apps/web/helpers/event-tracker.helper.ts
deleted file mode 100644
index 908db1e54b..0000000000
--- a/apps/web/helpers/event-tracker.helper.ts
+++ /dev/null
@@ -1,146 +0,0 @@
-import posthog from "posthog-js";
-
-export type TEventState = "SUCCESS" | "ERROR";
-export type TElementContext = Record;
-export type TEventContext = Record;
-export type TInteractionType = "clicked" | "viewed" | "hovered";
-
-/**
- * Join a event group in PostHog
- * @param groupName - The name of the group
- * @param groupId - The ID of the group
- * @param properties - The properties of the group
- */
-export const joinEventGroup = (groupName: string, groupId: string, properties: Record) => {
- posthog?.group(groupName, groupId, properties);
-};
-
-type TCaptureElementParams = {
- elementName: string;
- interaction_type: TInteractionType;
- context?: TElementContext;
-};
-
-/**
- * Capture UI element interactions (clicks, hovers, views, etc.)
- * This helps understand user behavior and interaction patterns
- *
- * @param element - Generic UI element type
- * @param context - Context about where and why the interaction happened
- */
-const captureElement = (params: TCaptureElementParams) => {
- const { elementName, interaction_type, context } = params;
- if (!posthog) return;
-
- const elementEvent = `${elementName}_${interaction_type}`;
-
- const payload = {
- element_type: elementName,
- timestamp: new Date().toISOString(),
- ...context,
- };
-
- posthog.capture(elementEvent, payload);
-};
-
-type TCaptureClickParams = Omit;
-/**
- * Capture click events
- * @param element - The element that was clicked
- * @param context - Additional context
- */
-export const captureClick = (params: TCaptureClickParams) => {
- captureElement({ ...params, interaction_type: "clicked" });
-};
-
-type TCaptureViewParams = Omit;
-/**
- * Capture view events
- * @param element - The element that was viewed
- * @param context - Additional context
- */
-export const captureView = (params: TCaptureViewParams) => {
- captureElement({ ...params, interaction_type: "viewed" });
-};
-
-type TCaptureHoverParams = Omit;
-/**
- * Capture hover events
- * @param element - The element that was hovered
- * @param context - Additional context
- */
-export const captureHover = (params: TCaptureHoverParams) => {
- captureElement({ ...params, interaction_type: "hovered" });
-};
-
-type TCaptureEventParams = {
- eventName: string;
- payload?: Record;
- context?: TEventContext;
- state: TEventState;
-};
-/**
- * Capture business events (outcomes, state changes, etc.)
- * This helps understand business metrics and conversion rates
- *
- * @param eventName - Business event name (e.g., "cycle_created", "project_updated")
- * @param state - Success or error state
- * @param payload - Event-specific data
- * @param context - Additional context
- */
-const captureEvent = (params: TCaptureEventParams) => {
- const { eventName, payload, context, state } = params;
- if (!posthog) return;
-
- const finalPayload = {
- ...context,
- ...payload,
- state,
- timestamp: new Date().toISOString(),
- };
-
- posthog.capture(eventName, finalPayload);
-};
-
-type TCaptureSuccessParams = Omit;
-/**
- * Capture success events
- * @param eventName - The name of the event
- * @param payload - Additional payload
- * @param context - Additional context
- */
-export const captureSuccess = (params: TCaptureSuccessParams) => {
- captureEvent({ ...params, state: "SUCCESS" });
-};
-
-type TCaptureErrorParams = Omit & {
- error?: Error | string;
-};
-/**
- * Capture error events
- * @param eventName - The name of the event
- * @param error - The error object
- * @param payload - Additional payload
- * @param context - Additional context
- */
-export const captureError = (params: TCaptureErrorParams) => {
- captureEvent({ ...params, state: "ERROR", payload: { ...params.payload, error: params.error } });
-};
-
-type TCaptureElementAndEventParams = {
- element: Omit;
- event: TCaptureEventParams;
-};
-/**
- * Capture both element interaction and business event together
- * @param element - The element that was interacted with
- * @param event - The business event that was triggered
- */
-export const captureElementAndEvent = (params: TCaptureElementAndEventParams) => {
- const { element, event } = params;
- // Capture the element interaction first
- captureElement({ ...element, interaction_type: "clicked" });
-
- // Then capture the business event
- captureEvent(event);
-};
diff --git a/apps/web/package.json b/apps/web/package.json
index f775fd5c06..b738271348 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -37,7 +37,6 @@
"@plane/ui": "workspace:*",
"@plane/utils": "workspace:*",
"@popperjs/core": "^2.11.8",
- "@posthog/react": "^1.4.0",
"@react-pdf/renderer": "^3.4.5",
"@react-router/node": "catalog:",
"@sentry/react-router": "catalog:",
@@ -56,7 +55,6 @@
"mobx-react": "catalog:",
"mobx-utils": "catalog:",
"next-themes": "0.4.6",
- "posthog-js": "^1.255.1",
"react": "catalog:",
"react-color": "^2.19.3",
"react-dom": "catalog:",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index b330a1e0be..2a4b33c52a 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -639,9 +639,6 @@ importers:
'@popperjs/core':
specifier: ^2.11.8
version: 2.11.8
- '@posthog/react':
- specifier: ^1.4.0
- version: 1.4.0(@types/react@18.3.11)(posthog-js@1.255.1)(react@18.3.1)
'@react-pdf/renderer':
specifier: ^3.4.5
version: 3.4.5(react@18.3.1)
@@ -696,9 +693,6 @@ importers:
next-themes:
specifier: 0.4.6
version: 0.4.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
- posthog-js:
- specifier: ^1.255.1
- version: 1.255.1
react:
specifier: 'catalog:'
version: 18.3.1
@@ -2603,16 +2597,6 @@ packages:
'@popperjs/core@2.11.8':
resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==}
- '@posthog/react@1.4.0':
- resolution: {integrity: sha512-xzPeZ753fQ0deZzdgY/0YavZvNpmdaxUzLYJYu5XjONNcZ8PwJnNLEK+7D/Cj8UM4Q8nWI7QC5mjum0uLWa4FA==}
- peerDependencies:
- '@types/react': '>=16.8.0'
- posthog-js: '>=1.257.2'
- react: '>=16.8.0'
- peerDependenciesMeta:
- '@types/react':
- optional: true
-
'@prettier/plugin-oxc@0.1.3':
resolution: {integrity: sha512-aABz3zIRilpWMekbt1FL1JVBQrQLR8L4Td2SRctECrWSsXGTNn/G1BqNSKCdbvQS1LWstAXfqcXzDki7GAAJyg==}
engines: {node: '>=14'}
@@ -5116,9 +5100,6 @@ packages:
resolution: {integrity: sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==}
engines: {node: '>=18'}
- core-js@3.45.1:
- resolution: {integrity: sha512-L4NPsJlCfZsPeXukyzHFlg/i7IIVwHSItR0wg0FLNqYClJ4MQYTYLbC7EkjKYRLZF2iof2MUgN0EGy7MdQFChg==}
-
cors@2.8.5:
resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==}
engines: {node: '>= 0.10'}
@@ -5874,9 +5855,6 @@ packages:
fecha@4.2.3:
resolution: {integrity: sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==}
- fflate@0.4.8:
- resolution: {integrity: sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA==}
-
fflate@0.8.2:
resolution: {integrity: sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==}
@@ -7756,20 +7734,6 @@ packages:
resolution: {integrity: sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==}
engines: {node: '>=0.10.0'}
- posthog-js@1.255.1:
- resolution: {integrity: sha512-KMh0o9MhORhEZVjXpktXB5rJ8PfDk+poqBoTSoLzWgNjhJf6D8jcyB9jUMA6vVPfn4YeepVX5NuclDRqOwr5Mw==}
- peerDependencies:
- '@rrweb/types': 2.0.0-alpha.17
- rrweb-snapshot: 2.0.0-alpha.17
- peerDependenciesMeta:
- '@rrweb/types':
- optional: true
- rrweb-snapshot:
- optional: true
-
- preact@10.27.1:
- resolution: {integrity: sha512-V79raXEWch/rbqoNc7nT9E4ep7lu+mI3+sBmfRD4i1M73R3WLYcCtdI0ibxGVf4eQL8ZIz2nFacqEC+rmnOORQ==}
-
prelude-ls@1.2.1:
resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
engines: {node: '>= 0.8.0'}
@@ -9231,9 +9195,6 @@ packages:
web-namespaces@2.0.1:
resolution: {integrity: sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==}
- web-vitals@4.2.4:
- resolution: {integrity: sha512-r4DIlprAGwJ7YM11VZp4R884m0Vmgr6EAKe3P+kO0PPj3Unqyvv59rczf6UiGcb9Z8QxZVcqKNwv/g0WNdWwsw==}
-
webidl-conversions@3.0.1:
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
@@ -10715,13 +10676,6 @@ snapshots:
'@popperjs/core@2.11.8': {}
- '@posthog/react@1.4.0(@types/react@18.3.11)(posthog-js@1.255.1)(react@18.3.1)':
- dependencies:
- posthog-js: 1.255.1
- react: 18.3.1
- optionalDependencies:
- '@types/react': 18.3.11
-
'@prettier/plugin-oxc@0.1.3':
dependencies:
oxc-parser: 0.99.0
@@ -13546,8 +13500,6 @@ snapshots:
cookie@1.0.2: {}
- core-js@3.45.1: {}
-
cors@2.8.5:
dependencies:
object-assign: 4.1.1
@@ -14438,8 +14390,6 @@ snapshots:
fecha@4.2.3: {}
- fflate@0.4.8: {}
-
fflate@0.8.2: {}
file-entry-cache@8.0.0:
@@ -16633,15 +16583,6 @@ snapshots:
dependencies:
xtend: 4.0.2
- posthog-js@1.255.1:
- dependencies:
- core-js: 3.45.1
- fflate: 0.4.8
- preact: 10.27.1
- web-vitals: 4.2.4
-
- preact@10.27.1: {}
-
prelude-ls@1.2.1: {}
prettier@3.7.4: {}
@@ -18416,8 +18357,6 @@ snapshots:
web-namespaces@2.0.1: {}
- web-vitals@4.2.4: {}
-
webidl-conversions@3.0.1: {}
webidl-conversions@7.0.0:
diff --git a/turbo.json b/turbo.json
index 443c8fc703..5d1c227553 100644
--- a/turbo.json
+++ b/turbo.json
@@ -17,9 +17,6 @@
"VITE_ENABLE_SESSION_RECORDER",
"VITE_LIVE_BASE_PATH",
"VITE_LIVE_BASE_URL",
- "VITE_POSTHOG_DEBUG",
- "VITE_POSTHOG_HOST",
- "VITE_POSTHOG_KEY",
"VITE_SENTRY_DSN",
"VITE_SENTRY_ENVIRONMENT",
"VITE_SENTRY_PROFILES_SAMPLE_RATE",