chore: All event elements defined in constants.

This commit is contained in:
LAKHAN BAHETI 2024-03-15 12:04:34 +05:30
parent 75d8560343
commit 0970d7181e
92 changed files with 403 additions and 258 deletions

View File

@ -3,6 +3,8 @@ import { ContrastIcon, FileText } from "lucide-react";
// hooks
import { DiceIcon, PhotoFilterIcon } from "@plane/ui";
import { useApplication, useEventTracker } from "hooks/store";
// constants
import { E_COMMAND_PALETTE } from "constants/event-tracker";
// ui
type Props = {
@ -23,7 +25,7 @@ export const CommandPaletteProjectActions: React.FC<Props> = (props) => {
<Command.Item
onSelect={() => {
closePalette();
setTrackElement("Command palette");
setTrackElement(E_COMMAND_PALETTE);
toggleCreateCycleModal(true);
}}
className="focus:outline-none"
@ -39,7 +41,7 @@ export const CommandPaletteProjectActions: React.FC<Props> = (props) => {
<Command.Item
onSelect={() => {
closePalette();
setTrackElement("Command palette");
setTrackElement(E_COMMAND_PALETTE);
toggleCreateModuleModal(true);
}}
className="focus:outline-none"
@ -55,7 +57,7 @@ export const CommandPaletteProjectActions: React.FC<Props> = (props) => {
<Command.Item
onSelect={() => {
closePalette();
setTrackElement("Command palette");
setTrackElement(E_COMMAND_PALETTE);
toggleCreateViewModal(true);
}}
className="focus:outline-none"
@ -71,7 +73,7 @@ export const CommandPaletteProjectActions: React.FC<Props> = (props) => {
<Command.Item
onSelect={() => {
closePalette();
setTrackElement("Command palette");
setTrackElement(E_COMMAND_PALETTE);
toggleCreatePageModal(true);
}}
className="focus:outline-none"

View File

@ -27,6 +27,8 @@ import { IssueService } from "services/issue";
import { WorkspaceService } from "services/workspace.service";
// types
import { IWorkspaceSearchResults } from "@plane/types";
// constants
import { E_COMMAND_PALETTE } from "constants/event-tracker";
// fetch-keys
// services
@ -279,7 +281,7 @@ export const CommandModal: React.FC = observer(() => {
<Command.Item
onSelect={() => {
closePalette();
setTrackElement("Command Palette");
setTrackElement(E_COMMAND_PALETTE);
toggleCreateIssueModal(true);
}}
className="focus:bg-custom-background-80"
@ -297,7 +299,7 @@ export const CommandModal: React.FC = observer(() => {
<Command.Item
onSelect={() => {
closePalette();
setTrackElement("Command palette");
setTrackElement(E_COMMAND_PALETTE);
toggleCreateProjectModal(true);
}}
className="focus:outline-none"

View File

@ -23,6 +23,8 @@ import { EIssuesStoreType } from "constants/issue";
import { copyTextToClipboard } from "helpers/string.helper";
import { useApplication, useEventTracker, useIssues, useUser } from "hooks/store";
import { IssueService } from "services/issue";
// constants
import { E_SHORTCUT_KEY } from "constants/event-tracker";
// services
const issueService = new IssueService();
@ -118,7 +120,7 @@ export const CommandPalette: FC = observer(() => {
toggleSidebar();
}
} else if (!isAnyModalOpen) {
setTrackElement("Shortcut key");
setTrackElement(E_SHORTCUT_KEY);
if (keyPressed === "c") {
toggleCreateIssueModal(true);
} else if (keyPressed === "p") {

View File

@ -11,7 +11,7 @@ import { Avatar, AvatarGroup, setPromiseToast } from "@plane/ui";
// helpers
import { renderFormattedDate } from "helpers/date-time.helper";
// constants
import { CYCLE_FAVORITED, CYCLE_UNFAVORITED } from "constants/event-tracker";
import { CYCLE_FAVORITED, CYCLE_UNFAVORITED, E_LIST_LAYOUT } from "constants/event-tracker";
type Props = {
cycleId: string;
@ -37,7 +37,7 @@ export const UpcomingCycleListItem: React.FC<Props> = observer((props) => {
() => {
captureEvent(CYCLE_FAVORITED, {
cycle_id: cycleId,
element: "List layout",
element: E_LIST_LAYOUT,
state: "SUCCESS",
});
}
@ -67,7 +67,7 @@ export const UpcomingCycleListItem: React.FC<Props> = observer((props) => {
).then(() => {
captureEvent(CYCLE_UNFAVORITED, {
cycle_id: cycleId,
element: "List layout",
element: E_LIST_LAYOUT,
state: "SUCCESS",
});
});

View File

@ -12,7 +12,7 @@ import { CycleQuickActions } from "components/cycles";
// icons
// helpers
import { CYCLE_STATUS } from "constants/cycle";
import { CYCLE_FAVORITED, CYCLE_UNFAVORITED } from "constants/event-tracker";
import { CYCLE_FAVORITED, CYCLE_UNFAVORITED, E_GRID_LAYOUT } from "constants/event-tracker";
import { EUserWorkspaceRoles } from "constants/workspace";
import { findHowManyDaysLeft, renderFormattedDate } from "helpers/date-time.helper";
// constants
@ -78,7 +78,7 @@ export const CyclesBoardCard: FC<ICyclesBoardCard> = observer((props) => {
() => {
captureEvent(CYCLE_FAVORITED, {
cycle_id: cycleId,
element: "Grid layout",
element: E_GRID_LAYOUT,
state: "SUCCESS",
});
}
@ -108,7 +108,7 @@ export const CyclesBoardCard: FC<ICyclesBoardCard> = observer((props) => {
).then(() => {
captureEvent(CYCLE_UNFAVORITED, {
cycle_id: cycleId,
element: "Grid layout",
element: E_GRID_LAYOUT,
state: "SUCCESS",
});
});

View File

@ -8,7 +8,7 @@ import { Check, Info, Star, User2 } from "lucide-react";
import { Tooltip, CircularProgressIndicator, CycleGroupIcon, AvatarGroup, Avatar, setPromiseToast } from "@plane/ui";
import { CycleQuickActions } from "components/cycles";
import { CYCLE_STATUS } from "constants/cycle";
import { CYCLE_FAVORITED, CYCLE_UNFAVORITED } from "constants/event-tracker";
import { CYCLE_FAVORITED, CYCLE_UNFAVORITED, E_LIST_LAYOUT } from "constants/event-tracker";
import { findHowManyDaysLeft, renderFormattedDate } from "helpers/date-time.helper";
import { useEventTracker, useCycle, useUser, useMember } from "hooks/store";
// components
@ -52,7 +52,7 @@ export const CyclesListItem: FC<TCyclesListItem> = observer((props) => {
() => {
captureEvent(CYCLE_FAVORITED, {
cycle_id: cycleId,
element: "List layout",
element: E_LIST_LAYOUT,
state: "SUCCESS",
});
}
@ -82,7 +82,7 @@ export const CyclesListItem: FC<TCyclesListItem> = observer((props) => {
).then(() => {
captureEvent(CYCLE_UNFAVORITED, {
cycle_id: cycleId,
element: "List layout",
element: E_LIST_LAYOUT,
state: "SUCCESS",
});
});

View File

@ -11,6 +11,7 @@ import { CustomMenu, TOAST_TYPE, setToast } from "@plane/ui";
import { copyUrlToClipboard } from "helpers/string.helper";
// constants
import { EUserProjectRoles } from "constants/project";
import { E_CYCLES_LIST_LAYOUT } from "constants/event-tracker";
type Props = {
cycleId: string;
@ -52,14 +53,14 @@ export const CycleQuickActions: React.FC<Props> = observer((props) => {
const handleEditCycle = (e: React.MouseEvent<HTMLButtonElement>) => {
e.preventDefault();
e.stopPropagation();
setTrackElement("Cycles page list layout");
setTrackElement(E_CYCLES_LIST_LAYOUT);
setUpdateModal(true);
};
const handleDeleteCycle = (e: React.MouseEvent<HTMLButtonElement>) => {
e.preventDefault();
e.stopPropagation();
setTrackElement("Cycles page list layout");
setTrackElement(E_CYCLES_LIST_LAYOUT);
setDeleteModal(true);
};

View File

@ -15,7 +15,7 @@ import { CycleDeleteModal } from "components/cycles/delete-modal";
import { DateRangeDropdown } from "components/dropdowns";
// constants
import { CYCLE_STATUS } from "constants/cycle";
import { CYCLE_UPDATED } from "constants/event-tracker";
import { CYCLE_UPDATED, E_CYCLE_SIDEBAR, E_SIDEBAR } from "constants/event-tracker";
import { EUserWorkspaceRoles } from "constants/workspace";
// helpers
import { findHowManyDaysLeft, renderFormattedPayloadDate } from "helpers/date-time.helper";
@ -73,7 +73,7 @@ export const CycleDetailsSidebar: React.FC<Props> = observer((props) => {
payload: {
...res,
changed_properties: [changedProperty],
element: "Right side-peek",
element: E_SIDEBAR,
state: "SUCCESS",
},
});
@ -84,7 +84,7 @@ export const CycleDetailsSidebar: React.FC<Props> = observer((props) => {
eventName: CYCLE_UPDATED,
payload: {
...data,
element: "Right side-peek",
element: E_SIDEBAR,
state: "FAILED",
},
});
@ -253,7 +253,7 @@ export const CycleDetailsSidebar: React.FC<Props> = observer((props) => {
<CustomMenu placement="bottom-end" ellipsis>
<CustomMenu.MenuItem
onClick={() => {
setTrackElement("CYCLE_PAGE_SIDEBAR");
setTrackElement(E_CYCLE_SIDEBAR);
setCycleDeleteModal(true);
}}
>

View File

@ -8,6 +8,7 @@ import { useApplication, useEventTracker, useUser } from "hooks/store";
// assets
import ProjectEmptyStateImage from "public/empty-state/dashboard/project.svg";
// constants
import { E_PROJECT_EMPTY_STATE } from "constants/event-tracker";
export const DashboardProjectEmptyState = observer(() => {
// store hooks
@ -35,7 +36,7 @@ export const DashboardProjectEmptyState = observer(() => {
<Button
variant="primary"
onClick={() => {
setTrackElement("Project empty state");
setTrackElement(E_PROJECT_EMPTY_STATE);
toggleCreateProjectModal(true);
}}
>

View File

@ -21,7 +21,7 @@ import { useEventTracker, useIssueDetail } from "hooks/store";
// types
import { TAssignedIssuesWidgetResponse, TCreatedIssuesWidgetResponse, TIssue, TIssuesListTypes } from "@plane/types";
// constants
import { ISSUE_OPENED } from "constants/event-tracker";
import { E_DASHBOARD, ISSUE_OPENED } from "constants/event-tracker";
export type WidgetIssuesListProps = {
isLoading: boolean;
@ -40,7 +40,7 @@ export const WidgetIssuesList: React.FC<WidgetIssuesListProps> = (props) => {
const handleIssuePeekOverview = (issue: TIssue) => {
setPeekIssue({ workspaceSlug, projectId: issue.project_id, issueId: issue.id });
captureEvent(ISSUE_OPENED, {
element: "Dashboard",
element: E_DASHBOARD,
element_id: tab,
mode: "peek",
filters: {

View File

@ -15,6 +15,7 @@ import { useApplication, useEventTracker, useDashboard, useProject, useUser } fr
import { TRecentProjectsWidgetResponse } from "@plane/types";
import { ProjectLogo } from "components/project";
// constants
import { E_SIDEBAR } from "constants/event-tracker";
const WIDGET_KEY = "recent_projects";
@ -98,7 +99,7 @@ export const RecentProjectsWidget: React.FC<WidgetProps> = observer((props) => {
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
setTrackElement("Sidebar");
setTrackElement(E_SIDEBAR);
toggleCreateProjectModal(true);
}}
>

View File

@ -38,6 +38,7 @@ import { ProjectLogo } from "components/project";
import {
DP_APPLIED,
DP_REMOVED,
E_CYCLE_ISSUES,
elementFromPath,
FILTER_APPLIED,
FILTER_REMOVED,
@ -329,7 +330,7 @@ export const CycleIssuesHeader: React.FC = observer(() => {
</Button>
<Button
onClick={() => {
setTrackElement("Cycle issues page");
setTrackElement(E_CYCLE_ISSUES);
toggleCreateIssueModal(true, EIssuesStoreType.CYCLE);
}}
size="sm"

View File

@ -15,6 +15,8 @@ import { useApplication, useEventTracker, useProject, useUser } from "hooks/stor
import useLocalStorage from "hooks/use-local-storage";
import { TCycleLayoutOptions } from "@plane/types";
import { ProjectLogo } from "components/project";
// constants
import { E_CYCLES } from "constants/event-tracker";
export const CyclesHeader: FC = observer(() => {
// router
@ -81,7 +83,7 @@ export const CyclesHeader: FC = observer(() => {
size="sm"
prependIcon={<Plus />}
onClick={() => {
setTrackElement("Cycles page");
setTrackElement(E_CYCLES);
toggleCreateCycleModal(true);
}}
>

View File

@ -39,6 +39,7 @@ import { ProjectLogo } from "components/project";
import {
DP_APPLIED,
DP_REMOVED,
E_MODULE_ISSUES,
elementFromPath,
FILTER_APPLIED,
FILTER_REMOVED,
@ -337,7 +338,7 @@ export const ModuleIssuesHeader: React.FC = observer(() => {
<Button
className="hidden sm:flex"
onClick={() => {
setTrackElement("Module issues page");
setTrackElement(E_MODULE_ISSUES);
toggleCreateIssueModal(true, EIssuesStoreType.MODULE);
}}
size="sm"

View File

@ -12,6 +12,7 @@ import { ProjectLogo } from "components/project";
// constants
import { MODULE_VIEW_LAYOUTS } from "constants/module";
import { EUserProjectRoles } from "constants/project";
import { E_MODULES } from "constants/event-tracker";
// hooks
import { usePlatformOS } from "hooks/use-platform-os";
import { ModuleFiltersSelection, ModuleOrderByDropdown } from "components/modules";
@ -216,7 +217,7 @@ export const ModulesListHeader: React.FC = observer(() => {
size="sm"
prependIcon={<Plus />}
onClick={() => {
setTrackElement("Modules page");
setTrackElement(E_MODULES);
commandPaletteStore.toggleCreateModuleModal(true);
}}
>

View File

@ -8,10 +8,11 @@ import { Breadcrumbs, Button } from "@plane/ui";
import { BreadcrumbLink } from "components/common";
import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle";
import { EUserProjectRoles } from "constants/project";
// constants
// components
import { useApplication, useEventTracker, useProject, useUser } from "hooks/store";
import { ProjectLogo } from "components/project";
// constants
import { E_PAGES } from "constants/event-tracker";
export const PagesHeader = observer(() => {
// router
@ -66,7 +67,7 @@ export const PagesHeader = observer(() => {
prependIcon={<Plus />}
size="sm"
onClick={() => {
setTrackElement("Project pages page");
setTrackElement(E_PAGES);
toggleCreatePageModal(true);
}}
>

View File

@ -31,6 +31,7 @@ import { ProjectLogo } from "components/project";
import {
DP_APPLIED,
DP_REMOVED,
E_PROJECT_ISSUES,
elementFromPath,
FILTER_APPLIED,
FILTER_REMOVED,
@ -275,7 +276,7 @@ export const ProjectIssuesHeader: React.FC = observer(() => {
</Button>
<Button
onClick={() => {
setTrackElement("Project issues page");
setTrackElement(E_PROJECT_ISSUES);
toggleCreateIssueModal(true, EIssuesStoreType.PROJECT);
}}
size="sm"

View File

@ -33,6 +33,7 @@ import { ProjectLogo } from "components/project";
import {
DP_APPLIED,
DP_REMOVED,
E_VIEWS,
elementFromPath,
FILTER_APPLIED,
FILTER_REMOVED,
@ -282,7 +283,7 @@ export const ProjectViewIssuesHeader: React.FC = observer(() => {
{canUserCreateIssue && (
<Button
onClick={() => {
setTrackElement("PROJECT_VIEW_PAGE_HEADER");
setTrackElement(E_VIEWS);
toggleCreateIssueModal(true, EIssuesStoreType.PROJECT_VIEW);
}}
size="sm"

View File

@ -11,6 +11,7 @@ import { EUserProjectRoles } from "constants/project";
// constants
import { useApplication, useEventTracker, useProject, useUser } from "hooks/store";
import { ProjectLogo } from "components/project";
import { E_VIEWS } from "constants/event-tracker";
export const ProjectViewsHeader: React.FC = observer(() => {
// router
@ -69,7 +70,7 @@ export const ProjectViewsHeader: React.FC = observer(() => {
size="sm"
prependIcon={<Plus className="h-3.5 w-3.5 stroke-2" />}
onClick={() => {
setTrackElement("Views page");
setTrackElement(E_VIEWS);
toggleCreateViewModal(true);
}}
>

View File

@ -13,6 +13,7 @@ import { Breadcrumbs, Button } from "@plane/ui";
import { cn } from "helpers/common.helper";
// constants
import { EUserWorkspaceRoles } from "constants/workspace";
import { E_PROJECTS } from "constants/event-tracker";
import { FiltersDropdown } from "components/issues";
import { ProjectFiltersSelection, ProjectOrderByDropdown } from "components/project";
import { TProjectFilters } from "@plane/types";
@ -162,7 +163,7 @@ export const ProjectsHeader = observer(() => {
prependIcon={<Plus />}
size="sm"
onClick={() => {
setTrackElement("Projects page");
setTrackElement(E_PROJECTS);
commandPaletteStore.toggleCreateProjectModal(true);
}}
className="items-center gap-1"

View File

@ -14,7 +14,7 @@ import {
DeleteInboxIssueModal,
SelectDuplicateInboxIssueModal,
} from "components/inbox";
import { ISSUE_DELETED } from "constants/event-tracker";
import { E_INBOX, ISSUE_DELETED } from "constants/event-tracker";
import { EUserProjectRoles } from "constants/project";
// hooks
import { useUser, useInboxIssues, useIssueDetail, useWorkspace, useEventTracker } from "hooks/store";
@ -89,7 +89,7 @@ export const InboxIssueActionsHeader: FC<TInboxIssueActionsHeader> = observer((p
payload: {
id: inboxIssueId,
state: "SUCCESS",
element: "Inbox page",
element: E_INBOX,
},
});
router.push({
@ -106,7 +106,7 @@ export const InboxIssueActionsHeader: FC<TInboxIssueActionsHeader> = observer((p
payload: {
id: inboxIssueId,
state: "FAILED",
element: "Inbox page",
element: E_INBOX,
},
});
}

View File

@ -9,7 +9,7 @@ import { Sparkle } from "lucide-react";
import { Button, Input, ToggleSwitch, TOAST_TYPE, setToast } from "@plane/ui";
import { GptAssistantPopover } from "components/core";
import { PriorityDropdown } from "components/dropdowns";
import { ISSUE_CREATED } from "constants/event-tracker";
import { E_INBOX, ISSUE_CREATED } from "constants/event-tracker";
import { useApplication, useEventTracker, useWorkspace, useInboxIssues, useMention } from "hooks/store";
// services
import { AIService } from "services/ai.service";
@ -96,7 +96,7 @@ export const CreateInboxIssueModal: React.FC<Props> = observer((props) => {
payload: {
...formData,
state: "SUCCESS",
element: "Inbox page",
element: E_INBOX,
},
routePath: router.pathname,
});
@ -108,7 +108,7 @@ export const CreateInboxIssueModal: React.FC<Props> = observer((props) => {
payload: {
...formData,
state: "FAILED",
element: "Inbox page",
element: E_INBOX,
},
routePath: router.pathname,
});
@ -248,7 +248,7 @@ export const CreateInboxIssueModal: React.FC<Props> = observer((props) => {
// this is done so that the title do not reset after gpt popover closed
reset(getValues());
}}
onResponse={(_,response) => {
onResponse={(_, response) => {
handleAiAssistance(response);
}}
button={

View File

@ -11,6 +11,8 @@ import { checkEmailValidity } from "helpers/string.helper";
import { useApplication, useEventTracker, useProject } from "hooks/store";
// types
import { IJiraImporterForm } from "@plane/types";
// constants
import { E_JIRA_IMPORT } from "constants/event-tracker";
export const JiraGetImportDetail: React.FC = observer(() => {
// store hooks
@ -200,7 +202,7 @@ export const JiraGetImportDetail: React.FC = observer(() => {
<button
type="button"
onClick={() => {
setTrackElement("Jira import detail page");
setTrackElement(E_JIRA_IMPORT);
commandPaletteStore.toggleCreateProjectModal(true);
}}
className="flex cursor-pointer select-none items-center space-x-2 truncate rounded px-1 py-1.5 text-custom-text-200"

View File

@ -6,6 +6,8 @@ import { useEventTracker, useIssueDetail } from "hooks/store";
// components
import { IssueAttachmentUpload } from "./attachment-upload";
import { IssueAttachmentsList } from "./attachments-list";
// constants
import { E_ISSUE_DETAILS } from "constants/event-tracker";
export type TIssueAttachmentRoot = {
workspaceSlug: string;
@ -48,7 +50,7 @@ export const IssueAttachmentRoot: FC<TIssueAttachmentRoot> = (props) => {
const res = await attachmentUploadPromise;
captureIssueEvent({
eventName: "Issue attachment added",
payload: { id: issueId, state: "SUCCESS", element: "Issue detail page" },
payload: { id: issueId, state: "SUCCESS", element: E_ISSUE_DETAILS },
updates: {
changed_property: "attachment",
change_details: res.id,
@ -57,7 +59,7 @@ export const IssueAttachmentRoot: FC<TIssueAttachmentRoot> = (props) => {
} catch (error) {
captureIssueEvent({
eventName: "Issue attachment added",
payload: { id: issueId, state: "FAILED", element: "Issue detail page" },
payload: { id: issueId, state: "FAILED", element: E_ISSUE_DETAILS },
});
}
},
@ -72,7 +74,7 @@ export const IssueAttachmentRoot: FC<TIssueAttachmentRoot> = (props) => {
});
captureIssueEvent({
eventName: "Issue attachment deleted",
payload: { id: issueId, state: "SUCCESS", element: "Issue detail page" },
payload: { id: issueId, state: "SUCCESS", element: E_ISSUE_DETAILS },
updates: {
changed_property: "attachment",
change_details: "",
@ -81,7 +83,7 @@ export const IssueAttachmentRoot: FC<TIssueAttachmentRoot> = (props) => {
} catch (error) {
captureIssueEvent({
eventName: "Issue attachment deleted",
payload: { id: issueId, state: "FAILED", element: "Issue detail page" },
payload: { id: issueId, state: "FAILED", element: E_ISSUE_DETAILS },
updates: {
changed_property: "attachment",
change_details: "",

View File

@ -12,6 +12,7 @@ import { TIssueOperations } from "../root";
import { InboxIssueMainContent } from "./main-content";
import { InboxIssueDetailsSidebar } from "./sidebar";
// constants
import { E_INBOX } from "constants/event-tracker";
export type TInboxIssueDetailRoot = {
workspaceSlug: string;
@ -52,7 +53,7 @@ export const InboxIssueDetailRoot: FC<TInboxIssueDetailRoot> = (props) => {
await updateInboxIssue(workspaceSlug, projectId, inboxId, issueId, data);
captureIssueEvent({
eventName: "Inbox issue updated",
payload: { ...data, state: "SUCCESS", element: "Inbox" },
payload: { ...data, state: "SUCCESS", element: E_INBOX },
updates: {
changed_property: Object.keys(data).join(","),
change_details: !data.name && !data.description_html ? Object.values(data).join(",") : undefined,
@ -67,7 +68,7 @@ export const InboxIssueDetailRoot: FC<TInboxIssueDetailRoot> = (props) => {
});
captureIssueEvent({
eventName: "Inbox issue updated",
payload: { state: "SUCCESS", element: "Inbox" },
payload: { state: "SUCCESS", element: E_INBOX },
updates: {
changed_property: Object.keys(data).join(","),
change_details: !data.name && !data.description_html ? Object.values(data).join(",") : undefined,
@ -86,13 +87,13 @@ export const InboxIssueDetailRoot: FC<TInboxIssueDetailRoot> = (props) => {
});
captureIssueEvent({
eventName: "Inbox issue deleted",
payload: { id: issueId, state: "SUCCESS", element: "Inbox" },
payload: { id: issueId, state: "SUCCESS", element: E_INBOX },
routePath: router.asPath,
});
} catch (error) {
captureIssueEvent({
eventName: "Inbox issue deleted",
payload: { id: issueId, state: "FAILED", element: "Inbox" },
payload: { id: issueId, state: "FAILED", element: E_INBOX },
routePath: router.asPath,
});
setToast({

View File

@ -5,7 +5,7 @@ import { useRouter } from "next/router";
import { TOAST_TYPE, setPromiseToast, setToast } from "@plane/ui";
import { EmptyState } from "components/common";
import { IssuePeekOverview } from "components/issues";
import { ISSUE_UPDATED, ISSUE_DELETED, ISSUE_ARCHIVED } from "constants/event-tracker";
import { ISSUE_UPDATED, ISSUE_DELETED, ISSUE_ARCHIVED, E_ISSUE_DETAILS } from "constants/event-tracker";
import { EIssuesStoreType } from "constants/issue";
import { EUserProjectRoles } from "constants/project";
import { useApplication, useEventTracker, useIssueDetail, useIssues, useUser } from "hooks/store";
@ -90,7 +90,7 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
await updateIssue(workspaceSlug, projectId, issueId, data);
captureIssueEvent({
eventName: ISSUE_UPDATED,
payload: { ...data, issueId, state: "SUCCESS", element: "Issue detail page" },
payload: { ...data, issueId, state: "SUCCESS", element: E_ISSUE_DETAILS },
updates: {
changed_property: Object.keys(data).join(","),
change_details: !data.name && !data.description_html ? Object.values(data).join(",") : undefined,
@ -100,7 +100,7 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
} catch (error) {
captureIssueEvent({
eventName: ISSUE_UPDATED,
payload: { state: "FAILED", element: "Issue detail page" },
payload: { state: "FAILED", element: E_ISSUE_DETAILS },
updates: {
changed_property: Object.keys(data).join(","),
change_details: !data.name && !data.description_html ? Object.values(data).join(",") : undefined,
@ -125,7 +125,7 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
});
captureIssueEvent({
eventName: ISSUE_DELETED,
payload: { id: issueId, state: "SUCCESS", element: "Issue detail page" },
payload: { id: issueId, state: "SUCCESS", element: E_ISSUE_DETAILS },
routePath: router.asPath,
});
} catch (error) {
@ -136,7 +136,7 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
});
captureIssueEvent({
eventName: ISSUE_DELETED,
payload: { id: issueId, state: "FAILED", element: "Issue detail page" },
payload: { id: issueId, state: "FAILED", element: E_ISSUE_DETAILS },
routePath: router.asPath,
});
}
@ -151,7 +151,7 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
});
captureIssueEvent({
eventName: ISSUE_ARCHIVED,
payload: { id: issueId, state: "SUCCESS", element: "Issue details page" },
payload: { id: issueId, state: "SUCCESS", element: E_ISSUE_DETAILS },
routePath: router.asPath,
});
} catch (error) {
@ -162,7 +162,7 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
});
captureIssueEvent({
eventName: ISSUE_ARCHIVED,
payload: { id: issueId, state: "FAILED", element: "Issue details page" },
payload: { id: issueId, state: "FAILED", element: E_ISSUE_DETAILS },
routePath: router.asPath,
});
}
@ -184,7 +184,7 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
await addToCyclePromise;
captureIssueEvent({
eventName: ISSUE_UPDATED,
payload: { ...issueIds, state: "SUCCESS", element: "Issue detail page" },
payload: { ...issueIds, state: "SUCCESS", element: E_ISSUE_DETAILS },
updates: {
changed_property: "cycle_id",
change_details: cycleId,
@ -194,7 +194,7 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
} catch (error) {
captureIssueEvent({
eventName: ISSUE_UPDATED,
payload: { state: "FAILED", element: "Issue detail page" },
payload: { state: "FAILED", element: E_ISSUE_DETAILS },
updates: {
changed_property: "cycle_id",
change_details: cycleId,
@ -220,7 +220,7 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
await removeFromCyclePromise;
captureIssueEvent({
eventName: ISSUE_UPDATED,
payload: { issueId, state: "SUCCESS", element: "Issue detail page" },
payload: { issueId, state: "SUCCESS", element: E_ISSUE_DETAILS },
updates: {
changed_property: "cycle_id",
change_details: "",
@ -230,7 +230,7 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
} catch (error) {
captureIssueEvent({
eventName: ISSUE_UPDATED,
payload: { state: "FAILED", element: "Issue detail page" },
payload: { state: "FAILED", element: E_ISSUE_DETAILS },
updates: {
changed_property: "cycle_id",
change_details: "",
@ -256,7 +256,7 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
const response = await addToModulePromise;
captureIssueEvent({
eventName: ISSUE_UPDATED,
payload: { ...response, state: "SUCCESS", element: "Issue detail page" },
payload: { ...response, state: "SUCCESS", element: E_ISSUE_DETAILS },
updates: {
changed_property: "module_id",
change_details: moduleIds,
@ -266,7 +266,7 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
} catch (error) {
captureIssueEvent({
eventName: ISSUE_UPDATED,
payload: { id: issueId, state: "FAILED", element: "Issue detail page" },
payload: { id: issueId, state: "FAILED", element: E_ISSUE_DETAILS },
updates: {
changed_property: "module_id",
change_details: moduleIds,
@ -292,7 +292,7 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
await removeFromModulePromise;
captureIssueEvent({
eventName: ISSUE_UPDATED,
payload: { id: issueId, state: "SUCCESS", element: "Issue detail page" },
payload: { id: issueId, state: "SUCCESS", element: E_ISSUE_DETAILS },
updates: {
changed_property: "module_id",
change_details: "",
@ -302,7 +302,7 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = observer((props) => {
} catch (error) {
captureIssueEvent({
eventName: ISSUE_UPDATED,
payload: { id: issueId, state: "FAILED", element: "Issue detail page" },
payload: { id: issueId, state: "FAILED", element: E_ISSUE_DETAILS },
updates: {
changed_property: "module_id",
change_details: "",

View File

@ -17,7 +17,7 @@ import { TOAST_TYPE, setPromiseToast, setToast, CustomMenu } from "@plane/ui";
// types
import { ISearchIssueResponse, TIssue } from "@plane/types";
// constants
import { ISSUE_CREATED } from "constants/event-tracker";
import { E_CALENDAR_QUICK_ADD, ISSUE_CREATED } from "constants/event-tracker";
// helper
import { cn } from "helpers/common.helper";
@ -154,14 +154,14 @@ export const CalendarQuickAddIssueForm: React.FC<Props> = observer((props) => {
.then((res) => {
captureIssueEvent({
eventName: ISSUE_CREATED,
payload: { ...res, state: "SUCCESS", element: "Calendar quick add" },
payload: { ...res, state: "SUCCESS", element: E_CALENDAR_QUICK_ADD },
routePath: router.asPath,
});
})
.catch(() => {
captureIssueEvent({
eventName: ISSUE_CREATED,
payload: { ...payload, state: "FAILED", element: "Calendar quick add" },
payload: { ...payload, state: "FAILED", element: E_CALENDAR_QUICK_ADD },
routePath: router.asPath,
});
});

View File

@ -13,6 +13,7 @@ import { ISearchIssueResponse, TIssueLayouts } from "@plane/types";
// constants
import { EIssuesStoreType } from "constants/issue";
import { EmptyStateType } from "constants/empty-state";
import { E_CYCLE_ISSUES_EMPTY_STATE } from "constants/event-tracker";
type Props = {
workspaceSlug: string | undefined;
@ -88,7 +89,7 @@ export const CycleEmptyState: React.FC<Props> = observer((props) => {
primaryButtonOnClick={
!isCompletedCycleSnapshotAvailable && !isEmptyFilters
? () => {
setTrackElement("Cycle issue empty state");
setTrackElement(E_CYCLE_ISSUES_EMPTY_STATE);
toggleCreateIssueModal(true, EIssuesStoreType.CYCLE);
}
: undefined

View File

@ -7,6 +7,8 @@ import { useApplication, useEventTracker, useProject } from "hooks/store";
// assets
import emptyIssue from "public/empty-state/issue.svg";
import emptyProject from "public/empty-state/project.svg";
// constants
import { E_GLOBAL_ISSUES_EMPTY_STATE } from "constants/event-tracker";
export const GlobalViewEmptyState: React.FC = observer(() => {
// store hooks
@ -27,7 +29,7 @@ export const GlobalViewEmptyState: React.FC = observer(() => {
icon: <Plus className="h-4 w-4" />,
text: "New Project",
onClick: () => {
setTrackElement("All issues empty state");
setTrackElement(E_GLOBAL_ISSUES_EMPTY_STATE);
toggleCreateProjectModal(true);
},
}}
@ -41,7 +43,7 @@ export const GlobalViewEmptyState: React.FC = observer(() => {
text: "New issue",
icon: <PlusIcon className="h-3 w-3" strokeWidth={2} />,
onClick: () => {
setTrackElement("All issues empty state");
setTrackElement(E_GLOBAL_ISSUES_EMPTY_STATE);
toggleCreateIssueModal(true);
},
}}

View File

@ -13,6 +13,7 @@ import { ISearchIssueResponse, TIssueLayouts } from "@plane/types";
// constants
import { EIssuesStoreType } from "constants/issue";
import { EmptyStateType } from "constants/empty-state";
import { E_MODULES_ISSUES_EMPTY_STATE } from "constants/event-tracker";
type Props = {
workspaceSlug: string | undefined;
@ -77,7 +78,7 @@ export const ModuleEmptyState: React.FC<Props> = observer((props) => {
isEmptyFilters
? undefined
: () => {
setTrackElement("Module issue empty state");
setTrackElement(E_MODULES_ISSUES_EMPTY_STATE);
toggleCreateIssueModal(true, EIssuesStoreType.MODULE);
}
}

View File

@ -8,6 +8,7 @@ import { EmptyState } from "components/empty-state";
// constants
import { EIssueFilterType, EIssuesStoreType } from "constants/issue";
import { EmptyStateType } from "constants/empty-state";
import { E_PROJECT_ISSUES_EMPTY_STATE } from "constants/event-tracker";
// types
import { IIssueFilterOptions } from "@plane/types";
@ -55,7 +56,7 @@ export const ProjectEmptyState: React.FC = observer(() => {
issueFilterCount > 0
? undefined
: () => {
setTrackElement("Project issue empty state");
setTrackElement(E_PROJECT_ISSUES_EMPTY_STATE);
commandPaletteStore.toggleCreateIssueModal(true, EIssuesStoreType.PROJECT);
}
}

View File

@ -7,6 +7,8 @@ import { useApplication, useEventTracker } from "hooks/store";
// components
// assets
import emptyIssue from "public/empty-state/issue.svg";
// constants
import { E_VIEW_ISSUES_EMPTY_STATE } from "constants/event-tracker";
export const ProjectViewEmptyState: React.FC = observer(() => {
// store hooks
@ -23,7 +25,7 @@ export const ProjectViewEmptyState: React.FC = observer(() => {
text: "New issue",
icon: <PlusIcon className="h-3 w-3" strokeWidth={2} />,
onClick: () => {
setTrackElement("View issue empty state");
setTrackElement(E_VIEW_ISSUES_EMPTY_STATE);
commandPaletteStore.toggleCreateIssueModal(true, EIssuesStoreType.PROJECT_VIEW);
},
}}

View File

@ -7,7 +7,7 @@ import { Button } from "@plane/ui";
// components
import { AppliedFiltersList } from "components/issues";
// types
import { GLOBAL_VIEW_UPDATED } from "constants/event-tracker";
import { E_SPREADSHEET_LAYOUT, GLOBAL_VIEW_UPDATED } from "constants/event-tracker";
import { EIssueFilterType, EIssuesStoreType } from "constants/issue";
import { DEFAULT_GLOBAL_VIEWS_LIST, EUserWorkspaceRoles } from "constants/workspace";
// constants
@ -99,7 +99,7 @@ export const GlobalViewsAppliedFiltersRoot = observer((props: Props) => {
view_id: res.id,
applied_filters: res.filters,
state: "SUCCESS",
element: "Spreadsheet view",
element: E_SPREADSHEET_LAYOUT,
});
});
};

View File

@ -15,7 +15,7 @@ import useOutsideClickDetector from "hooks/use-outside-click-detector";
// ui
// types
import { IProject, TIssue } from "@plane/types";
import { ISSUE_CREATED } from "constants/event-tracker";
import { E_Gantt_QUICK_ADD, ISSUE_CREATED } from "constants/event-tracker";
// constants
interface IInputProps {
@ -128,14 +128,14 @@ export const GanttQuickAddIssueForm: React.FC<IGanttQuickAddIssueForm> = observe
.then((res) => {
captureIssueEvent({
eventName: ISSUE_CREATED,
payload: { ...res, state: "SUCCESS", element: "Gantt quick add" },
payload: { ...res, state: "SUCCESS", element: E_Gantt_QUICK_ADD },
routePath: router.asPath,
});
})
.catch(() => {
captureIssueEvent({
eventName: ISSUE_CREATED,
payload: { ...payload, state: "FAILED", element: "Gantt quick add" },
payload: { ...payload, state: "FAILED", element: E_Gantt_QUICK_ADD },
routePath: router.asPath,
});
});

View File

@ -8,12 +8,13 @@ import { CustomMenu, TOAST_TYPE, setToast } from "@plane/ui";
// components
import { ExistingIssuesListModal } from "components/core";
import { CreateUpdateIssueModal } from "components/issues";
// constants
// hooks
import { useEventTracker } from "hooks/store";
// types
import { TIssue, ISearchIssueResponse, TIssueKanbanFilters } from "@plane/types";
import { KanbanStoreType } from "../base-kanban-root";
// constants
import { E_KANBAN_LAYOUT } from "constants/event-tracker";
interface IHeaderGroupByCard {
sub_group_by: string | null;
@ -154,7 +155,7 @@ export const HeaderGroupByCard: FC<IHeaderGroupByCard> = observer((props) => {
>
<CustomMenu.MenuItem
onClick={() => {
setTrackElement("Kanban layout");
setTrackElement(E_KANBAN_LAYOUT);
setIsOpen(true);
}}
>
@ -162,7 +163,7 @@ export const HeaderGroupByCard: FC<IHeaderGroupByCard> = observer((props) => {
</CustomMenu.MenuItem>
<CustomMenu.MenuItem
onClick={() => {
setTrackElement("Kanban layout");
setTrackElement(E_KANBAN_LAYOUT);
setOpenExistingIssueListModal(true);
}}
>
@ -173,7 +174,7 @@ export const HeaderGroupByCard: FC<IHeaderGroupByCard> = observer((props) => {
<div
className="flex h-[20px] w-[20px] flex-shrink-0 cursor-pointer items-center justify-center overflow-hidden rounded-sm transition-all hover:bg-custom-background-80"
onClick={() => {
setTrackElement("Kanban layout");
setTrackElement(E_KANBAN_LAYOUT);
setIsOpen(true);
}}
>

View File

@ -5,7 +5,7 @@ import { useForm } from "react-hook-form";
import { PlusIcon } from "lucide-react";
// hooks
import { setPromiseToast } from "@plane/ui";
import { ISSUE_CREATED } from "constants/event-tracker";
import { E_KANBAN_QUICK_ADD, ISSUE_CREATED } from "constants/event-tracker";
import { createIssuePayload } from "helpers/issue.helper";
import { useEventTracker, useProject } from "hooks/store";
import useKeypress from "hooks/use-keypress";
@ -122,14 +122,14 @@ export const KanBanQuickAddIssueForm: React.FC<IKanBanQuickAddIssueForm> = obser
.then((res) => {
captureIssueEvent({
eventName: ISSUE_CREATED,
payload: { ...res, state: "SUCCESS", element: "Kanban quick add" },
payload: { ...res, state: "SUCCESS", element: E_KANBAN_QUICK_ADD },
routePath: router.asPath,
});
})
.catch(() => {
captureIssueEvent({
eventName: ISSUE_CREATED,
payload: { ...payload, state: "FAILED", element: "Kanban quick add" },
payload: { ...payload, state: "FAILED", element: E_KANBAN_QUICK_ADD },
routePath: router.asPath,
});
});

View File

@ -14,6 +14,8 @@ import { EIssuesStoreType } from "constants/issue";
import { useEventTracker } from "hooks/store";
// types
import { TIssue, ISearchIssueResponse } from "@plane/types";
// constants
import { E_LIST_LAYOUT } from "constants/event-tracker";
interface IHeaderGroupByCard {
icon?: React.ReactNode;
@ -86,7 +88,7 @@ export const HeaderGroupByCard = observer(
>
<CustomMenu.MenuItem
onClick={() => {
setTrackElement("List layout");
setTrackElement(E_LIST_LAYOUT);
setIsOpen(true);
}}
>
@ -94,7 +96,7 @@ export const HeaderGroupByCard = observer(
</CustomMenu.MenuItem>
<CustomMenu.MenuItem
onClick={() => {
setTrackElement("List layout");
setTrackElement(E_LIST_LAYOUT);
setOpenExistingIssueListModal(true);
}}
>
@ -105,7 +107,7 @@ export const HeaderGroupByCard = observer(
<div
className="flex h-5 w-5 flex-shrink-0 cursor-pointer items-center justify-center overflow-hidden rounded-sm transition-all hover:bg-custom-background-80"
onClick={() => {
setTrackElement("List layout");
setTrackElement(E_LIST_LAYOUT);
setIsOpen(true);
}}
>

View File

@ -5,7 +5,7 @@ import { useForm } from "react-hook-form";
import { PlusIcon } from "lucide-react";
// hooks
import { setPromiseToast } from "@plane/ui";
import { ISSUE_CREATED } from "constants/event-tracker";
import { E_LIST_QUICK_ADD, ISSUE_CREATED } from "constants/event-tracker";
import { createIssuePayload } from "helpers/issue.helper";
import { useEventTracker, useProject } from "hooks/store";
import useKeypress from "hooks/use-keypress";
@ -119,14 +119,14 @@ export const ListQuickAddIssueForm: FC<IListQuickAddIssueForm> = observer((props
.then((res) => {
captureIssueEvent({
eventName: ISSUE_CREATED,
payload: { ...res, state: "SUCCESS", element: "List quick add" },
payload: { ...res, state: "SUCCESS", element: E_LIST_QUICK_ADD },
routePath: router.asPath,
});
})
.catch(() => {
captureIssueEvent({
eventName: ISSUE_CREATED,
payload: { ...payload, state: "FAILED", element: "List quick add" },
payload: { ...payload, state: "FAILED", element: E_LIST_QUICK_ADD },
routePath: router.asPath,
});
});

View File

@ -18,6 +18,7 @@ import { useEventTracker, useProjectState } from "hooks/store";
import { TIssue } from "@plane/types";
import { IQuickActionProps } from "../list/list-view-types";
// constants
import { E_GLOBAL_ISSUES } from "constants/event-tracker";
export const AllIssueQuickActions: React.FC<IQuickActionProps> = observer((props) => {
const {
@ -106,7 +107,7 @@ export const AllIssueQuickActions: React.FC<IQuickActionProps> = observer((props
{isEditingAllowed && (
<CustomMenu.MenuItem
onClick={() => {
setTrackElement("Global issues");
setTrackElement(E_GLOBAL_ISSUES);
setIssueToEdit(issue);
setCreateUpdateIssueModal(true);
}}
@ -132,7 +133,7 @@ export const AllIssueQuickActions: React.FC<IQuickActionProps> = observer((props
{isEditingAllowed && (
<CustomMenu.MenuItem
onClick={() => {
setTrackElement("Global issues");
setTrackElement(E_GLOBAL_ISSUES);
setCreateUpdateIssueModal(true);
}}
>
@ -167,7 +168,7 @@ export const AllIssueQuickActions: React.FC<IQuickActionProps> = observer((props
{isEditingAllowed && (
<CustomMenu.MenuItem
onClick={() => {
setTrackElement("Global issues");
setTrackElement(E_GLOBAL_ISSUES);
setDeleteIssueModal(true);
}}
>

View File

@ -19,6 +19,7 @@ import { TIssue, IIssueDisplayFilterOptions } from "@plane/types";
import { EUserProjectRoles } from "constants/project";
import { EIssueFilterType, EIssuesStoreType, ISSUE_DISPLAY_FILTERS_BY_LAYOUT } from "constants/issue";
import { EMPTY_STATE_DETAILS, EmptyStateType } from "constants/empty-state";
import { E_GLOBAL_ISSUES_EMPTY_STATE } from "constants/event-tracker";
export const AllIssueLayoutRoot: React.FC = observer(() => {
// router
@ -165,12 +166,12 @@ export const AllIssueLayoutRoot: React.FC = observer(() => {
(workspaceProjectIds ?? []).length > 0
? currentView !== "custom-view" && currentView !== "subscribed"
? () => {
setTrackElement("All issues empty state");
setTrackElement(E_GLOBAL_ISSUES_EMPTY_STATE);
commandPaletteStore.toggleCreateIssueModal(true, EIssuesStoreType.PROJECT);
}
: undefined
: () => {
setTrackElement("All issues empty state");
setTrackElement(E_GLOBAL_ISSUES_EMPTY_STATE);
commandPaletteStore.toggleCreateProjectModal(true);
}
}

View File

@ -9,6 +9,7 @@ import { useEventTracker, useIssues } from "hooks/store";
// types
import { TIssue } from "@plane/types";
// constants
import { E_SPREADSHEET_LAYOUT } from "constants/event-tracker";
type Props = {
issue: TIssue;
@ -38,7 +39,7 @@ export const SpreadsheetCycleColumn: React.FC<Props> = observer((props) => {
payload: {
...issue,
cycle_id: cycleId,
element: "Spreadsheet layout",
element: E_SPREADSHEET_LAYOUT,
},
updates: { changed_property: "cycle", change_details: { cycle_id: cycleId } },
routePath: router.asPath,

View File

@ -10,6 +10,7 @@ import { useEventTracker, useIssues } from "hooks/store";
// types
import { TIssue } from "@plane/types";
// constants
import { E_SPREADSHEET_LAYOUT } from "constants/event-tracker";
type Props = {
issue: TIssue;
@ -49,7 +50,7 @@ export const SpreadsheetModuleColumn: React.FC<Props> = observer((props) => {
payload: {
...issue,
module_ids: moduleIds,
element: "Spreadsheet layout",
element: E_SPREADSHEET_LAYOUT,
},
updates: { changed_property: "module_ids", change_details: { module_ids: moduleIds } },
routePath: router.asPath,

View File

@ -2,11 +2,13 @@ import { useRef } from "react";
import { observer } from "mobx-react";
import { useRouter } from "next/router";
// types
import { SPREADSHEET_PROPERTY_DETAILS } from "constants/spreadsheet";
import { useEventTracker } from "hooks/store";
import { IIssueDisplayProperties, TIssue } from "@plane/types";
import { WithDisplayPropertiesHOC } from "../properties/with-display-properties-HOC";
// constants
import { E_SPREADSHEET_LAYOUT } from "constants/event-tracker";
import { SPREADSHEET_PROPERTY_DETAILS } from "constants/spreadsheet";
// constants
// components
type Props = {
@ -50,7 +52,7 @@ export const IssueColumn = observer((props: Props) => {
payload: {
...issue,
...data,
element: "Spreadsheet layout",
element: E_SPREADSHEET_LAYOUT,
},
updates: updates,
routePath: router.asPath,

View File

@ -5,7 +5,7 @@ import { useForm } from "react-hook-form";
import { PlusIcon } from "lucide-react";
// hooks
import { TOAST_TYPE, setPromiseToast, setToast } from "@plane/ui";
import { ISSUE_CREATED } from "constants/event-tracker";
import { E_SPREADSHEET_QUICK_ADD, ISSUE_CREATED } from "constants/event-tracker";
import { createIssuePayload } from "helpers/issue.helper";
import { useEventTracker, useProject, useWorkspace } from "hooks/store";
import useKeypress from "hooks/use-keypress";
@ -182,14 +182,14 @@ export const SpreadsheetQuickAddIssueForm: React.FC<Props> = observer((props) =>
.then((res) => {
captureIssueEvent({
eventName: ISSUE_CREATED,
payload: { ...res, state: "SUCCESS", element: "Spreadsheet quick add" },
payload: { ...res, state: "SUCCESS", element: E_SPREADSHEET_QUICK_ADD },
routePath: router.asPath,
});
})
.catch((err) => {
captureIssueEvent({
eventName: ISSUE_CREATED,
payload: { ...payload, state: "FAILED", element: "Spreadsheet quick add" },
payload: { ...payload, state: "FAILED", element: E_SPREADSHEET_QUICK_ADD },
routePath: router.asPath,
});
console.error(err);

View File

@ -13,6 +13,7 @@ import {
ISSUE_RESTORED,
ISSUE_OPENED,
elementFromPath,
E_ISSUE_PEEK_VIEW,
} from "constants/event-tracker";
import { EIssuesStoreType } from "constants/issue";
import { EUserProjectRoles } from "constants/project";
@ -94,7 +95,7 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
.then(() => {
captureIssueEvent({
eventName: ISSUE_UPDATED,
payload: { ...data, issueId, state: "SUCCESS", element: "Issue peek-overview" },
payload: { ...data, issueId, state: "SUCCESS", element: E_ISSUE_PEEK_VIEW },
updates: {
changed_property: Object.keys(data).join(","),
change_details: Object.values(data).join(","),
@ -105,7 +106,7 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
.catch(() => {
captureIssueEvent({
eventName: ISSUE_UPDATED,
payload: { state: "FAILED", element: "Issue peek-overview" },
payload: { state: "FAILED", element: E_ISSUE_PEEK_VIEW },
routePath: router.asPath,
});
setToast({
@ -125,7 +126,7 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
});
captureIssueEvent({
eventName: ISSUE_DELETED,
payload: { id: issueId, state: "SUCCESS", element: "Issue peek-overview" },
payload: { id: issueId, state: "SUCCESS", element: E_ISSUE_PEEK_VIEW },
routePath: router.asPath,
});
} catch (error) {
@ -136,7 +137,7 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
});
captureIssueEvent({
eventName: ISSUE_DELETED,
payload: { id: issueId, state: "FAILED", element: "Issue peek-overview" },
payload: { id: issueId, state: "FAILED", element: E_ISSUE_PEEK_VIEW },
routePath: router.asPath,
});
}
@ -151,7 +152,7 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
});
captureIssueEvent({
eventName: ISSUE_ARCHIVED,
payload: { id: issueId, state: "SUCCESS", element: "Issue peek-overview" },
payload: { id: issueId, state: "SUCCESS", element: E_ISSUE_PEEK_VIEW },
routePath: router.asPath,
});
} catch (error) {
@ -162,7 +163,7 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
});
captureIssueEvent({
eventName: ISSUE_ARCHIVED,
payload: { id: issueId, state: "FAILED", element: "Issue peek-overview" },
payload: { id: issueId, state: "FAILED", element: E_ISSUE_PEEK_VIEW },
routePath: router.asPath,
});
}
@ -177,7 +178,7 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
});
captureIssueEvent({
eventName: ISSUE_RESTORED,
payload: { id: issueId, state: "SUCCESS", element: "Issue peek-overview" },
payload: { id: issueId, state: "SUCCESS", element: E_ISSUE_PEEK_VIEW },
routePath: router.asPath,
});
} catch (error) {
@ -188,7 +189,7 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
});
captureIssueEvent({
eventName: ISSUE_RESTORED,
payload: { id: issueId, state: "FAILED", element: "Issue peek-overview" },
payload: { id: issueId, state: "FAILED", element: E_ISSUE_PEEK_VIEW },
routePath: router.asPath,
});
}
@ -210,7 +211,7 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
await addToCyclePromise;
captureIssueEvent({
eventName: ISSUE_UPDATED,
payload: { ...issueIds, state: "SUCCESS", element: "Issue peek-overview" },
payload: { ...issueIds, state: "SUCCESS", element: E_ISSUE_PEEK_VIEW },
updates: {
changed_property: "cycle_id",
change_details: cycleId,
@ -220,7 +221,7 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
} catch (error) {
captureIssueEvent({
eventName: ISSUE_UPDATED,
payload: { state: "FAILED", element: "Issue peek-overview" },
payload: { state: "FAILED", element: E_ISSUE_PEEK_VIEW },
updates: {
changed_property: "cycle_id",
change_details: cycleId,
@ -246,7 +247,7 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
await removeFromCyclePromise;
captureIssueEvent({
eventName: ISSUE_UPDATED,
payload: { issueId, state: "SUCCESS", element: "Issue peek-overview" },
payload: { issueId, state: "SUCCESS", element: E_ISSUE_PEEK_VIEW },
updates: {
changed_property: "cycle_id",
change_details: "",
@ -256,7 +257,7 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
} catch (error) {
captureIssueEvent({
eventName: ISSUE_UPDATED,
payload: { state: "FAILED", element: "Issue peek-overview" },
payload: { state: "FAILED", element: E_ISSUE_PEEK_VIEW },
updates: {
changed_property: "cycle_id",
change_details: "",
@ -282,7 +283,7 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
const response = await addToModulePromise;
captureIssueEvent({
eventName: ISSUE_UPDATED,
payload: { ...response, state: "SUCCESS", element: "Issue peek-overview" },
payload: { ...response, state: "SUCCESS", element: E_ISSUE_PEEK_VIEW },
updates: {
changed_property: "module_id",
change_details: moduleIds,
@ -292,7 +293,7 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
} catch (error) {
captureIssueEvent({
eventName: ISSUE_UPDATED,
payload: { id: issueId, state: "FAILED", element: "Issue peek-overview" },
payload: { id: issueId, state: "FAILED", element: E_ISSUE_PEEK_VIEW },
updates: {
changed_property: "module_id",
change_details: moduleIds,
@ -318,7 +319,7 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
await removeFromModulePromise;
captureIssueEvent({
eventName: ISSUE_UPDATED,
payload: { id: issueId, state: "SUCCESS", element: "Issue peek-overview" },
payload: { id: issueId, state: "SUCCESS", element: E_ISSUE_PEEK_VIEW },
updates: {
changed_property: "module_id",
change_details: "",
@ -328,7 +329,7 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
} catch (error) {
captureIssueEvent({
eventName: ISSUE_UPDATED,
payload: { id: issueId, state: "FAILED", element: "Issue peek-overview" },
payload: { id: issueId, state: "FAILED", element: E_ISSUE_PEEK_VIEW },
updates: {
changed_property: "module_id",
change_details: "",

View File

@ -12,6 +12,8 @@ import { useEventTracker, useIssueDetail } from "hooks/store";
import { IUser, TIssue } from "@plane/types";
import { IssueList } from "./issues-list";
import { ProgressBar } from "./progressbar";
// constants
import { E_ISSUE_DETAILS } from "constants/event-tracker";
// ui
// helpers
// types
@ -173,7 +175,7 @@ export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
await updateSubIssue(workspaceSlug, projectId, parentIssueId, issueId, issueData, oldIssue, fromModal);
captureIssueEvent({
eventName: "Sub-issue updated",
payload: { ...oldIssue, ...issueData, state: "SUCCESS", element: "Issue detail page" },
payload: { ...oldIssue, ...issueData, state: "SUCCESS", element: E_ISSUE_DETAILS },
updates: {
changed_property: Object.keys(issueData).join(","),
change_details:
@ -190,7 +192,7 @@ export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
} catch (error) {
captureIssueEvent({
eventName: "Sub-issue updated",
payload: { ...oldIssue, ...issueData, state: "FAILED", element: "Issue detail page" },
payload: { ...oldIssue, ...issueData, state: "FAILED", element: E_ISSUE_DETAILS },
updates: {
changed_property: Object.keys(issueData).join(","),
change_details:
@ -216,7 +218,7 @@ export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
});
captureIssueEvent({
eventName: "Sub-issue removed",
payload: { id: issueId, state: "SUCCESS", element: "Issue detail page" },
payload: { id: issueId, state: "SUCCESS", element: E_ISSUE_DETAILS },
updates: {
changed_property: "parent_id",
change_details: parentIssueId,
@ -227,7 +229,7 @@ export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
} catch (error) {
captureIssueEvent({
eventName: "Sub-issue removed",
payload: { id: issueId, state: "FAILED", element: "Issue detail page" },
payload: { id: issueId, state: "FAILED", element: E_ISSUE_DETAILS },
updates: {
changed_property: "parent_id",
change_details: parentIssueId,
@ -252,14 +254,14 @@ export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
});
captureIssueEvent({
eventName: "Sub-issue deleted",
payload: { id: issueId, state: "SUCCESS", element: "Issue detail page" },
payload: { id: issueId, state: "SUCCESS", element: E_ISSUE_DETAILS },
routePath: router.asPath,
});
setSubIssueHelpers(parentIssueId, "issue_loader", issueId);
} catch (error) {
captureIssueEvent({
eventName: "Sub-issue removed",
payload: { id: issueId, state: "FAILED", element: "Issue detail page" },
payload: { id: issueId, state: "FAILED", element: E_ISSUE_DETAILS },
routePath: router.asPath,
});
setToast({
@ -354,7 +356,7 @@ export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
<div
className="cursor-pointer rounded border border-custom-border-100 p-1.5 px-2 shadow transition-all hover:bg-custom-background-80"
onClick={() => {
setTrackElement("Issue detail add sub-issue");
setTrackElement(E_ISSUE_DETAILS);
handleIssueCrudState("create", parentIssueId, null);
}}
>
@ -363,7 +365,7 @@ export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
<div
className="cursor-pointer rounded border border-custom-border-100 p-1.5 px-2 shadow transition-all hover:bg-custom-background-80"
onClick={() => {
setTrackElement("Issue detail add sub-issue");
setTrackElement(E_ISSUE_DETAILS);
handleIssueCrudState("existing", parentIssueId, null);
}}
>
@ -406,7 +408,7 @@ export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
>
<CustomMenu.MenuItem
onClick={() => {
setTrackElement("Issue detail nested sub-issue");
setTrackElement(E_ISSUE_DETAILS);
handleIssueCrudState("create", parentIssueId, null);
}}
>
@ -414,7 +416,7 @@ export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
</CustomMenu.MenuItem>
<CustomMenu.MenuItem
onClick={() => {
setTrackElement("Issue detail nested sub-issue");
setTrackElement(E_ISSUE_DETAILS);
handleIssueCrudState("existing", parentIssueId, null);
}}
>

View File

@ -13,7 +13,7 @@ import { useEventTracker, useLabel } from "hooks/store";
// types
import type { IIssueLabel, IState } from "@plane/types";
// constants
import { LABEL_CREATED } from "constants/event-tracker";
import { E_LABELS, LABEL_CREATED } from "constants/event-tracker";
// types
type Props = {
@ -74,7 +74,7 @@ export const CreateLabelModal: React.FC<Props> = observer((props) => {
label_id: res.id,
color: res.color,
parent: res.parent,
element: "Project settings labels page",
element: E_LABELS,
state: "SUCCESS",
});
onClose();

View File

@ -8,7 +8,7 @@ import { Popover, Transition } from "@headlessui/react";
import { Button, Input, TOAST_TYPE, setToast } from "@plane/ui";
// constants
import { getRandomLabelColor, LABEL_COLOR_OPTIONS } from "constants/label";
import { LABEL_CREATED, LABEL_UPDATED } from "constants/event-tracker";
import { E_LABELS, LABEL_CREATED, LABEL_UPDATED } from "constants/event-tracker";
// hooks
import { useEventTracker, useLabel } from "hooks/store";
// types
@ -64,7 +64,7 @@ export const CreateUpdateLabelInline = observer(
label_id: res.id,
color: res.color,
parent: res.parent,
element: "Project settings labels page",
element: E_LABELS,
state: "SUCCESS",
});
handleClose();
@ -91,7 +91,7 @@ export const CreateUpdateLabelInline = observer(
color: res.color,
parent: res.parent,
change_details: Object.keys(dirtyFields),
element: "Project settings labels page",
element: E_LABELS,
state: "SUCCESS",
});
reset(defaultValues);

View File

@ -11,7 +11,7 @@ import { useEventTracker, useLabel } from "hooks/store";
// types
import type { IIssueLabel } from "@plane/types";
// constants
import { LABEL_DELETED, LABEL_GROUP_DELETED } from "constants/event-tracker";
import { E_LABELS, LABEL_DELETED, LABEL_GROUP_DELETED } from "constants/event-tracker";
type Props = {
isOpen: boolean;
@ -47,13 +47,13 @@ export const DeleteLabelModal: React.FC<Props> = observer((props) => {
captureEvent(LABEL_GROUP_DELETED, {
group_id: data.id,
children_count: labelChildCount,
element: "Project settings labels page",
element: E_LABELS,
state: "SUCCESS",
});
} else {
captureEvent(LABEL_DELETED, {
label_id: data.id,
element: "Project settings labels page",
element: E_LABELS,
state: "SUCCESS",
});
}

View File

@ -6,7 +6,7 @@ import { Info, LinkIcon, Pencil, Star, Trash2 } from "lucide-react";
// hooks
import { Avatar, AvatarGroup, CustomMenu, LayersIcon, Tooltip, TOAST_TYPE, setToast, setPromiseToast } from "@plane/ui";
import { CreateUpdateModuleModal, DeleteModuleModal } from "components/modules";
import { MODULE_FAVORITED, MODULE_UNFAVORITED } from "constants/event-tracker";
import { E_GRID_LAYOUT, E_MODULES_GRID_LAYOUT, MODULE_FAVORITED, MODULE_UNFAVORITED } from "constants/event-tracker";
import { MODULE_STATUS } from "constants/module";
import { EUserProjectRoles } from "constants/project";
import { renderFormattedDate } from "helpers/date-time.helper";
@ -50,7 +50,7 @@ export const ModuleCardItem: React.FC<Props> = observer((props) => {
() => {
captureEvent(MODULE_FAVORITED, {
module_id: moduleId,
element: "Grid layout",
element: E_GRID_LAYOUT,
state: "SUCCESS",
});
}
@ -81,7 +81,7 @@ export const ModuleCardItem: React.FC<Props> = observer((props) => {
).then(() => {
captureEvent(MODULE_UNFAVORITED, {
module_id: moduleId,
element: "Grid layout",
element: E_GRID_LAYOUT,
state: "SUCCESS",
});
});
@ -114,14 +114,14 @@ export const ModuleCardItem: React.FC<Props> = observer((props) => {
const handleEditModule = (e: React.MouseEvent<HTMLButtonElement>) => {
e.preventDefault();
e.stopPropagation();
setTrackElement("Modules page grid layout");
setTrackElement(E_MODULES_GRID_LAYOUT);
setEditModal(true);
};
const handleDeleteModule = (e: React.MouseEvent<HTMLButtonElement>) => {
e.preventDefault();
e.stopPropagation();
setTrackElement("Modules page grid layout");
setTrackElement(E_MODULES_GRID_LAYOUT);
setDeleteModal(true);
};
@ -160,8 +160,8 @@ export const ModuleCardItem: React.FC<Props> = observer((props) => {
? !moduleTotalIssues || moduleTotalIssues === 0
? "0 Issue"
: moduleTotalIssues === moduleDetails.completed_issues
? `${moduleTotalIssues} Issue${moduleTotalIssues > 1 ? "s" : ""}`
: `${moduleDetails.completed_issues}/${moduleTotalIssues} Issues`
? `${moduleTotalIssues} Issue${moduleTotalIssues > 1 ? "s" : ""}`
: `${moduleDetails.completed_issues}/${moduleTotalIssues} Issues`
: "0 Issue";
return (

View File

@ -15,7 +15,7 @@ import {
setPromiseToast,
} from "@plane/ui";
import { CreateUpdateModuleModal, DeleteModuleModal } from "components/modules";
import { MODULE_FAVORITED, MODULE_UNFAVORITED } from "constants/event-tracker";
import { E_GRID_LAYOUT, E_MODULES_LIST_LAYOUT, MODULE_FAVORITED, MODULE_UNFAVORITED } from "constants/event-tracker";
import { MODULE_STATUS } from "constants/module";
import { EUserProjectRoles } from "constants/project";
import { renderFormattedDate } from "helpers/date-time.helper";
@ -59,7 +59,7 @@ export const ModuleListItem: React.FC<Props> = observer((props) => {
() => {
captureEvent(MODULE_FAVORITED, {
module_id: moduleId,
element: "Grid layout",
element: E_GRID_LAYOUT,
state: "SUCCESS",
});
}
@ -90,7 +90,7 @@ export const ModuleListItem: React.FC<Props> = observer((props) => {
).then(() => {
captureEvent(MODULE_UNFAVORITED, {
module_id: moduleId,
element: "Grid layout",
element: E_GRID_LAYOUT,
state: "SUCCESS",
});
});
@ -123,14 +123,14 @@ export const ModuleListItem: React.FC<Props> = observer((props) => {
const handleEditModule = (e: React.MouseEvent<HTMLButtonElement>) => {
e.preventDefault();
e.stopPropagation();
setTrackElement("Modules page list layout");
setTrackElement(E_MODULES_LIST_LAYOUT);
setEditModal(true);
};
const handleDeleteModule = (e: React.MouseEvent<HTMLButtonElement>) => {
e.preventDefault();
e.stopPropagation();
setTrackElement("Modules page list layout");
setTrackElement(E_MODULES_LIST_LAYOUT);
setDeleteModal(true);
};

View File

@ -13,6 +13,7 @@ import NameFilterImage from "public/empty-state/module/name-filter.svg";
import AllFiltersImage from "public/empty-state/module/all-filters.svg";
// constants
import { EmptyStateType } from "constants/empty-state";
import { E_MODULES_EMPTY_STATE } from "constants/event-tracker";
export const ModulesListView: React.FC = observer(() => {
// router
@ -100,7 +101,7 @@ export const ModulesListView: React.FC = observer(() => {
<EmptyState
type={EmptyStateType.PROJECT_MODULE}
primaryButtonOnClick={() => {
setTrackElement("Module empty state");
setTrackElement(E_MODULES_EMPTY_STATE);
commandPaletteStore.toggleCreateModuleModal(true);
}}
/>

View File

@ -31,7 +31,14 @@ import ProgressChart from "components/core/sidebar/progress-chart";
import { DateRangeDropdown, MemberDropdown } from "components/dropdowns";
import { DeleteModuleModal } from "components/modules";
// constant
import { MODULE_LINK_CREATED, MODULE_LINK_DELETED, MODULE_LINK_UPDATED, MODULE_UPDATED } from "constants/event-tracker";
import {
E_MODULE_SIDEBAR,
E_SIDEBAR,
MODULE_LINK_CREATED,
MODULE_LINK_DELETED,
MODULE_LINK_UPDATED,
MODULE_UPDATED,
} from "constants/event-tracker";
import { MODULE_STATUS } from "constants/module";
import { EUserProjectRoles } from "constants/project";
// helpers
@ -83,7 +90,7 @@ export const ModuleDetailsSidebar: React.FC<Props> = observer((props) => {
.then((res) => {
captureModuleEvent({
eventName: MODULE_UPDATED,
payload: { ...res, changed_properties: Object.keys(data)[0], element: "Right side-peek", state: "SUCCESS" },
payload: { ...res, changed_properties: Object.keys(data)[0], element: E_SIDEBAR, state: "SUCCESS" },
});
})
.catch(() => {
@ -274,7 +281,7 @@ export const ModuleDetailsSidebar: React.FC<Props> = observer((props) => {
<CustomMenu placement="bottom-end" ellipsis>
<CustomMenu.MenuItem
onClick={() => {
setTrackElement("Module peek-overview");
setTrackElement(E_MODULE_SIDEBAR);
setModuleDeleteModal(true);
}}
>

View File

@ -8,7 +8,7 @@ import { ArchiveRestore, Clock, MessageSquare, MoreVertical, User2 } from "lucid
// ui
import { ArchiveIcon, CustomMenu, Tooltip, TOAST_TYPE, setToast } from "@plane/ui";
// constants
import { ISSUE_OPENED, NOTIFICATIONS_READ, NOTIFICATION_ARCHIVED, NOTIFICATION_SNOOZED } from "constants/event-tracker";
import { E_Notifications, ISSUE_OPENED, NOTIFICATIONS_READ, NOTIFICATION_ARCHIVED, NOTIFICATION_SNOOZED } from "constants/event-tracker";
import { snoozeOptions } from "constants/notification";
// helper
import { calculateTimeAgo, renderFormattedTime, renderFormattedDate } from "helpers/date-time.helper";
@ -129,7 +129,7 @@ export const NotificationCard: React.FC<NotificationCardProps> = (props) => {
markNotificationReadStatus(notification.id);
captureEvent(ISSUE_OPENED, {
issue_id: notification.data.issue.id,
element: "Notification",
element: E_Notifications,
element_id: isArchivedTabOpen
? "archived"
: isSnoozedTabOpen

View File

@ -3,7 +3,7 @@ import useSWR, { mutate } from "swr";
// hooks
import { CheckCircle2, Search } from "lucide-react";
import { Button } from "@plane/ui";
import { MEMBER_ACCEPTED } from "constants/event-tracker";
import { E_WORKSPACE_INVITATION, MEMBER_ACCEPTED } from "constants/event-tracker";
import { USER_WORKSPACES, USER_WORKSPACE_INVITATIONS } from "constants/fetch-keys";
import { ROLE } from "constants/workspace";
import { truncateText } from "helpers/string.helper";
@ -72,7 +72,7 @@ export const Invitations: React.FC<Props> = (props) => {
project_id: undefined,
accepted_from: "App",
state: "SUCCESS",
element: "Workspace invitations page",
element: E_WORKSPACE_INVITATION,
});
await fetchWorkspaces();
await mutate(USER_WORKSPACES);
@ -88,7 +88,7 @@ export const Invitations: React.FC<Props> = (props) => {
project_id: undefined,
accepted_from: "App",
state: "FAILED",
element: "Workspace invitations page",
element: E_WORKSPACE_INVITATION,
});
})
.finally(() => setIsJoiningWorkspaces(false));

View File

@ -20,7 +20,7 @@ import { Button, Input, TOAST_TYPE, setToast } from "@plane/ui";
// components
import { OnboardingStepIndicator } from "components/onboarding/step-indicator";
// constants
import { MEMBER_INVITED } from "constants/event-tracker";
import { E_ONBOARDING, MEMBER_INVITED } from "constants/event-tracker";
import { EUserWorkspaceRoles, ROLE } from "constants/workspace";
// helpers
import { getUserRole } from "helpers/user.helper";
@ -323,7 +323,7 @@ export const InviteMembers: React.FC<Props> = (props) => {
: undefined,
project_id: undefined,
state: "SUCCESS",
element: "Onboarding",
element: E_ONBOARDING,
});
setToast({
type: TOAST_TYPE.SUCCESS,
@ -337,7 +337,7 @@ export const InviteMembers: React.FC<Props> = (props) => {
captureEvent(MEMBER_INVITED, {
project_id: undefined,
state: "FAILED",
element: "Onboarding",
element: E_ONBOARDING,
});
setToast({
type: TOAST_TYPE.ERROR,

View File

@ -5,7 +5,7 @@ import { X } from "lucide-react";
// hooks
import { Button } from "@plane/ui";
import { TourSidebar } from "components/onboarding";
import { PRODUCT_TOUR_SKIPPED, PRODUCT_TOUR_STARTED } from "constants/event-tracker";
import { E_PRODUCT_TOUR, PRODUCT_TOUR_SKIPPED, PRODUCT_TOUR_STARTED } from "constants/event-tracker";
import { useApplication, useEventTracker, useUser } from "hooks/store";
// components
// ui
@ -167,7 +167,7 @@ export const TourRoot: React.FC<Props> = observer((props) => {
<Button
variant="primary"
onClick={() => {
setTrackElement("Product tour");
setTrackElement(E_PRODUCT_TOUR);
onComplete();
commandPaletteStore.toggleCreateProjectModal(true);
}}

View File

@ -8,7 +8,7 @@ import { Button, Input } from "@plane/ui";
import { UserImageUploadModal } from "components/core";
import { OnboardingSidebar, OnboardingStepIndicator } from "components/onboarding";
// constants
import { USER_DETAILS } from "constants/event-tracker";
import { E_ONBOARDING, USER_DETAILS } from "constants/event-tracker";
// hooks
import { useEventTracker, useUser, useWorkspace } from "hooks/store";
// assets
@ -85,14 +85,14 @@ export const UserDetails: React.FC<Props> = observer((props) => {
captureEvent(USER_DETAILS, {
use_case: formData.use_case,
state: "SUCCESS",
element: "Onboarding",
element: E_ONBOARDING,
});
})
.catch(() => {
captureEvent(USER_DETAILS, {
use_case: formData.use_case,
state: "FAILED",
element: "Onboarding",
element: E_ONBOARDING,
});
});
};

View File

@ -3,7 +3,7 @@ import { Control, Controller, FieldErrors, UseFormHandleSubmit, UseFormSetValue
// ui
import { Button, Input, TOAST_TYPE, setToast } from "@plane/ui";
// types
import { WORKSPACE_CREATED } from "constants/event-tracker";
import { E_ONBOARDING, WORKSPACE_CREATED } from "constants/event-tracker";
import { RESTRICTED_URLS } from "constants/workspace";
import { useEventTracker, useUser, useWorkspace } from "hooks/store";
// services
@ -56,7 +56,7 @@ export const Workspace: React.FC<Props> = (props) => {
...res,
state: "SUCCESS",
first_time: true,
element: "Onboarding",
element: E_ONBOARDING,
},
});
await fetchWorkspaces();
@ -68,7 +68,7 @@ export const Workspace: React.FC<Props> = (props) => {
payload: {
state: "FAILED",
first_time: true,
element: "Onboarding",
element: E_ONBOARDING,
},
});
setToast({

View File

@ -11,7 +11,7 @@ import { UserGreetingsView } from "components/user";
// ui
import { Spinner } from "@plane/ui";
// constants
import { PRODUCT_TOUR_COMPLETED } from "constants/event-tracker";
import { E_DASHBOARD_EMPTY_STATE, PRODUCT_TOUR_COMPLETED } from "constants/event-tracker";
import { EmptyStateType } from "constants/empty-state";
export const WorkspaceDashboardView = observer(() => {
@ -67,7 +67,7 @@ export const WorkspaceDashboardView = observer(() => {
<EmptyState
type={EmptyStateType.WORKSPACE_DASHBOARD}
primaryButtonOnClick={() => {
setTrackElement("Dashboard empty state");
setTrackElement(E_DASHBOARD_EMPTY_STATE);
toggleCreateProjectModal(true);
}}
/>

View File

@ -21,7 +21,7 @@ import { CreateUpdatePageModal, DeletePageModal } from "components/pages";
// constants
import { EUserProjectRoles } from "constants/project";
import {
E_PROJECT_PAGES,
E_PAGES,
PAGE_ARCHIVED,
PAGE_FAVORITED,
PAGE_RESTORED,
@ -96,7 +96,7 @@ export const PagesListItem: FC<IPagesListItem> = observer(({ pageId, projectId }
addToFavorites().then(() => {
captureEvent(PAGE_FAVORITED, {
page_id: pageId,
element: E_PROJECT_PAGES,
element: E_PAGES,
state: "SUCCESS",
});
});
@ -109,7 +109,7 @@ export const PagesListItem: FC<IPagesListItem> = observer(({ pageId, projectId }
removeFromFavorites().then(() => {
captureEvent(PAGE_UNFAVORITED, {
page_id: pageId,
element: E_PROJECT_PAGES,
element: E_PAGES,
state: "SUCCESS",
});
});
@ -123,7 +123,7 @@ export const PagesListItem: FC<IPagesListItem> = observer(({ pageId, projectId }
captureEvent(PAGE_UPDATED, {
page_id: pageId,
access: "public",
element: E_PROJECT_PAGES,
element: E_PAGES,
state: "SUCCESS",
});
});
@ -137,7 +137,7 @@ export const PagesListItem: FC<IPagesListItem> = observer(({ pageId, projectId }
captureEvent(PAGE_UPDATED, {
page_id: pageId,
access: "private",
element: E_PROJECT_PAGES,
element: E_PAGES,
state: "SUCCESS",
});
});
@ -151,7 +151,7 @@ export const PagesListItem: FC<IPagesListItem> = observer(({ pageId, projectId }
captureEvent(PAGE_ARCHIVED, {
page_id: pageId,
access: access == 1 ? "private" : "public",
element: E_PROJECT_PAGES,
element: E_PAGES,
state: "SUCCESS",
});
});
@ -165,7 +165,7 @@ export const PagesListItem: FC<IPagesListItem> = observer(({ pageId, projectId }
captureEvent(PAGE_RESTORED, {
page_id: pageId,
access: access == 1 ? "private" : "public",
element: E_PROJECT_PAGES,
element: E_PAGES,
state: "SUCCESS",
});
});
@ -213,7 +213,7 @@ export const PagesListItem: FC<IPagesListItem> = observer(({ pageId, projectId }
eventName: PAGE_VIEWED,
payload: {
...pageStore,
element: E_PROJECT_PAGES,
element: E_PAGES,
},
})
}

View File

@ -11,6 +11,7 @@ import AllFiltersImage from "public/empty-state/project/all-filters.svg";
import NameFilterImage from "public/empty-state/project/name-filter.svg";
// constants
import { EmptyStateType } from "constants/empty-state";
import { E_PROJECT_EMPTY_STATE } from "constants/event-tracker";
export const ProjectCardList = observer(() => {
// store hooks
@ -26,7 +27,7 @@ export const ProjectCardList = observer(() => {
<EmptyState
type={EmptyStateType.WORKSPACE_PROJECTS}
primaryButtonOnClick={() => {
setTrackElement("Project empty state");
setTrackElement(E_PROJECT_EMPTY_STATE);
commandPaletteStore.toggleCreateProjectModal(true);
}}
/>

View File

@ -9,7 +9,7 @@ import { useEventTracker, useProject } from "hooks/store";
// ui
// types
import type { IProject } from "@plane/types";
import { PROJECT_DELETED } from "constants/event-tracker";
import { E_PROJECT_GENERAL, PROJECT_DELETED } from "constants/event-tracker";
// constants
type DeleteProjectModal = {
@ -61,7 +61,7 @@ export const DeleteProjectModal: React.FC<DeleteProjectModal> = (props) => {
handleClose();
captureProjectEvent({
eventName: PROJECT_DELETED,
payload: { ...project, state: "SUCCESS", element: "Project general settings" },
payload: { ...project, state: "SUCCESS", element: E_PROJECT_GENERAL },
});
setToast({
type: TOAST_TYPE.SUCCESS,
@ -72,7 +72,7 @@ export const DeleteProjectModal: React.FC<DeleteProjectModal> = (props) => {
.catch(() => {
captureProjectEvent({
eventName: PROJECT_DELETED,
payload: { ...project, state: "FAILED", element: "Project general settings" },
payload: { ...project, state: "FAILED", element: E_PROJECT_GENERAL },
});
setToast({
type: TOAST_TYPE.ERROR,

View File

@ -16,7 +16,7 @@ import {
// components
import { ImagePickerPopover } from "components/core";
// constants
import { PROJECT_UPDATED } from "constants/event-tracker";
import { E_PROJECT_GENERAL, PROJECT_UPDATED } from "constants/event-tracker";
import { NETWORK_CHOICES } from "constants/project";
// helpers
import { renderFormattedDate } from "helpers/date-time.helper";
@ -86,7 +86,7 @@ export const ProjectDetailsForm: FC<IProjectDetailsForm> = (props) => {
...res,
changed_properties: changed_properties,
state: "SUCCESS",
element: "Project general settings",
element: E_PROJECT_GENERAL,
},
});
setToast({
@ -98,7 +98,7 @@ export const ProjectDetailsForm: FC<IProjectDetailsForm> = (props) => {
.catch((error) => {
captureProjectEvent({
eventName: PROJECT_UPDATED,
payload: { ...payload, state: "FAILED", element: "Project general settings" },
payload: { ...payload, state: "FAILED", element: E_PROJECT_GENERAL },
});
setToast({
type: TOAST_TYPE.ERROR,

View File

@ -9,7 +9,7 @@ import { AlertTriangleIcon } from "lucide-react";
// ui
import { Button, Input, TOAST_TYPE, setToast } from "@plane/ui";
// constants
import { PROJECT_MEMBER_LEFT } from "constants/event-tracker";
import { E_PROJECT_MEMBERS, PROJECT_MEMBER_LEFT } from "constants/event-tracker";
// hooks
import { useEventTracker, useUser } from "hooks/store";
// types
@ -66,7 +66,7 @@ export const LeaveProjectModal: FC<ILeaveProjectModal> = observer((props) => {
router.push(`/${workspaceSlug}/projects`);
captureEvent(PROJECT_MEMBER_LEFT, {
state: "SUCCESS",
element: "Project settings members page",
element: E_PROJECT_MEMBERS,
});
})
.catch(() => {
@ -77,7 +77,7 @@ export const LeaveProjectModal: FC<ILeaveProjectModal> = observer((props) => {
});
captureEvent(PROJECT_MEMBER_LEFT, {
state: "FAILED",
element: "Project settings members page",
element: E_PROJECT_MEMBERS,
});
});
} else {

View File

@ -9,7 +9,7 @@ import { CustomSelect, Tooltip, TOAST_TYPE, setToast } from "@plane/ui";
// components
import { ConfirmProjectMemberRemove } from "components/project";
// constants
import { PM_ROLE_CHANGED, PROJECT_MEMBER_LEFT, PROJECT_MEMBER_REMOVED } from "constants/event-tracker";
import { E_PROJECT_MEMBERS, PM_ROLE_CHANGED, PROJECT_MEMBER_LEFT, PROJECT_MEMBER_REMOVED } from "constants/event-tracker";
import { EUserProjectRoles } from "constants/project";
import { ROLE } from "constants/workspace";
// hooks
@ -52,7 +52,7 @@ export const ProjectMemberListItem: React.FC<Props> = observer((props) => {
.then(async () => {
captureEvent(PROJECT_MEMBER_LEFT, {
state: "SUCCESS",
element: "Project settings members page",
element: E_PROJECT_MEMBERS,
});
await fetchProjects(workspaceSlug.toString());
router.push(`/${workspaceSlug}/projects`);
@ -72,7 +72,7 @@ export const ProjectMemberListItem: React.FC<Props> = observer((props) => {
role: getUserRole(userDetails.role as number),
removed_by_role: currentProjectRole ? getUserRole(currentProjectRole as number) : undefined,
state: "SUCCESS",
element: "Project settings members page",
element: E_PROJECT_MEMBERS,
});
})
.catch((err) =>
@ -162,7 +162,7 @@ export const ProjectMemberListItem: React.FC<Props> = observer((props) => {
member_id: userDetails.member.id,
changed_role: getUserRole(value as number),
state: "SUCCESS",
element: "Project settings members page",
element: E_PROJECT_MEMBERS,
});
})
.catch((err) => {

View File

@ -8,6 +8,8 @@ import { ProjectMemberListItem, SendProjectInvitationModal } from "components/pr
// ui
import { MembersSettingsLoader } from "components/ui";
import { useEventTracker, useMember } from "hooks/store";
// constants
import { E_PROJECT_MEMBERS } from "constants/event-tracker";
export const ProjectMemberList: React.FC = observer(() => {
// states
@ -49,7 +51,7 @@ export const ProjectMemberList: React.FC = observer(() => {
<Button
variant="primary"
onClick={() => {
setTrackElement("PROJECT_SETTINGS_MEMBERS_PAGE_HEADER");
setTrackElement(E_PROJECT_MEMBERS);
setInviteModal(true);
}}
>

View File

@ -10,7 +10,7 @@ import { Avatar, Button, CustomSelect, CustomSearchSelect, TOAST_TYPE, setToast
// helpers
import { useEventTracker, useMember, useUser } from "hooks/store";
import { EUserProjectRoles } from "constants/project";
import { PROJECT_MEMBER_ADDED } from "constants/event-tracker";
import { E_PROJECT_MEMBERS, PROJECT_MEMBER_ADDED } from "constants/event-tracker";
import { ROLE } from "constants/workspace";
// constants
@ -89,14 +89,14 @@ export const SendProjectInvitationModal: React.FC<Props> = observer((props) => {
member_id: payload.members?.[0]?.member_id,
role: ROLE[payload.members?.[0]?.role],
state: "SUCCESS",
element: "Project settings members page",
element: E_PROJECT_MEMBERS,
});
})
.catch((error) => {
console.error(error);
captureEvent(PROJECT_MEMBER_ADDED, {
state: "FAILED",
element: "Project settings members page",
element: E_PROJECT_MEMBERS,
});
})
.finally(() => {

View File

@ -7,6 +7,7 @@ import { ContrastIcon, DiceIcon, PhotoFilterIcon, ToggleSwitch, setPromiseToast
import { useEventTracker, useProject, useUser } from "hooks/store";
// types
import { IProject } from "@plane/types";
import { E_FEATURES } from "constants/event-tracker";
type Props = {
workspaceSlug: string;
@ -93,7 +94,7 @@ export const ProjectFeaturesList: FC<Props> = observer((props) => {
onChange={() => {
captureEvent(`Toggle ${feature.title.toLowerCase()}`, {
enabled: !currentProjectDetails?.[feature.property as keyof IProject],
element: "Project settings feature page",
element: E_FEATURES,
});
handleSubmit({
[feature.property]: !currentProjectDetails?.[feature.property as keyof IProject],

View File

@ -37,6 +37,8 @@ import { getNumberCount } from "helpers/string.helper";
import { useApplication, useEventTracker, useInbox, useProject } from "hooks/store";
import useOutsideClickDetector from "hooks/use-outside-click-detector";
import { usePlatformOS } from "hooks/use-platform-os";
// constants
import { E_SIDEBAR } from "constants/event-tracker";
// helpers
// components
@ -151,7 +153,7 @@ export const ProjectSidebarListItem: React.FC<Props> = observer((props) => {
};
const handleLeaveProject = () => {
setTrackElement("APP_SIDEBAR_PROJECT_DROPDOWN");
setTrackElement(E_SIDEBAR);
setLeaveProjectModal(true);
};

View File

@ -15,8 +15,9 @@ import { useApplication, useEventTracker, useProject, useUser } from "hooks/stor
// ui
// components
// helpers
// constants
import { IProject } from "@plane/types";
// constants
import { E_SIDEBAR } from "constants/event-tracker";
export const ProjectSidebarList: FC = observer(() => {
// states
@ -151,7 +152,7 @@ export const ProjectSidebarList: FC = observer(() => {
<button
className="opacity-0 group-hover:opacity-100"
onClick={() => {
setTrackElement("Sidebar");
setTrackElement(E_SIDEBAR);
setIsFavoriteProjectCreate(true);
setIsProjectModalOpen(true);
}}
@ -230,7 +231,7 @@ export const ProjectSidebarList: FC = observer(() => {
<button
className="opacity-0 group-hover:opacity-100"
onClick={() => {
setTrackElement("Sidebar");
setTrackElement(E_SIDEBAR);
setIsFavoriteProjectCreate(false);
setIsProjectModalOpen(true);
}}
@ -281,7 +282,7 @@ export const ProjectSidebarList: FC = observer(() => {
type="button"
className="flex w-full items-center gap-2 px-3 text-sm text-custom-sidebar-text-200"
onClick={() => {
setTrackElement("Sidebar");
setTrackElement(E_SIDEBAR);
toggleCreateProjectModal(true);
}}
>

View File

@ -7,7 +7,7 @@ import { Popover, Transition } from "@headlessui/react";
// ui
import { Button, CustomSelect, Input, Tooltip, TOAST_TYPE, setToast } from "@plane/ui";
// constants
import { STATE_CREATED, STATE_UPDATED } from "constants/event-tracker";
import { E_STATES, STATE_CREATED, STATE_UPDATED } from "constants/event-tracker";
import { GROUP_CHOICES } from "constants/project";
// hooks
import { useEventTracker, useProjectState } from "hooks/store";
@ -91,7 +91,7 @@ export const CreateUpdateStateInline: React.FC<Props> = observer((props) => {
payload: {
...res,
state: "SUCCESS",
element: "Project settings states page",
element: E_STATES,
},
});
})
@ -114,7 +114,7 @@ export const CreateUpdateStateInline: React.FC<Props> = observer((props) => {
payload: {
...formData,
state: "FAILED",
element: "Project settings states page",
element: E_STATES,
},
});
});
@ -132,7 +132,7 @@ export const CreateUpdateStateInline: React.FC<Props> = observer((props) => {
...res,
change_details: Object.keys(dirtyFields),
state: "SUCCESS",
element: "Project settings states page",
element: E_STATES,
},
});
setToast({
@ -159,7 +159,7 @@ export const CreateUpdateStateInline: React.FC<Props> = observer((props) => {
payload: {
...formData,
state: "FAILED",
element: "Project settings states page",
element: E_STATES,
},
});
});
@ -291,7 +291,7 @@ export const CreateUpdateStateInline: React.FC<Props> = observer((props) => {
type="submit"
loading={isSubmitting}
onClick={() => {
setTrackElement("PROJECT_SETTINGS_STATE_PAGE");
setTrackElement(E_STATES);
}}
size="sm"
>

View File

@ -12,6 +12,8 @@ import { addSpaceIfCamelCase } from "helpers/string.helper";
import { useEventTracker, useProjectState } from "hooks/store";
// types
import { IState } from "@plane/types";
// constants
import { E_STATES } from "constants/event-tracker";
type Props = {
index: number;
@ -105,7 +107,7 @@ export const StatesListItem: React.FC<Props> = observer((props) => {
state.default || groupLength === 1 ? "cursor-not-allowed" : ""
} grid place-items-center`}
onClick={() => {
setTrackElement("Project settings states page");
setTrackElement(E_STATES);
handleDeleteState();
}}
disabled={state.default || groupLength === 1}

View File

@ -55,7 +55,7 @@ export const ProjectSettingStateList: React.FC = observer(() => {
type="button"
className="flex items-center gap-2 px-2 text-custom-primary-100 outline-none hover:text-custom-primary-200"
onClick={() => {
setTrackElement("PROJECT_SETTINGS_STATES_PAGE");
PROJECT_SETTINGS_STATES_PAGE");
setActiveGroup(group as keyof StateGroup);
}}
>

View File

@ -9,7 +9,7 @@ import { Button, TOAST_TYPE, setToast } from "@plane/ui";
import { useEventTracker, useProjectView } from "hooks/store";
// types
import { IProjectView } from "@plane/types";
import { VIEW_DELETED } from "constants/event-tracker";
import { E_VIEWS, VIEW_DELETED } from "constants/event-tracker";
type Props = {
data: IProjectView;
@ -43,7 +43,7 @@ export const DeleteProjectViewModal: React.FC<Props> = observer((props) => {
handleClose();
captureEvent(VIEW_DELETED, {
view_id: data.id,
element: "Views page",
element: E_VIEWS,
state: "SUCCESS",
});
setToast({
@ -55,7 +55,7 @@ export const DeleteProjectViewModal: React.FC<Props> = observer((props) => {
.catch(() => {
captureEvent(VIEW_DELETED, {
view_id: data.id,
element: "Views page",
element: E_VIEWS,
state: "FAILED",
});
setToast({

View File

@ -11,7 +11,7 @@ import { useEventTracker, useProjectView } from "hooks/store";
// types
import { IProjectView } from "@plane/types";
// constants
import { VIEW_CREATED, VIEW_UPDATED, elementFromPath } from "constants/event-tracker";
import { E_VIEWS, VIEW_CREATED, VIEW_UPDATED, elementFromPath } from "constants/event-tracker";
type Props = {
data?: IProjectView | null;
@ -70,7 +70,7 @@ export const CreateUpdateProjectViewModal: FC<Props> = observer((props) => {
captureEvent(VIEW_UPDATED, {
view_id: res.id,
filters: res.filters,
element: "Views page",
element: E_VIEWS,
state: "SUCCESS",
});
handleClose();
@ -78,7 +78,7 @@ export const CreateUpdateProjectViewModal: FC<Props> = observer((props) => {
.catch((err) => {
captureEvent(VIEW_UPDATED, {
view_id: data?.id,
element: "Views page",
element: E_VIEWS,
state: "FAILED",
});
setToast({

View File

@ -17,7 +17,7 @@ import { useEventTracker, useProjectView, useUser } from "hooks/store";
// types
import { IProjectView } from "@plane/types";
// constants
import { VIEW_FAVORITED, VIEW_UNFAVORITED } from "constants/event-tracker";
import { E_VIEWS, VIEW_FAVORITED, VIEW_UNFAVORITED } from "constants/event-tracker";
type Props = {
view: IProjectView;
@ -44,7 +44,7 @@ export const ProjectViewListItem: React.FC<Props> = observer((props) => {
addViewToFavorites(workspaceSlug.toString(), projectId.toString(), view.id).then(() => {
captureEvent(VIEW_FAVORITED, {
view_id: view.id,
element: "Views page",
element: E_VIEWS,
state: "SUCCESS",
});
});
@ -56,7 +56,7 @@ export const ProjectViewListItem: React.FC<Props> = observer((props) => {
removeViewFromFavorites(workspaceSlug.toString(), projectId.toString(), view.id).then(() => {
captureEvent(VIEW_UNFAVORITED, {
view_id: view.id,
element: "Views page",
element: E_VIEWS,
state: "SUCCESS",
});
});

View File

@ -11,6 +11,7 @@ import { ProjectViewListItem } from "components/views";
import { Input } from "@plane/ui";
// constants
import { EmptyStateType } from "constants/empty-state";
import { E_VIEWS_EMPTY_STATE } from "constants/event-tracker";
export const ProjectViewsList = observer(() => {
// states
@ -56,7 +57,7 @@ export const ProjectViewsList = observer(() => {
<EmptyState
type={EmptyStateType.PROJECT_VIEW}
primaryButtonOnClick={() => {
setTrackElement("Views empty state");
setTrackElement(E_VIEWS_EMPTY_STATE);
toggleCreateViewModal(true);
}}
/>

View File

@ -5,7 +5,7 @@ import { Controller, useForm } from "react-hook-form";
// ui
import { Button, CustomSelect, Input, TOAST_TYPE, setToast } from "@plane/ui";
// constants
import { WORKSPACE_CREATED } from "constants/event-tracker";
import { E_CREATE_WORKSPACE, WORKSPACE_CREATED } from "constants/event-tracker";
import { ORGANIZATION_SIZE, RESTRICTED_URLS } from "constants/workspace";
// hooks
import { useEventTracker, useWorkspace } from "hooks/store";
@ -73,7 +73,7 @@ export const CreateWorkspaceForm: FC<Props> = observer((props) => {
payload: {
...res,
state: "SUCCESS",
element: "Create workspace page",
element: E_CREATE_WORKSPACE,
},
});
setToast({
@ -89,7 +89,7 @@ export const CreateWorkspaceForm: FC<Props> = observer((props) => {
eventName: WORKSPACE_CREATED,
payload: {
state: "FAILED",
element: "Create workspace page",
element: E_CREATE_WORKSPACE,
},
});
setToast({

View File

@ -7,7 +7,7 @@ import { AlertTriangle } from "lucide-react";
// ui
import { Button, Input, TOAST_TYPE, setToast } from "@plane/ui";
// constants
import { WORKSPACE_DELETED } from "constants/event-tracker";
import { E_WORKSPACE_GENERAL, WORKSPACE_DELETED } from "constants/event-tracker";
// hooks
import { useEventTracker, useWorkspace } from "hooks/store";
// types
@ -63,7 +63,7 @@ export const DeleteWorkspaceModal: React.FC<Props> = observer((props) => {
payload: {
...data,
state: "SUCCESS",
element: "Workspace general settings page",
element: E_WORKSPACE_GENERAL,
},
});
setToast({
@ -83,7 +83,7 @@ export const DeleteWorkspaceModal: React.FC<Props> = observer((props) => {
payload: {
...data,
state: "FAILED",
element: "Workspace general settings page",
element: E_WORKSPACE_GENERAL,
},
});
});

View File

@ -11,7 +11,7 @@ import { ConfirmWorkspaceMemberRemove } from "components/workspace";
// helpers
import { getUserRole } from "helpers/user.helper";
// constants
import { WM_ROLE_CHANGED, WORKSPACE_MEMBER_REMOVED, WORKSPACE_MEMBER_LEFT } from "constants/event-tracker";
import { WM_ROLE_CHANGED, WORKSPACE_MEMBER_REMOVED, WORKSPACE_MEMBER_LEFT, E_WORKSPACE_MEMBERS } from "constants/event-tracker";
import { EUserWorkspaceRoles, ROLE } from "constants/workspace";
// hooks
import { useEventTracker, useMember, useUser } from "hooks/store";
@ -51,7 +51,7 @@ export const WorkspaceMembersListItem: FC<Props> = observer((props) => {
member_id: currentUser?.id,
role: currentWorkspaceRole ? getUserRole(currentWorkspaceRole as number) : undefined,
state: "SUCCESS",
element: "Workspace settings members page",
element: E_WORKSPACE_MEMBERS,
});
router.push("/profile");
})
@ -74,7 +74,7 @@ export const WorkspaceMembersListItem: FC<Props> = observer((props) => {
removed_by_role: currentWorkspaceRole ? getUserRole(currentWorkspaceRole as number) : undefined,
role: memberDetails.role ? getUserRole(memberDetails.role as number) : undefined,
state: "SUCCESS",
element: "Workspace settings members page",
element: E_WORKSPACE_MEMBERS,
})
)
.catch((err) =>
@ -184,7 +184,7 @@ export const WorkspaceMembersListItem: FC<Props> = observer((props) => {
member_id: memberDetails.member.id,
changed_role: value ? getUserRole(value as number) : undefined,
state: "SUCCESS",
element: "Workspace settings members page",
element: E_WORKSPACE_MEMBERS,
})
)
.catch(() => {

View File

@ -9,7 +9,7 @@ import { Button, CustomSelect, Input, Spinner, TOAST_TYPE, setToast } from "@pla
import { WorkspaceImageUploadModal } from "components/core";
import { DeleteWorkspaceModal } from "components/workspace";
// constants
import { WORKSPACE_UPDATED } from "constants/event-tracker";
import { E_WORKSPACE_GENERAL, WORKSPACE_UPDATED } from "constants/event-tracker";
import { EUserWorkspaceRoles, ORGANIZATION_SIZE } from "constants/workspace";
// helpers
import { copyUrlToClipboard } from "helpers/string.helper";
@ -72,7 +72,7 @@ export const WorkspaceDetails: FC = observer(() => {
...res,
change_details: Object.keys(dirtyFields),
state: "SUCCESS",
element: "Workspace general settings page",
element: E_WORKSPACE_GENERAL,
},
});
setToast({
@ -86,7 +86,7 @@ export const WorkspaceDetails: FC = observer(() => {
eventName: WORKSPACE_UPDATED,
payload: {
state: "FAILED",
element: "Workspace general settings page",
element: E_WORKSPACE_GENERAL,
},
});
console.error(err);

View File

@ -11,6 +11,8 @@ import { useApplication, useEventTracker, useProject, useUser } from "hooks/stor
import useLocalStorage from "hooks/use-local-storage";
// types
import { TIssue } from "@plane/types";
// constants
import { E_SIDEBAR } from "constants/event-tracker";
export const WorkspaceSidebarQuickAction = observer(() => {
// states
@ -93,7 +95,7 @@ export const WorkspaceSidebarQuickAction = observer(() => {
isSidebarCollapsed ? "justify-center" : ""
} ${disabled ? "cursor-not-allowed opacity-50" : ""}`}
onClick={() => {
setTrackElement("APP_SIDEBAR_QUICK_ACTIONS");
setTrackElement(E_SIDEBAR);
commandPaletteStore.toggleCreateIssueModal(true, EIssuesStoreType.PROJECT);
}}
disabled={disabled}

View File

@ -13,6 +13,8 @@ import { calculateTotalFilters } from "helpers/filter.helper";
import { truncateText } from "helpers/string.helper";
// store hooks
import { useEventTracker, useGlobalView } from "hooks/store";
// constants
import { E_LIST_LAYOUT } from "constants/event-tracker";
type Props = { viewId: string };
@ -58,7 +60,7 @@ export const GlobalViewListItem: React.FC<Props> = observer((props) => {
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
setTrackElement("List view");
setTrackElement(E_LIST_LAYOUT);
setUpdateViewModal(true);
}}
>

View File

@ -335,5 +335,79 @@ export const SNOOZED_NOTIFICATIONS = "Snoozed notifications viewed";
export const ARCHIVED_NOTIFICATIONS = "Archived notifications viewed";
// Groups
export const GROUP_WORKSPACE = "Workspace_metrics";
// Elements
export const E_PROJECT_PAGES = "Project pages page";
// Cycle Elements
export const E_CYCLES = "Cycles page";
export const E_CYCLES_LIST_LAYOUT = "Cycles page list layout";
export const E_CYCLES_GRID_LAYOUT = "Cycles page grid layout";
export const E_CYCLE_SIDEBAR = "Cycle sidebar";
export const E_CYCLE_ISSUES = "Cycle issues page";
export const E_CYCLES_EMPTY_STATE = "Cycles empty state";
export const E_CYCLE_ISSUES_EMPTY_STATE = "Cycle issues empty state";
// Module Elements
export const E_MODULES_LIST_LAYOUT = "Modules page list layout";
export const E_MODULES_GRID_LAYOUT = "Modules page grid layout";
export const E_MODULES = "Modules page";
export const E_MODULE_SIDEBAR = "Module sidebar";
export const E_MODULE_ISSUES = "Module issues page";
export const E_MODULES_EMPTY_STATE = "Modules empty state";
export const E_MODULES_ISSUES_EMPTY_STATE = "Module issues empty state";
// Project Elements
export const E_PROJECTS = "Projects page";
export const E_PROJECT_EMPTY_STATE = "Project empty state";
export const E_PROJECT_ISSUES_EMPTY_STATE = "Project issues empty state";
export const E_PROJECT_ISSUES = "Project issues page";
// Project Page Elements
export const E_PAGES = "Project pages page";
export const E_PAGE_DETAILS = "Project page details";
export const E_PAGES_EMPTY_STATE = "Pages empty state";
// Project Views Elements
export const E_VIEWS = "Project views page";
export const E_VIEWS_EMPTY_STATE = "Views empty state";
export const E_VIEW_ISSUES_EMPTY_STATE = "View issues empty state";
// Dashboard Elements
export const E_DASHBOARD = "Dashboard";
export const E_DASHBOARD_EMPTY_STATE = "Dashboard empty state";
// Global Issues Elements
export const E_GLOBAL_ISSUES_EMPTY_STATE = "Global issues empty state";
export const E_GLOBAL_ISSUES = "Global issues page";
// Issue Details Elements
export const E_ISSUE_DETAILS = "Issue details page";
// Layout Elements
export const E_LIST_LAYOUT = "List layout";
export const E_KANBAN_LAYOUT = "Kanban layout";
export const E_GRID_LAYOUT = "Grid layout";
export const E_SPREADSHEET_LAYOUT = "Spreadsheet layout";
// Project Settings Elements
export const E_PROJECT_GENERAL = "Project settings general page";
export const E_PROJECT_MEMBERS = "Project settings members page";
export const E_LABELS = "Project settings labels page";
export const E_STATES = "Project settings states page";
export const E_FEATURES = "Project settings features page";
// Analytics Elements
export const E_ANALYTICS_EMPTY_STATE = "Analytics empty state";
// Onboarding Elements
export const E_ONBOARDING = "Onboarding";
export const E_PRODUCT_TOUR = "Product tour";
// Workspace Settings Elements
export const E_WORKSPACE_GENERAL = "Workspace settings general page";
export const E_WORKSPACE_MEMBERS = "Workspace settings members page";
export const E_WORKSPACE_INVITATION = "Workspace invitations page";
export const E_CREATE_WORKSPACE = "Create workspace page";
export const E_JIRA_IMPORT = "Jira import detail page";
// Inbox Elements
export const E_INBOX = "Inbox page";
// Notifications Elements
export const E_Notifications = "Notifications";
// Core Elements
export const E_SIDEBAR = "Sidebar";
export const E_ISSUE_PEEK_VIEW = "Issue peek view";
export const E_COMMAND_PALETTE = "Command palette";
export const E_SHORTCUT_KEY = "Shortcut key";
// Quick Add Elements
export const E_KANBAN_QUICK_ADD = "Kanban quick add";
export const E_LIST_QUICK_ADD = "List quick add";
export const E_CALENDAR_QUICK_ADD = "Calendar quick add";
export const E_SPREADSHEET_QUICK_ADD = "Spreadsheet quick add";
export const E_Gantt_QUICK_ADD = "Gantt quick add";

View File

@ -23,6 +23,8 @@ import {
} from "hooks/store";
// images
import emptyProject from "public/empty-state/project.svg";
// constants
import { E_PAGES_EMPTY_STATE } from "constants/event-tracker";
interface IProjectAuthWrapper {
children: ReactNode;
@ -145,7 +147,7 @@ export const ProjectAuthWrapper: FC<IProjectAuthWrapper> = observer((props) => {
primaryButton={{
text: "Create Project",
onClick: () => {
setTrackElement("Projects page empty state");
setTrackElement(E_PAGES_EMPTY_STATE);
toggleCreateProjectModal(true);
},
}}

View File

@ -16,6 +16,7 @@ import { NextPageWithLayout } from "lib/types";
// constants
import { ANALYTICS_TABS } from "constants/analytics";
import { EmptyStateType } from "constants/empty-state";
import { E_ANALYTICS_EMPTY_STATE } from "constants/event-tracker";
const AnalyticsPage: NextPageWithLayout = observer(() => {
const router = useRouter();
@ -70,7 +71,7 @@ const AnalyticsPage: NextPageWithLayout = observer(() => {
<EmptyState
type={EmptyStateType.WORKSPACE_ANALYTICS}
primaryButtonOnClick={() => {
setTrackElement("Analytics empty state");
setTrackElement(E_ANALYTICS_EMPTY_STATE);
toggleCreateProjectModal(true);
}}
/>

View File

@ -27,6 +27,7 @@ import { TCycleFilters } from "@plane/types";
// constants
import { CYCLE_TABS_LIST } from "constants/cycle";
import { EmptyStateType } from "constants/empty-state";
import { E_CYCLES_EMPTY_STATE } from "constants/event-tracker";
const ProjectCyclesPage: NextPageWithLayout = observer(() => {
// states
@ -85,7 +86,7 @@ const ProjectCyclesPage: NextPageWithLayout = observer(() => {
<EmptyState
type={EmptyStateType.PROJECT_CYCLES}
primaryButtonOnClick={() => {
setTrackElement("Cycle empty state");
setTrackElement(E_CYCLES_EMPTY_STATE);
setCreateModal(true);
}}
/>

View File

@ -32,6 +32,7 @@ import {
AI_RES_REGENERATED,
AI_RES_USED,
AI_TRIGGERED,
E_PAGE_DETAILS,
PAGE_ARCHIVED,
PAGE_DUPLICATED,
PAGE_LOCKED,
@ -144,7 +145,7 @@ const PageDetailsPage: NextPageWithLayout = observer(() => {
editorRef.current?.setEditorValueAtCursorPosition(response);
captureEvent(AI_RES_USED, {
page_id: pageId,
element: "Pages detail page",
element: E_PAGE_DETAILS,
question: question,
answer: response,
});
@ -195,7 +196,7 @@ const PageDetailsPage: NextPageWithLayout = observer(() => {
captureEvent(PAGE_DUPLICATED, {
page_id: pageId,
access: access == 1 ? "private" : "public",
element: "Pages detail page",
element: E_PAGE_DETAILS,
state: "SUCCESS",
})
);
@ -215,7 +216,7 @@ const PageDetailsPage: NextPageWithLayout = observer(() => {
captureEvent(PAGE_ARCHIVED, {
page_id: pageId,
access: access == 1 ? "private" : "public",
element: "Pages detail page",
element: E_PAGE_DETAILS,
state: "SUCCESS",
})
);
@ -235,7 +236,7 @@ const PageDetailsPage: NextPageWithLayout = observer(() => {
captureEvent(PAGE_RESTORED, {
page_id: pageId,
access: access == 1 ? "private" : "public",
element: "Pages detail page",
element: E_PAGE_DETAILS,
state: "SUCCESS",
})
);
@ -255,7 +256,7 @@ const PageDetailsPage: NextPageWithLayout = observer(() => {
captureEvent(PAGE_LOCKED, {
page_id: pageId,
access: access == 1 ? "private" : "public",
element: "Pages detail page",
element: E_PAGE_DETAILS,
state: "SUCCESS",
})
);
@ -275,7 +276,7 @@ const PageDetailsPage: NextPageWithLayout = observer(() => {
captureEvent(PAGE_UNLOCKED, {
page_id: pageId,
access: access == 1 ? "private" : "public",
element: "Pages detail page",
element: E_PAGE_DETAILS,
state: "SUCCESS",
})
);
@ -392,14 +393,14 @@ const PageDetailsPage: NextPageWithLayout = observer(() => {
onGenerateResponse={(question) =>
captureEvent(AI_TRIGGERED, {
page_id: pageId,
element: "Pages detail page",
element: E_PAGE_DETAILS,
question: question,
})
}
onReGenerateResponse={(question, response) =>
captureEvent(AI_RES_REGENERATED, {
page_id: pageId,
element: "Pages detail page",
element: E_PAGE_DETAILS,
question: question,
prev_answer: response,
})

View File

@ -23,6 +23,7 @@ import { NextPageWithLayout } from "lib/types";
// constants
import { PAGE_TABS_LIST } from "constants/page";
import { EmptyStateType } from "constants/empty-state";
import { E_PAGES_EMPTY_STATE } from "constants/event-tracker";
const AllPagesList = dynamic<any>(() => import("components/pages").then((a) => a.AllPagesList), {
ssr: false,
@ -207,7 +208,7 @@ const ProjectPagesPage: NextPageWithLayout = observer(() => {
<EmptyState
type={EmptyStateType.PROJECT_PAGE}
primaryButtonOnClick={() => {
setTrackElement("Pages empty state");
setTrackElement(E_PAGES_EMPTY_STATE);
toggleCreatePageModal(true);
}}
/>

View File

@ -7,7 +7,7 @@ import { Button, TOAST_TYPE, setToast } from "@plane/ui";
import { PageHead } from "components/core";
import { WorkspaceSettingHeader } from "components/headers";
import { SendWorkspaceInvitationModal, WorkspaceMembersList } from "components/workspace";
import { MEMBER_INVITED } from "constants/event-tracker";
import { E_WORKSPACE_MEMBERS, MEMBER_INVITED } from "constants/event-tracker";
import { EUserWorkspaceRoles } from "constants/workspace";
import { getUserRole } from "helpers/user.helper";
import { useApplication, useEventTracker, useMember, useUser, useWorkspace } from "hooks/store";
@ -59,7 +59,7 @@ const WorkspaceMembersSettingsPage: NextPageWithLayout = observer(() => {
emails: !instance?.is_telemetry_anonymous ? emailsEventPayload : undefined,
project_id: undefined,
state: "SUCCESS",
element: "Workspace settings member page",
element: E_WORKSPACE_MEMBERS,
});
setToast({
type: TOAST_TYPE.SUCCESS,
@ -72,7 +72,7 @@ const WorkspaceMembersSettingsPage: NextPageWithLayout = observer(() => {
emails: !instance?.is_telemetry_anonymous ? emailsEventPayload : undefined,
project_id: undefined,
state: "FAILED",
element: "Workspace settings member page",
element: E_WORKSPACE_MEMBERS,
});
setToast({
type: TOAST_TYPE.ERROR,

View File

@ -28,7 +28,7 @@ import { NextPageWithLayout } from "lib/types";
import type { IWorkspaceMemberInvitation } from "@plane/types";
// constants
import { ROLE } from "constants/workspace";
import { MEMBER_ACCEPTED } from "constants/event-tracker";
import { E_WORKSPACE_INVITATION, MEMBER_ACCEPTED } from "constants/event-tracker";
// components
import { EmptyState } from "components/common";
import { PageHead } from "components/core";
@ -89,7 +89,7 @@ const UserInvitationsPage: NextPageWithLayout = observer(() => {
project_id: undefined,
accepted_from: "App",
state: "SUCCESS",
element: "Workspace invitations page",
element: E_WORKSPACE_INVITATION,
});
userService
.updateUser({ last_workspace_id: redirectWorkspace?.id })
@ -111,7 +111,7 @@ const UserInvitationsPage: NextPageWithLayout = observer(() => {
project_id: undefined,
accepted_from: "App",
state: "FAILED",
element: "Workspace invitations page",
element: E_WORKSPACE_INVITATION,
});
setToast({
type: TOAST_TYPE.ERROR,