chore: posthog event for workspace invite (#2989)
* chore: posthog event for workspace invite * chore: updated event names, added all the existing events to workspace metrics group * chore: seperated workspace invite * fix: workspace invite accept event updated --------- Co-authored-by: Ramesh Kumar Chandra <rameshkumar2299@gmail.com>
This commit is contained in:
parent
37c03ff239
commit
b35874e294
25 changed files with 441 additions and 120 deletions
|
|
@ -24,7 +24,7 @@ export const IssueBlocksList: FC<Props> = (props) => {
|
|||
{issueIds && issueIds.length > 0 ? (
|
||||
issueIds.map((issueId: string) => (
|
||||
<IssueBlock
|
||||
key={issues[issueId].id}
|
||||
key={issues[issueId]?.id}
|
||||
columnId={columnId}
|
||||
issue={issues[issueId]}
|
||||
handleIssues={handleIssues}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,8 @@ export const IssueMainContent: React.FC<Props> = observer((props) => {
|
|||
user: userStore,
|
||||
project: projectStore,
|
||||
projectState: { states },
|
||||
trackEvent: { postHogEventTracker },
|
||||
workspace: { currentWorkspace }
|
||||
} = useMobxStore();
|
||||
const user = userStore.currentUser ?? undefined;
|
||||
const userRole = userStore.currentProjectRole;
|
||||
|
|
@ -82,7 +84,22 @@ export const IssueMainContent: React.FC<Props> = observer((props) => {
|
|||
|
||||
await issueCommentService
|
||||
.patchIssueComment(workspaceSlug as string, projectId as string, issueId as string, commentId, data)
|
||||
.then(() => mutateIssueActivity());
|
||||
.then((res) => {
|
||||
mutateIssueActivity();
|
||||
postHogEventTracker(
|
||||
"COMMENT_UPDATED",
|
||||
{
|
||||
...res,
|
||||
state: "SUCCESS"
|
||||
},
|
||||
{
|
||||
isGrouping: true,
|
||||
groupType: "Workspace_metrics",
|
||||
gorupId: currentWorkspace?.id!
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
const handleCommentDelete = async (commentId: string) => {
|
||||
|
|
@ -92,7 +109,21 @@ export const IssueMainContent: React.FC<Props> = observer((props) => {
|
|||
|
||||
await issueCommentService
|
||||
.deleteIssueComment(workspaceSlug as string, projectId as string, issueId as string, commentId)
|
||||
.then(() => mutateIssueActivity());
|
||||
.then(() => {
|
||||
mutateIssueActivity();
|
||||
postHogEventTracker(
|
||||
"COMMENT_DELETED",
|
||||
{
|
||||
state: "SUCCESS"
|
||||
},
|
||||
{
|
||||
isGrouping: true,
|
||||
groupType: "Workspace_metrics",
|
||||
gorupId: currentWorkspace?.id!
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
const handleAddComment = async (formData: IIssueComment) => {
|
||||
|
|
@ -100,8 +131,20 @@ export const IssueMainContent: React.FC<Props> = observer((props) => {
|
|||
|
||||
await issueCommentService
|
||||
.createIssueComment(workspaceSlug.toString(), issueDetails.project, issueDetails.id, formData)
|
||||
.then(() => {
|
||||
.then((res) => {
|
||||
mutate(PROJECT_ISSUES_ACTIVITY(issueDetails.id));
|
||||
postHogEventTracker(
|
||||
"COMMENT_ADDED",
|
||||
{
|
||||
...res,
|
||||
state: "SUCCESS"
|
||||
},
|
||||
{
|
||||
isGrouping: true,
|
||||
groupType: "Workspace_metrics",
|
||||
gorupId: currentWorkspace?.id!
|
||||
}
|
||||
);
|
||||
})
|
||||
.catch(() =>
|
||||
setToastAlert({
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer((prop
|
|||
moduleIssues: moduleIssueStore,
|
||||
user: userStore,
|
||||
trackEvent: { postHogEventTracker },
|
||||
workspace: { currentWorkspace }
|
||||
} = useMobxStore();
|
||||
|
||||
const user = userStore.currentUser;
|
||||
|
|
@ -250,10 +251,16 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer((prop
|
|||
title: "Success!",
|
||||
message: "Issue created successfully.",
|
||||
});
|
||||
postHogEventTracker("ISSUE_CREATE", {
|
||||
postHogEventTracker("ISSUE_CREATED", {
|
||||
...res,
|
||||
state: "SUCCESS",
|
||||
});
|
||||
},
|
||||
{
|
||||
isGrouping: true,
|
||||
groupType: "Workspace_metrics",
|
||||
gorupId: currentWorkspace?.id!
|
||||
}
|
||||
);
|
||||
if (payload.parent && payload.parent !== "") mutate(SUB_ISSUES(payload.parent));
|
||||
}
|
||||
})
|
||||
|
|
@ -263,9 +270,15 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer((prop
|
|||
title: "Error!",
|
||||
message: "Issue could not be created. Please try again.",
|
||||
});
|
||||
postHogEventTracker("ISSUE_CREATE", {
|
||||
postHogEventTracker("ISSUE_CREATED", {
|
||||
state: "FAILED",
|
||||
});
|
||||
},
|
||||
{
|
||||
isGrouping: true,
|
||||
groupType: "Workspace_metrics",
|
||||
gorupId: currentWorkspace?.id!
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
if (!createMore) onFormSubmitClose();
|
||||
|
|
@ -317,10 +330,16 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer((prop
|
|||
title: "Success!",
|
||||
message: "Issue updated successfully.",
|
||||
});
|
||||
postHogEventTracker("ISSUE_UPDATE", {
|
||||
postHogEventTracker("ISSUE_UPDATED", {
|
||||
...res,
|
||||
state: "SUCCESS",
|
||||
});
|
||||
},
|
||||
{
|
||||
isGrouping: true,
|
||||
groupType: "Workspace_metrics",
|
||||
gorupId: currentWorkspace?.id!
|
||||
}
|
||||
);
|
||||
})
|
||||
.catch(() => {
|
||||
setToastAlert({
|
||||
|
|
@ -328,9 +347,15 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer((prop
|
|||
title: "Error!",
|
||||
message: "Issue could not be updated. Please try again.",
|
||||
});
|
||||
postHogEventTracker("ISSUE_UPDATE", {
|
||||
postHogEventTracker("ISSUE_UPDATED", {
|
||||
state: "FAILED",
|
||||
});
|
||||
},
|
||||
{
|
||||
isGrouping: true,
|
||||
groupType: "Workspace_metrics",
|
||||
gorupId: currentWorkspace?.id!
|
||||
}
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue