[WEB-4409] refactor: event constants (#7276)
* refactor: event constants * fix: cycle event keys * chore: store extension * chore: update events naming convention --------- Co-authored-by: sriramveeraghanta <veeraghanta.sriram@gmail.com>
This commit is contained in:
parent
e09aeab5b8
commit
4a065e14d0
67 changed files with 553 additions and 513 deletions
|
|
@ -7,7 +7,7 @@ import { Home } from "lucide-react";
|
|||
import githubBlackImage from "/public/logos/github-black.png";
|
||||
import githubWhiteImage from "/public/logos/github-white.png";
|
||||
// ui
|
||||
import { GITHUB_REDIRECTED } from "@plane/constants";
|
||||
import { GITHUB_REDIRECTED_TRACKER_EVENT } from "@plane/constants";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { Breadcrumbs, Header } from "@plane/ui";
|
||||
// components
|
||||
|
|
@ -39,7 +39,7 @@ export const WorkspaceDashboardHeader = () => {
|
|||
<Header.RightItem>
|
||||
<a
|
||||
onClick={() =>
|
||||
captureEvent(GITHUB_REDIRECTED, {
|
||||
captureEvent(GITHUB_REDIRECTED_TRACKER_EVENT, {
|
||||
element: "navbar",
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { observer } from "mobx-react";
|
|||
import { useParams } from "next/navigation";
|
||||
import { Search } from "lucide-react";
|
||||
// types
|
||||
import { MEMBER_INVITED, EUserPermissions, EUserPermissionsLevel } from "@plane/constants";
|
||||
import { EUserPermissions, EUserPermissionsLevel, MEMBER_TRACKER_EVENTS } from "@plane/constants";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { IWorkspaceBulkInviteFormData } from "@plane/types";
|
||||
// ui
|
||||
|
|
@ -52,7 +52,7 @@ const WorkspaceMembersSettingsPage = observer(() => {
|
|||
return inviteMembersToWorkspace(workspaceSlug.toString(), data)
|
||||
.then(() => {
|
||||
setInviteModal(false);
|
||||
captureEvent(MEMBER_INVITED, {
|
||||
captureEvent(MEMBER_TRACKER_EVENTS.invite, {
|
||||
emails: [
|
||||
...data.emails.map((email) => ({
|
||||
email: email.email,
|
||||
|
|
@ -70,7 +70,7 @@ const WorkspaceMembersSettingsPage = observer(() => {
|
|||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
captureEvent(MEMBER_INVITED, {
|
||||
captureEvent(MEMBER_TRACKER_EVENTS.invite, {
|
||||
emails: [
|
||||
...data.emails.map((email) => ({
|
||||
email: email.email,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import { Controller, useForm } from "react-hook-form";
|
|||
// icons
|
||||
import { CircleCheck } from "lucide-react";
|
||||
// plane imports
|
||||
import { FORGOT_PASS_LINK, NAVIGATE_TO_SIGNUP } from "@plane/constants";
|
||||
import { AUTH_TRACKER_EVENTS } from "@plane/constants";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { Button, Input, TOAST_TYPE, getButtonStyling, setToast } from "@plane/ui";
|
||||
import { cn, checkEmailValidity } from "@plane/utils";
|
||||
|
|
@ -71,7 +71,7 @@ const ForgotPasswordPage = observer(() => {
|
|||
email: formData.email,
|
||||
})
|
||||
.then(() => {
|
||||
captureEvent(FORGOT_PASS_LINK, {
|
||||
captureEvent(AUTH_TRACKER_EVENTS.forgot_password, {
|
||||
state: "SUCCESS",
|
||||
});
|
||||
setToast({
|
||||
|
|
@ -82,7 +82,7 @@ const ForgotPasswordPage = observer(() => {
|
|||
setResendCodeTimer(30);
|
||||
})
|
||||
.catch((err) => {
|
||||
captureEvent(FORGOT_PASS_LINK, {
|
||||
captureEvent(AUTH_TRACKER_EVENTS.forgot_password, {
|
||||
state: "FAILED",
|
||||
});
|
||||
setToast({
|
||||
|
|
@ -120,7 +120,7 @@ const ForgotPasswordPage = observer(() => {
|
|||
{t("auth.common.new_to_plane")}
|
||||
<Link
|
||||
href="/"
|
||||
onClick={() => captureEvent(NAVIGATE_TO_SIGNUP, {})}
|
||||
onClick={() => captureEvent(AUTH_TRACKER_EVENTS.navigate.sign_up, {})}
|
||||
className="font-semibold text-custom-primary-100 hover:underline"
|
||||
>
|
||||
{t("auth.common.create_account")}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import { useTheme } from "next-themes";
|
|||
import useSWR, { mutate } from "swr";
|
||||
import { CheckCircle2 } from "lucide-react";
|
||||
// plane imports
|
||||
import { ROLE, MEMBER_ACCEPTED, EUserPermissions } from "@plane/constants";
|
||||
import { ROLE, EUserPermissions, MEMBER_TRACKER_EVENTS } from "@plane/constants";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
// types
|
||||
import type { IWorkspaceMemberInvitation } from "@plane/types";
|
||||
|
|
@ -86,7 +86,7 @@ const UserInvitationsPage = observer(() => {
|
|||
const invitation = invitations?.find((i) => i.id === firstInviteId);
|
||||
const redirectWorkspace = invitations?.find((i) => i.id === firstInviteId)?.workspace;
|
||||
joinWorkspaceMetricGroup(redirectWorkspace?.id);
|
||||
captureEvent(MEMBER_ACCEPTED, {
|
||||
captureEvent(MEMBER_TRACKER_EVENTS.accept, {
|
||||
member_id: invitation?.id,
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-asserted-optional-chain
|
||||
role: getUserRole((invitation?.role as unknown as EUserPermissions)!),
|
||||
|
|
@ -112,7 +112,7 @@ const UserInvitationsPage = observer(() => {
|
|||
});
|
||||
})
|
||||
.catch(() => {
|
||||
captureEvent(MEMBER_ACCEPTED, {
|
||||
captureEvent(MEMBER_TRACKER_EVENTS.accept, {
|
||||
project_id: undefined,
|
||||
accepted_from: "App",
|
||||
state: "FAILED",
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { useEffect, useState } from "react";
|
|||
import { observer } from "mobx-react";
|
||||
import useSWR from "swr";
|
||||
// types
|
||||
import { USER_ONBOARDING_COMPLETED } from "@plane/constants";
|
||||
import { USER_TRACKER_EVENTS } from "@plane/constants";
|
||||
import { TOnboardingSteps, TUserProfile } from "@plane/types";
|
||||
// ui
|
||||
import { TOAST_TYPE, setToast } from "@plane/ui";
|
||||
|
|
@ -73,7 +73,7 @@ const OnboardingPage = observer(() => {
|
|||
|
||||
await finishUserOnboarding()
|
||||
.then(() => {
|
||||
captureEvent(USER_ONBOARDING_COMPLETED, {
|
||||
captureEvent(USER_TRACKER_EVENTS.onboarding_complete, {
|
||||
email: user.email,
|
||||
user_id: user.id,
|
||||
status: "SUCCESS",
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import Link from "next/link";
|
|||
// ui
|
||||
import { useTheme } from "next-themes";
|
||||
// components
|
||||
import { NAVIGATE_TO_SIGNIN } from "@plane/constants";
|
||||
import { AUTH_TRACKER_EVENTS } from "@plane/constants";
|
||||
import { useTranslation } from "@plane/i18n";
|
||||
import { AuthRoot } from "@/components/account";
|
||||
// constants
|
||||
|
|
@ -54,7 +54,7 @@ const SignInPage = observer(() => {
|
|||
{t("auth.common.already_have_an_account")}
|
||||
<Link
|
||||
href="/"
|
||||
onClick={() => captureEvent(NAVIGATE_TO_SIGNIN, {})}
|
||||
onClick={() => captureEvent(AUTH_TRACKER_EVENTS.navigate.sign_in, {})}
|
||||
className="font-semibold text-custom-primary-100 hover:underline"
|
||||
>
|
||||
{t("auth.common.login")}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue