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:
Bavisetti Narayan 2023-12-06 17:15:14 +05:30 committed by sriram veeraghanta
parent 37c03ff239
commit b35874e294
25 changed files with 441 additions and 120 deletions

View file

@ -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!
}
);
});
};