fix: track events updated, extra parameters added, added events for issues, pages, states, cycles (#2875)

* fix: event tracking method updated to store, chore: updated and added events for workspace, projects and create issue

* fix: posthog auth event tracking

---------

Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
This commit is contained in:
Ramesh Kumar Chandra 2023-11-25 21:26:26 +05:30 committed by sriram veeraghanta
parent 398f35d36d
commit 20fe27e086
54 changed files with 662 additions and 305 deletions

View file

@ -40,6 +40,7 @@ export const WorkspaceDetails: FC = observer(() => {
const {
workspace: { currentWorkspace, updateWorkspace },
user: { currentWorkspaceRole },
trackEvent: { postHogEventTracker }
} = useMobxStore();
const isAdmin = currentWorkspaceRole === 20;
// hooks
@ -66,14 +67,28 @@ export const WorkspaceDetails: FC = observer(() => {
await updateWorkspace(currentWorkspace.slug, payload)
.then((res) => {
trackEvent("UPDATE_WORKSPACE", res);
postHogEventTracker(
'WORKSPACE_UPDATE',
{
...res,
state: "SUCCESS"
}
)
setToastAlert({
title: "Success",
type: "success",
message: "Workspace updated successfully",
});
})
.catch((err) => console.error(err));
}).catch((err) => {
postHogEventTracker(
'WORKSPACE_UPDATE',
{
state: "FAILED"
}
);
console.error(err)
}
);
};
const handleRemoveLogo = () => {
@ -262,10 +277,9 @@ export const WorkspaceDetails: FC = observer(() => {
id="url"
name="url"
type="url"
value={`${
typeof window !== "undefined" &&
value={`${typeof window !== "undefined" &&
window.location.origin.replace("http://", "").replace("https://", "")
}/${currentWorkspace.slug}`}
}/${currentWorkspace.slug}`}
onChange={onChange}
ref={ref}
hasError={Boolean(errors.url)}