Skip to content

Commit 5a69b98

Browse files
chore: remove event tracking
1 parent 0365bfb commit 5a69b98

File tree

105 files changed

+540
-2710
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+540
-2710
lines changed

apps/web/app/provider.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ const ChatSupportModal = lazy(function ChatSupportModal() {
2929
return import("@/components/global/chat-support-modal");
3030
});
3131

32-
const PostHogProvider = lazy(function PostHogProvider() {
33-
return import("@/lib/posthog-provider");
34-
});
35-
3632
export interface IAppProvider {
3733
children: React.ReactNode;
3834
}
@@ -52,9 +48,7 @@ export function AppProvider(props: IAppProvider) {
5248
<InstanceWrapper>
5349
<Suspense>
5450
<ChatSupportModal />
55-
<PostHogProvider>
56-
<SWRConfig value={WEB_SWR_CONFIG}>{children}</SWRConfig>
57-
</PostHogProvider>
51+
<SWRConfig value={WEB_SWR_CONFIG}>{children}</SWRConfig>
5852
</Suspense>
5953
</InstanceWrapper>
6054
</StoreWrapper>

apps/web/core/components/issues/issue-detail-widgets/attachments/helper.tsx

Lines changed: 15 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { useMemo } from "react";
2-
import { WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
32
import { setPromiseToast, TOAST_TYPE, setToast } from "@plane/propel/toast";
43
import type { TIssueServiceType } from "@plane/types";
54
import { EIssueServiceType } from "@plane/types";
65
// hooks
7-
import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
86
import { useIssueDetail } from "@/hooks/store/use-issue-detail";
97
// types
108
import type { TAttachmentUploadStatus } from "@/store/issue/issue-details/attachment.store";
@@ -36,34 +34,21 @@ export const useAttachmentOperations = (
3634
const attachmentOperations: TAttachmentOperations = useMemo(
3735
() => ({
3836
create: async (file) => {
39-
try {
40-
if (!workspaceSlug || !projectId || !issueId) throw new Error("Missing required fields");
41-
const attachmentUploadPromise = createAttachment(workspaceSlug, projectId, issueId, file);
42-
setPromiseToast(attachmentUploadPromise, {
43-
loading: "Uploading attachment...",
44-
success: {
45-
title: "Attachment uploaded",
46-
message: () => "The attachment has been successfully uploaded",
47-
},
48-
error: {
49-
title: "Attachment not uploaded",
50-
message: () => "The attachment could not be uploaded",
51-
},
52-
});
37+
if (!workspaceSlug || !projectId || !issueId) throw new Error("Missing required fields");
38+
const attachmentUploadPromise = createAttachment(workspaceSlug, projectId, issueId, file);
39+
setPromiseToast(attachmentUploadPromise, {
40+
loading: "Uploading attachment...",
41+
success: {
42+
title: "Attachment uploaded",
43+
message: () => "The attachment has been successfully uploaded",
44+
},
45+
error: {
46+
title: "Attachment not uploaded",
47+
message: () => "The attachment could not be uploaded",
48+
},
49+
});
5350

54-
await attachmentUploadPromise;
55-
captureSuccess({
56-
eventName: WORK_ITEM_TRACKER_EVENTS.attachment.add,
57-
payload: { id: issueId },
58-
});
59-
} catch (error) {
60-
captureError({
61-
eventName: WORK_ITEM_TRACKER_EVENTS.attachment.add,
62-
payload: { id: issueId },
63-
error: error as Error,
64-
});
65-
throw error;
66-
}
51+
await attachmentUploadPromise;
6752
},
6853
remove: async (attachmentId) => {
6954
try {
@@ -74,16 +59,7 @@ export const useAttachmentOperations = (
7459
type: TOAST_TYPE.SUCCESS,
7560
title: "Attachment removed",
7661
});
77-
captureSuccess({
78-
eventName: WORK_ITEM_TRACKER_EVENTS.attachment.remove,
79-
payload: { id: issueId },
80-
});
81-
} catch (error) {
82-
captureError({
83-
eventName: WORK_ITEM_TRACKER_EVENTS.attachment.remove,
84-
payload: { id: issueId },
85-
error: error as Error,
86-
});
62+
} catch (_error) {
8763
setToast({
8864
message: "The Attachment could not be removed",
8965
type: TOAST_TYPE.ERROR,

apps/web/core/components/issues/issue-detail-widgets/relations/helper.tsx

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import { useMemo } from "react";
22
// plane imports
3-
import { WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
43
import { useTranslation } from "@plane/i18n";
54
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
65
import type { TIssue, TIssueServiceType } from "@plane/types";
76
import { EIssueServiceType } from "@plane/types";
87
import { copyUrlToClipboard } from "@plane/utils";
98
// hooks
10-
import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
119
import { useIssueDetail } from "@/hooks/store/use-issue-detail";
1210

1311
export type TRelationIssueOperations = {
@@ -26,33 +24,23 @@ export const useRelationOperations = (
2624

2725
const issueOperations: TRelationIssueOperations = useMemo(
2826
() => ({
29-
copyLink: (path) => {
30-
copyUrlToClipboard(path).then(() => {
31-
setToast({
32-
type: TOAST_TYPE.SUCCESS,
33-
title: t("common.link_copied"),
34-
message: t("entity.link_copied_to_clipboard", { entity: entityName }),
35-
});
27+
copyLink: async (path) => {
28+
await copyUrlToClipboard(path);
29+
setToast({
30+
type: TOAST_TYPE.SUCCESS,
31+
title: t("common.link_copied"),
32+
message: t("entity.link_copied_to_clipboard", { entity: entityName }),
3633
});
3734
},
3835
update: async (workspaceSlug, projectId, issueId, data) => {
3936
try {
4037
await updateIssue(workspaceSlug, projectId, issueId, data);
41-
captureSuccess({
42-
eventName: WORK_ITEM_TRACKER_EVENTS.update,
43-
payload: { id: issueId },
44-
});
4538
setToast({
4639
title: t("toast.success"),
4740
type: TOAST_TYPE.SUCCESS,
4841
message: t("entity.update.success", { entity: entityName }),
4942
});
50-
} catch (error) {
51-
captureError({
52-
eventName: WORK_ITEM_TRACKER_EVENTS.update,
53-
payload: { id: issueId },
54-
error: error as Error,
55-
});
43+
} catch (_error) {
5644
setToast({
5745
title: t("toast.error"),
5846
type: TOAST_TYPE.ERROR,
@@ -61,20 +49,7 @@ export const useRelationOperations = (
6149
}
6250
},
6351
remove: async (workspaceSlug, projectId, issueId) => {
64-
try {
65-
return removeIssue(workspaceSlug, projectId, issueId).then(() => {
66-
captureSuccess({
67-
eventName: WORK_ITEM_TRACKER_EVENTS.delete,
68-
payload: { id: issueId },
69-
});
70-
});
71-
} catch (error) {
72-
captureError({
73-
eventName: WORK_ITEM_TRACKER_EVENTS.delete,
74-
payload: { id: issueId },
75-
error: error as Error,
76-
});
77-
}
52+
return removeIssue(workspaceSlug, projectId, issueId);
7853
},
7954
}),
8055
[entityName, removeIssue, t, updateIssue]

apps/web/core/components/issues/issue-detail-widgets/sub-issues/helper.ts

Lines changed: 14 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import { useMemo } from "react";
22
import { useParams } from "next/navigation";
33
// plane imports
4-
import { WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
54
import { useTranslation } from "@plane/i18n";
65
import { TOAST_TYPE, setToast } from "@plane/propel/toast";
76
import type { TIssueServiceType, TSubIssueOperations } from "@plane/types";
87
import { EIssueServiceType } from "@plane/types";
98
import { copyUrlToClipboard } from "@plane/utils";
109
// hooks
11-
import { captureError, captureSuccess } from "@/helpers/event-tracker.helper";
1210
import { useIssueDetail } from "@/hooks/store/use-issue-detail";
1311
import { useProjectState } from "@/hooks/store/use-project-state";
1412
// plane web helpers
@@ -39,18 +37,17 @@ export const useSubIssueOperations = (issueServiceType: TIssueServiceType): TSub
3937

4038
const subIssueOperations: TSubIssueOperations = useMemo(
4139
() => ({
42-
copyLink: (path) => {
43-
copyUrlToClipboard(path).then(() => {
44-
setToast({
45-
type: TOAST_TYPE.SUCCESS,
46-
title: t("common.link_copied"),
47-
message: t("entity.link_copied_to_clipboard", {
48-
entity:
49-
issueServiceType === EIssueServiceType.ISSUES
50-
? t("common.sub_work_items", { count: 1 })
51-
: t("issue.label", { count: 1 }),
52-
}),
53-
});
40+
copyLink: async (path) => {
41+
await copyUrlToClipboard(path);
42+
setToast({
43+
type: TOAST_TYPE.SUCCESS,
44+
title: t("common.link_copied"),
45+
message: t("entity.link_copied_to_clipboard", {
46+
entity:
47+
issueServiceType === EIssueServiceType.ISSUES
48+
? t("common.sub_work_items", { count: 1 })
49+
: t("issue.label", { count: 1 }),
50+
}),
5451
});
5552
},
5653
fetchSubIssues: async (workspaceSlug, projectId, parentIssueId) => {
@@ -131,22 +128,13 @@ export const useSubIssueOperations = (issueServiceType: TIssueServiceType): TSub
131128
}
132129
}
133130
}
134-
captureSuccess({
135-
eventName: WORK_ITEM_TRACKER_EVENTS.sub_issue.update,
136-
payload: { id: issueId, parent_id: parentIssueId },
137-
});
138131
setToast({
139132
type: TOAST_TYPE.SUCCESS,
140133
title: t("toast.success"),
141134
message: t("sub_work_item.update.success"),
142135
});
143136
setSubIssueHelpers(parentIssueId, "issue_loader", issueId);
144-
} catch (error) {
145-
captureError({
146-
eventName: WORK_ITEM_TRACKER_EVENTS.sub_issue.update,
147-
payload: { id: issueId, parent_id: parentIssueId },
148-
error: error as Error,
149-
});
137+
} catch (_error) {
150138
setToast({
151139
type: TOAST_TYPE.ERROR,
152140
title: t("toast.error"),
@@ -178,17 +166,8 @@ export const useSubIssueOperations = (issueServiceType: TIssueServiceType): TSub
178166
: t("issue.label", { count: 1 }),
179167
}),
180168
});
181-
captureSuccess({
182-
eventName: WORK_ITEM_TRACKER_EVENTS.sub_issue.remove,
183-
payload: { id: issueId, parent_id: parentIssueId },
184-
});
185169
setSubIssueHelpers(parentIssueId, "issue_loader", issueId);
186-
} catch (error) {
187-
captureError({
188-
eventName: WORK_ITEM_TRACKER_EVENTS.sub_issue.remove,
189-
payload: { id: issueId, parent_id: parentIssueId },
190-
error: error as Error,
191-
});
170+
} catch (_error) {
192171
setToast({
193172
type: TOAST_TYPE.ERROR,
194173
title: t("toast.error"),
@@ -205,18 +184,9 @@ export const useSubIssueOperations = (issueServiceType: TIssueServiceType): TSub
205184
try {
206185
setSubIssueHelpers(parentIssueId, "issue_loader", issueId);
207186
return deleteSubIssue(workspaceSlug, projectId, parentIssueId, issueId).then(() => {
208-
captureSuccess({
209-
eventName: WORK_ITEM_TRACKER_EVENTS.sub_issue.delete,
210-
payload: { id: issueId, parent_id: parentIssueId },
211-
});
212187
setSubIssueHelpers(parentIssueId, "issue_loader", issueId);
213188
});
214-
} catch (error) {
215-
captureError({
216-
eventName: WORK_ITEM_TRACKER_EVENTS.sub_issue.delete,
217-
payload: { id: issueId, parent_id: parentIssueId },
218-
error: error as Error,
219-
});
189+
} catch (_error) {
220190
setToast({
221191
type: TOAST_TYPE.ERROR,
222192
title: t("toast.error"),

apps/web/core/components/issues/issue-detail-widgets/sub-issues/quick-action-button.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
import type { FC } from "react";
21
import React from "react";
32
import { observer } from "mobx-react";
4-
53
// plane imports
64
import { WORK_ITEM_TRACKER_EVENTS } from "@plane/constants";
75
import { useTranslation } from "@plane/i18n";
86
import { PlusIcon, WorkItemsIcon } from "@plane/propel/icons";
97
import type { TIssue, TIssueServiceType } from "@plane/types";
108
import { CustomMenu } from "@plane/ui";
119
// hooks
12-
import { captureClick } from "@/helpers/event-tracker.helper";
1310
import { useIssueDetail } from "@/hooks/store/use-issue-detail";
1411

1512
type Props = {
@@ -54,13 +51,11 @@ export const SubIssuesActionButton = observer(function SubIssuesActionButton(pro
5451
};
5552

5653
const handleCreateNew = () => {
57-
captureClick({ elementName: WORK_ITEM_TRACKER_EVENTS.sub_issue.create });
5854
handleIssueCrudState("create", issueId, null);
5955
toggleCreateIssueModal(true);
6056
};
6157

6258
const handleAddExisting = () => {
63-
captureClick({ elementName: WORK_ITEM_TRACKER_EVENTS.sub_issue.add_existing });
6459
handleIssueCrudState("existing", issueId, null);
6560
toggleSubIssuesModal(issue.id);
6661
};

0 commit comments

Comments
 (0)