mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
Merge branch 'develop' of gurusainath:makeplane/plane into feat/mobx-global-views
This commit is contained in:
commit
6325f97c8e
@ -242,13 +242,13 @@ class CycleViewSet(WebhookMixin, BaseViewSet):
|
|||||||
.values("display_name", "assignee_id", "avatar")
|
.values("display_name", "assignee_id", "avatar")
|
||||||
.annotate(
|
.annotate(
|
||||||
total_issues=Count(
|
total_issues=Count(
|
||||||
"assignee_id",
|
"id",
|
||||||
filter=Q(archived_at__isnull=True, is_draft=False),
|
filter=Q(archived_at__isnull=True, is_draft=False),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.annotate(
|
.annotate(
|
||||||
completed_issues=Count(
|
completed_issues=Count(
|
||||||
"assignee_id",
|
"id",
|
||||||
filter=Q(
|
filter=Q(
|
||||||
completed_at__isnull=False,
|
completed_at__isnull=False,
|
||||||
archived_at__isnull=True,
|
archived_at__isnull=True,
|
||||||
@ -258,7 +258,7 @@ class CycleViewSet(WebhookMixin, BaseViewSet):
|
|||||||
)
|
)
|
||||||
.annotate(
|
.annotate(
|
||||||
pending_issues=Count(
|
pending_issues=Count(
|
||||||
"assignee_id",
|
"id",
|
||||||
filter=Q(
|
filter=Q(
|
||||||
completed_at__isnull=True,
|
completed_at__isnull=True,
|
||||||
archived_at__isnull=True,
|
archived_at__isnull=True,
|
||||||
@ -281,13 +281,13 @@ class CycleViewSet(WebhookMixin, BaseViewSet):
|
|||||||
.values("label_name", "color", "label_id")
|
.values("label_name", "color", "label_id")
|
||||||
.annotate(
|
.annotate(
|
||||||
total_issues=Count(
|
total_issues=Count(
|
||||||
"label_id",
|
"id",
|
||||||
filter=Q(archived_at__isnull=True, is_draft=False),
|
filter=Q(archived_at__isnull=True, is_draft=False),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.annotate(
|
.annotate(
|
||||||
completed_issues=Count(
|
completed_issues=Count(
|
||||||
"label_id",
|
"id",
|
||||||
filter=Q(
|
filter=Q(
|
||||||
completed_at__isnull=False,
|
completed_at__isnull=False,
|
||||||
archived_at__isnull=True,
|
archived_at__isnull=True,
|
||||||
@ -297,7 +297,7 @@ class CycleViewSet(WebhookMixin, BaseViewSet):
|
|||||||
)
|
)
|
||||||
.annotate(
|
.annotate(
|
||||||
pending_issues=Count(
|
pending_issues=Count(
|
||||||
"label_id",
|
"id",
|
||||||
filter=Q(
|
filter=Q(
|
||||||
completed_at__isnull=True,
|
completed_at__isnull=True,
|
||||||
archived_at__isnull=True,
|
archived_at__isnull=True,
|
||||||
@ -419,13 +419,13 @@ class CycleViewSet(WebhookMixin, BaseViewSet):
|
|||||||
)
|
)
|
||||||
.annotate(
|
.annotate(
|
||||||
total_issues=Count(
|
total_issues=Count(
|
||||||
"assignee_id",
|
"id",
|
||||||
filter=Q(archived_at__isnull=True, is_draft=False),
|
filter=Q(archived_at__isnull=True, is_draft=False),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.annotate(
|
.annotate(
|
||||||
completed_issues=Count(
|
completed_issues=Count(
|
||||||
"assignee_id",
|
"id",
|
||||||
filter=Q(
|
filter=Q(
|
||||||
completed_at__isnull=False,
|
completed_at__isnull=False,
|
||||||
archived_at__isnull=True,
|
archived_at__isnull=True,
|
||||||
@ -435,7 +435,7 @@ class CycleViewSet(WebhookMixin, BaseViewSet):
|
|||||||
)
|
)
|
||||||
.annotate(
|
.annotate(
|
||||||
pending_issues=Count(
|
pending_issues=Count(
|
||||||
"assignee_id",
|
"id",
|
||||||
filter=Q(
|
filter=Q(
|
||||||
completed_at__isnull=True,
|
completed_at__isnull=True,
|
||||||
archived_at__isnull=True,
|
archived_at__isnull=True,
|
||||||
@ -459,13 +459,13 @@ class CycleViewSet(WebhookMixin, BaseViewSet):
|
|||||||
.values("label_name", "color", "label_id")
|
.values("label_name", "color", "label_id")
|
||||||
.annotate(
|
.annotate(
|
||||||
total_issues=Count(
|
total_issues=Count(
|
||||||
"label_id",
|
"id",
|
||||||
filter=Q(archived_at__isnull=True, is_draft=False),
|
filter=Q(archived_at__isnull=True, is_draft=False),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.annotate(
|
.annotate(
|
||||||
completed_issues=Count(
|
completed_issues=Count(
|
||||||
"label_id",
|
"id",
|
||||||
filter=Q(
|
filter=Q(
|
||||||
completed_at__isnull=False,
|
completed_at__isnull=False,
|
||||||
archived_at__isnull=True,
|
archived_at__isnull=True,
|
||||||
@ -475,7 +475,7 @@ class CycleViewSet(WebhookMixin, BaseViewSet):
|
|||||||
)
|
)
|
||||||
.annotate(
|
.annotate(
|
||||||
pending_issues=Count(
|
pending_issues=Count(
|
||||||
"label_id",
|
"id",
|
||||||
filter=Q(
|
filter=Q(
|
||||||
completed_at__isnull=True,
|
completed_at__isnull=True,
|
||||||
archived_at__isnull=True,
|
archived_at__isnull=True,
|
||||||
|
@ -197,7 +197,7 @@ class ModuleViewSet(WebhookMixin, BaseViewSet):
|
|||||||
)
|
)
|
||||||
.annotate(
|
.annotate(
|
||||||
total_issues=Count(
|
total_issues=Count(
|
||||||
"assignee_id",
|
"id",
|
||||||
filter=Q(
|
filter=Q(
|
||||||
archived_at__isnull=True,
|
archived_at__isnull=True,
|
||||||
is_draft=False,
|
is_draft=False,
|
||||||
@ -206,7 +206,7 @@ class ModuleViewSet(WebhookMixin, BaseViewSet):
|
|||||||
)
|
)
|
||||||
.annotate(
|
.annotate(
|
||||||
completed_issues=Count(
|
completed_issues=Count(
|
||||||
"assignee_id",
|
"id",
|
||||||
filter=Q(
|
filter=Q(
|
||||||
completed_at__isnull=False,
|
completed_at__isnull=False,
|
||||||
archived_at__isnull=True,
|
archived_at__isnull=True,
|
||||||
@ -216,7 +216,7 @@ class ModuleViewSet(WebhookMixin, BaseViewSet):
|
|||||||
)
|
)
|
||||||
.annotate(
|
.annotate(
|
||||||
pending_issues=Count(
|
pending_issues=Count(
|
||||||
"assignee_id",
|
"id",
|
||||||
filter=Q(
|
filter=Q(
|
||||||
completed_at__isnull=True,
|
completed_at__isnull=True,
|
||||||
archived_at__isnull=True,
|
archived_at__isnull=True,
|
||||||
@ -239,7 +239,7 @@ class ModuleViewSet(WebhookMixin, BaseViewSet):
|
|||||||
.values("label_name", "color", "label_id")
|
.values("label_name", "color", "label_id")
|
||||||
.annotate(
|
.annotate(
|
||||||
total_issues=Count(
|
total_issues=Count(
|
||||||
"label_id",
|
"id",
|
||||||
filter=Q(
|
filter=Q(
|
||||||
archived_at__isnull=True,
|
archived_at__isnull=True,
|
||||||
is_draft=False,
|
is_draft=False,
|
||||||
@ -248,7 +248,7 @@ class ModuleViewSet(WebhookMixin, BaseViewSet):
|
|||||||
)
|
)
|
||||||
.annotate(
|
.annotate(
|
||||||
completed_issues=Count(
|
completed_issues=Count(
|
||||||
"label_id",
|
"id",
|
||||||
filter=Q(
|
filter=Q(
|
||||||
completed_at__isnull=False,
|
completed_at__isnull=False,
|
||||||
archived_at__isnull=True,
|
archived_at__isnull=True,
|
||||||
@ -258,7 +258,7 @@ class ModuleViewSet(WebhookMixin, BaseViewSet):
|
|||||||
)
|
)
|
||||||
.annotate(
|
.annotate(
|
||||||
pending_issues=Count(
|
pending_issues=Count(
|
||||||
"label_id",
|
"id",
|
||||||
filter=Q(
|
filter=Q(
|
||||||
completed_at__isnull=True,
|
completed_at__isnull=True,
|
||||||
archived_at__isnull=True,
|
archived_at__isnull=True,
|
||||||
|
@ -47,7 +47,6 @@ export const PriorityIcon: React.FC<IPriorityIcon> = (props) => {
|
|||||||
>
|
>
|
||||||
<Icon
|
<Icon
|
||||||
size={size}
|
size={size}
|
||||||
viewBox="0 0 23.5 24"
|
|
||||||
className={cn(
|
className={cn(
|
||||||
{
|
{
|
||||||
"text-white": priority === "urgent",
|
"text-white": priority === "urgent",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Command } from "cmdk";
|
import { Command } from "cmdk";
|
||||||
import { ContrastIcon, FileText } from "lucide-react";
|
import { ContrastIcon, FileText } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication } from "hooks/store";
|
import { useApplication, useEventTracker } from "hooks/store";
|
||||||
// ui
|
// ui
|
||||||
import { DiceIcon, PhotoFilterIcon } from "@plane/ui";
|
import { DiceIcon, PhotoFilterIcon } from "@plane/ui";
|
||||||
|
|
||||||
@ -14,8 +14,8 @@ export const CommandPaletteProjectActions: React.FC<Props> = (props) => {
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
commandPalette: { toggleCreateCycleModal, toggleCreateModuleModal, toggleCreatePageModal, toggleCreateViewModal },
|
commandPalette: { toggleCreateCycleModal, toggleCreateModuleModal, toggleCreatePageModal, toggleCreateViewModal },
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
} = useApplication();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -23,7 +23,7 @@ export const CommandPaletteProjectActions: React.FC<Props> = (props) => {
|
|||||||
<Command.Item
|
<Command.Item
|
||||||
onSelect={() => {
|
onSelect={() => {
|
||||||
closePalette();
|
closePalette();
|
||||||
setTrackElement("COMMAND_PALETTE");
|
setTrackElement("Command palette");
|
||||||
toggleCreateCycleModal(true);
|
toggleCreateCycleModal(true);
|
||||||
}}
|
}}
|
||||||
className="focus:outline-none"
|
className="focus:outline-none"
|
||||||
@ -39,6 +39,7 @@ export const CommandPaletteProjectActions: React.FC<Props> = (props) => {
|
|||||||
<Command.Item
|
<Command.Item
|
||||||
onSelect={() => {
|
onSelect={() => {
|
||||||
closePalette();
|
closePalette();
|
||||||
|
setTrackElement("Command palette");
|
||||||
toggleCreateModuleModal(true);
|
toggleCreateModuleModal(true);
|
||||||
}}
|
}}
|
||||||
className="focus:outline-none"
|
className="focus:outline-none"
|
||||||
@ -54,6 +55,7 @@ export const CommandPaletteProjectActions: React.FC<Props> = (props) => {
|
|||||||
<Command.Item
|
<Command.Item
|
||||||
onSelect={() => {
|
onSelect={() => {
|
||||||
closePalette();
|
closePalette();
|
||||||
|
setTrackElement("Command palette");
|
||||||
toggleCreateViewModal(true);
|
toggleCreateViewModal(true);
|
||||||
}}
|
}}
|
||||||
className="focus:outline-none"
|
className="focus:outline-none"
|
||||||
@ -69,6 +71,7 @@ export const CommandPaletteProjectActions: React.FC<Props> = (props) => {
|
|||||||
<Command.Item
|
<Command.Item
|
||||||
onSelect={() => {
|
onSelect={() => {
|
||||||
closePalette();
|
closePalette();
|
||||||
|
setTrackElement("Command palette");
|
||||||
toggleCreatePageModal(true);
|
toggleCreatePageModal(true);
|
||||||
}}
|
}}
|
||||||
className="focus:outline-none"
|
className="focus:outline-none"
|
||||||
|
@ -6,7 +6,7 @@ import { Dialog, Transition } from "@headlessui/react";
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { FolderPlus, Search, Settings } from "lucide-react";
|
import { FolderPlus, Search, Settings } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useProject } from "hooks/store";
|
import { useApplication, useEventTracker, useProject } from "hooks/store";
|
||||||
// services
|
// services
|
||||||
import { WorkspaceService } from "services/workspace.service";
|
import { WorkspaceService } from "services/workspace.service";
|
||||||
import { IssueService } from "services/issue";
|
import { IssueService } from "services/issue";
|
||||||
@ -64,8 +64,8 @@ export const CommandModal: React.FC = observer(() => {
|
|||||||
toggleCreateIssueModal,
|
toggleCreateIssueModal,
|
||||||
toggleCreateProjectModal,
|
toggleCreateProjectModal,
|
||||||
},
|
},
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
} = useApplication();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
|
|
||||||
// router
|
// router
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@ -278,7 +278,7 @@ export const CommandModal: React.FC = observer(() => {
|
|||||||
<Command.Item
|
<Command.Item
|
||||||
onSelect={() => {
|
onSelect={() => {
|
||||||
closePalette();
|
closePalette();
|
||||||
setTrackElement("COMMAND_PALETTE");
|
setTrackElement("Command Palette");
|
||||||
toggleCreateIssueModal(true);
|
toggleCreateIssueModal(true);
|
||||||
}}
|
}}
|
||||||
className="focus:bg-custom-background-80"
|
className="focus:bg-custom-background-80"
|
||||||
@ -296,7 +296,7 @@ export const CommandModal: React.FC = observer(() => {
|
|||||||
<Command.Item
|
<Command.Item
|
||||||
onSelect={() => {
|
onSelect={() => {
|
||||||
closePalette();
|
closePalette();
|
||||||
setTrackElement("COMMAND_PALETTE");
|
setTrackElement("Command palette");
|
||||||
toggleCreateProjectModal(true);
|
toggleCreateProjectModal(true);
|
||||||
}}
|
}}
|
||||||
className="focus:outline-none"
|
className="focus:outline-none"
|
||||||
|
@ -3,7 +3,7 @@ import { useRouter } from "next/router";
|
|||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useIssues, useUser } from "hooks/store";
|
import { useApplication, useEventTracker, useIssues, useUser } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// components
|
// components
|
||||||
import { CommandModal, ShortcutsModal } from "components/command-palette";
|
import { CommandModal, ShortcutsModal } from "components/command-palette";
|
||||||
@ -32,8 +32,8 @@ export const CommandPalette: FC = observer(() => {
|
|||||||
const {
|
const {
|
||||||
commandPalette,
|
commandPalette,
|
||||||
theme: { toggleSidebar },
|
theme: { toggleSidebar },
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
} = useApplication();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
const { currentUser } = useUser();
|
const { currentUser } = useUser();
|
||||||
const {
|
const {
|
||||||
issues: { removeIssue },
|
issues: { removeIssue },
|
||||||
@ -118,11 +118,10 @@ export const CommandPalette: FC = observer(() => {
|
|||||||
toggleSidebar();
|
toggleSidebar();
|
||||||
}
|
}
|
||||||
} else if (!isAnyModalOpen) {
|
} else if (!isAnyModalOpen) {
|
||||||
|
setTrackElement("Shortcut key");
|
||||||
if (keyPressed === "c") {
|
if (keyPressed === "c") {
|
||||||
setTrackElement("SHORTCUT_KEY");
|
|
||||||
toggleCreateIssueModal(true);
|
toggleCreateIssueModal(true);
|
||||||
} else if (keyPressed === "p") {
|
} else if (keyPressed === "p") {
|
||||||
setTrackElement("SHORTCUT_KEY");
|
|
||||||
toggleCreateProjectModal(true);
|
toggleCreateProjectModal(true);
|
||||||
} else if (keyPressed === "h") {
|
} else if (keyPressed === "h") {
|
||||||
toggleShortcutModal(true);
|
toggleShortcutModal(true);
|
||||||
|
@ -86,12 +86,15 @@ const ProgressChart: React.FC<Props> = ({ distribution, startDate, endDate, tota
|
|||||||
{
|
{
|
||||||
id: "pending",
|
id: "pending",
|
||||||
color: "#3F76FF",
|
color: "#3F76FF",
|
||||||
data: chartData.map((item, index) => ({
|
data:
|
||||||
index,
|
chartData.length > 0
|
||||||
x: item.currentDate,
|
? chartData.map((item, index) => ({
|
||||||
y: item.pending,
|
index,
|
||||||
color: "#3F76FF",
|
x: item.currentDate,
|
||||||
})),
|
y: item.pending,
|
||||||
|
color: "#3F76FF",
|
||||||
|
}))
|
||||||
|
: [],
|
||||||
enableArea: true,
|
enableArea: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -121,7 +124,9 @@ const ProgressChart: React.FC<Props> = ({ distribution, startDate, endDate, tota
|
|||||||
enableArea
|
enableArea
|
||||||
colors={(datum) => datum.color ?? "#3F76FF"}
|
colors={(datum) => datum.color ?? "#3F76FF"}
|
||||||
customYAxisTickValues={[0, totalIssues]}
|
customYAxisTickValues={[0, totalIssues]}
|
||||||
gridXValues={chartData.map((item, index) => (index % 2 === 0 ? item.currentDate : ""))}
|
gridXValues={
|
||||||
|
chartData.length > 0 ? chartData.map((item, index) => (index % 2 === 0 ? item.currentDate : "")) : undefined
|
||||||
|
}
|
||||||
enableSlices="x"
|
enableSlices="x"
|
||||||
sliceTooltip={(datum) => (
|
sliceTooltip={(datum) => (
|
||||||
<div className="rounded-md border border-custom-border-200 bg-custom-background-80 p-2 text-xs">
|
<div className="rounded-md border border-custom-border-200 bg-custom-background-80 p-2 text-xs">
|
||||||
|
@ -2,7 +2,7 @@ import { FC, MouseEvent, useState } from "react";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useCycle, useUser } from "hooks/store";
|
import { useEventTracker, useCycle, useUser } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// components
|
// components
|
||||||
import { CycleCreateUpdateModal, CycleDeleteModal } from "components/cycles";
|
import { CycleCreateUpdateModal, CycleDeleteModal } from "components/cycles";
|
||||||
@ -33,9 +33,7 @@ export const CyclesBoardCard: FC<ICyclesBoardCard> = (props) => {
|
|||||||
// router
|
// router
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
// store
|
// store
|
||||||
const {
|
const { setTrackElement } = useEventTracker();
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
|
||||||
const {
|
const {
|
||||||
membership: { currentProjectRole },
|
membership: { currentProjectRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
@ -117,14 +115,15 @@ export const CyclesBoardCard: FC<ICyclesBoardCard> = (props) => {
|
|||||||
const handleEditCycle = (e: MouseEvent<HTMLButtonElement>) => {
|
const handleEditCycle = (e: MouseEvent<HTMLButtonElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
setTrackElement("Cycles page board layout");
|
||||||
setUpdateModal(true);
|
setUpdateModal(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleDeleteCycle = (e: MouseEvent<HTMLButtonElement>) => {
|
const handleDeleteCycle = (e: MouseEvent<HTMLButtonElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
setTrackElement("Cycles page board layout");
|
||||||
setDeleteModal(true);
|
setDeleteModal(true);
|
||||||
setTrackElement("CYCLE_PAGE_BOARD_LAYOUT");
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const openCycleOverview = (e: MouseEvent<HTMLButtonElement>) => {
|
const openCycleOverview = (e: MouseEvent<HTMLButtonElement>) => {
|
||||||
|
@ -2,7 +2,7 @@ import { FC, MouseEvent, useState } from "react";
|
|||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useCycle, useUser } from "hooks/store";
|
import { useEventTracker, useCycle, useUser } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// components
|
// components
|
||||||
import { CycleCreateUpdateModal, CycleDeleteModal } from "components/cycles";
|
import { CycleCreateUpdateModal, CycleDeleteModal } from "components/cycles";
|
||||||
@ -37,9 +37,7 @@ export const CyclesListItem: FC<TCyclesListItem> = (props) => {
|
|||||||
// router
|
// router
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { setTrackElement } = useEventTracker();
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
|
||||||
const {
|
const {
|
||||||
membership: { currentProjectRole },
|
membership: { currentProjectRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
@ -90,14 +88,15 @@ export const CyclesListItem: FC<TCyclesListItem> = (props) => {
|
|||||||
const handleEditCycle = (e: MouseEvent<HTMLButtonElement>) => {
|
const handleEditCycle = (e: MouseEvent<HTMLButtonElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
setTrackElement("Cycles page list layout");
|
||||||
setUpdateModal(true);
|
setUpdateModal(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleDeleteCycle = (e: MouseEvent<HTMLButtonElement>) => {
|
const handleDeleteCycle = (e: MouseEvent<HTMLButtonElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
setTrackElement("Cycles page list layout");
|
||||||
setDeleteModal(true);
|
setDeleteModal(true);
|
||||||
setTrackElement("CYCLE_PAGE_LIST_LAYOUT");
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const openCycleOverview = (e: MouseEvent<HTMLButtonElement>) => {
|
const openCycleOverview = (e: MouseEvent<HTMLButtonElement>) => {
|
||||||
|
@ -4,7 +4,7 @@ import { Dialog, Transition } from "@headlessui/react";
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { AlertTriangle } from "lucide-react";
|
import { AlertTriangle } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useCycle } from "hooks/store";
|
import { useEventTracker, useCycle } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// components
|
// components
|
||||||
import { Button } from "@plane/ui";
|
import { Button } from "@plane/ui";
|
||||||
@ -27,9 +27,7 @@ export const CycleDeleteModal: React.FC<ICycleDelete> = observer((props) => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { cycleId, peekCycle } = router.query;
|
const { cycleId, peekCycle } = router.query;
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { captureCycleEvent } = useEventTracker();
|
||||||
eventTracker: { postHogEventTracker },
|
|
||||||
} = useApplication();
|
|
||||||
const { deleteCycle } = useCycle();
|
const { deleteCycle } = useCycle();
|
||||||
// toast alert
|
// toast alert
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
@ -46,13 +44,15 @@ export const CycleDeleteModal: React.FC<ICycleDelete> = observer((props) => {
|
|||||||
title: "Success!",
|
title: "Success!",
|
||||||
message: "Cycle deleted successfully.",
|
message: "Cycle deleted successfully.",
|
||||||
});
|
});
|
||||||
postHogEventTracker("CYCLE_DELETE", {
|
captureCycleEvent({
|
||||||
state: "SUCCESS",
|
eventName: "Cycle deleted",
|
||||||
|
payload: { ...cycle, state: "SUCCESS" },
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
postHogEventTracker("CYCLE_DELETE", {
|
captureCycleEvent({
|
||||||
state: "FAILED",
|
eventName: "Cycle deleted",
|
||||||
|
payload: { ...cycle, state: "FAILED" },
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ import { Dialog, Transition } from "@headlessui/react";
|
|||||||
// services
|
// services
|
||||||
import { CycleService } from "services/cycle.service";
|
import { CycleService } from "services/cycle.service";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useCycle, useProject } from "hooks/store";
|
import { useEventTracker, useCycle, useProject } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
import useLocalStorage from "hooks/use-local-storage";
|
import useLocalStorage from "hooks/use-local-storage";
|
||||||
// components
|
// components
|
||||||
@ -27,9 +27,7 @@ export const CycleCreateUpdateModal: React.FC<CycleModalProps> = (props) => {
|
|||||||
// states
|
// states
|
||||||
const [activeProject, setActiveProject] = useState<string | null>(null);
|
const [activeProject, setActiveProject] = useState<string | null>(null);
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { captureCycleEvent } = useEventTracker();
|
||||||
eventTracker: { postHogEventTracker },
|
|
||||||
} = useApplication();
|
|
||||||
const { workspaceProjectIds } = useProject();
|
const { workspaceProjectIds } = useProject();
|
||||||
const { createCycle, updateCycleDetails } = useCycle();
|
const { createCycle, updateCycleDetails } = useCycle();
|
||||||
// toast alert
|
// toast alert
|
||||||
@ -48,9 +46,9 @@ export const CycleCreateUpdateModal: React.FC<CycleModalProps> = (props) => {
|
|||||||
title: "Success!",
|
title: "Success!",
|
||||||
message: "Cycle created successfully.",
|
message: "Cycle created successfully.",
|
||||||
});
|
});
|
||||||
postHogEventTracker("CYCLE_CREATE", {
|
captureCycleEvent({
|
||||||
...res,
|
eventName: "Cycle created",
|
||||||
state: "SUCCESS",
|
payload: { ...res, state: "SUCCESS" },
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
@ -59,8 +57,9 @@ export const CycleCreateUpdateModal: React.FC<CycleModalProps> = (props) => {
|
|||||||
title: "Error!",
|
title: "Error!",
|
||||||
message: err.detail ?? "Error in creating cycle. Please try again.",
|
message: err.detail ?? "Error in creating cycle. Please try again.",
|
||||||
});
|
});
|
||||||
postHogEventTracker("CYCLE_CREATE", {
|
captureCycleEvent({
|
||||||
state: "FAILED",
|
eventName: "Cycle created",
|
||||||
|
payload: { ...payload, state: "FAILED" },
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -6,7 +6,7 @@ import { Disclosure, Popover, Transition } from "@headlessui/react";
|
|||||||
// services
|
// services
|
||||||
import { CycleService } from "services/cycle.service";
|
import { CycleService } from "services/cycle.service";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useCycle, useMember, useUser } from "hooks/store";
|
import { useEventTracker, useCycle, useUser, useMember } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// components
|
// components
|
||||||
import { SidebarProgressStats } from "components/core";
|
import { SidebarProgressStats } from "components/core";
|
||||||
@ -66,9 +66,7 @@ export const CycleDetailsSidebar: React.FC<Props> = observer((props) => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { workspaceSlug, projectId, peekCycle } = router.query;
|
const { workspaceSlug, projectId, peekCycle } = router.query;
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { setTrackElement } = useEventTracker();
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
|
||||||
const {
|
const {
|
||||||
membership: { currentProjectRole },
|
membership: { currentProjectRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
@ -319,13 +317,7 @@ export const CycleDetailsSidebar: React.FC<Props> = observer((props) => {
|
|||||||
const currentCycle = CYCLE_STATUS.find((status) => status.value === cycleStatus);
|
const currentCycle = CYCLE_STATUS.find((status) => status.value === cycleStatus);
|
||||||
|
|
||||||
const issueCount =
|
const issueCount =
|
||||||
cycleDetails.total_issues === 0
|
cycleDetails.total_issues === 0 ? "0 Issue" : `${cycleDetails.completed_issues}/${cycleDetails.total_issues}`;
|
||||||
? "0 Issue"
|
|
||||||
: cycleDetails.total_issues === cycleDetails.completed_issues
|
|
||||||
? cycleDetails.total_issues > 1
|
|
||||||
? `${cycleDetails.total_issues}`
|
|
||||||
: `${cycleDetails.total_issues}`
|
|
||||||
: `${cycleDetails.completed_issues}/${cycleDetails.total_issues}`;
|
|
||||||
|
|
||||||
const isEditingAllowed = !!currentProjectRole && currentProjectRole >= EUserWorkspaceRoles.MEMBER;
|
const isEditingAllowed = !!currentProjectRole && currentProjectRole >= EUserWorkspaceRoles.MEMBER;
|
||||||
|
|
||||||
@ -575,7 +567,9 @@ export const CycleDetailsSidebar: React.FC<Props> = observer((props) => {
|
|||||||
<Transition show={open}>
|
<Transition show={open}>
|
||||||
<Disclosure.Panel>
|
<Disclosure.Panel>
|
||||||
<div className="flex flex-col gap-3">
|
<div className="flex flex-col gap-3">
|
||||||
{isStartValid && isEndValid ? (
|
{cycleDetails.distribution?.completion_chart &&
|
||||||
|
cycleDetails.start_date &&
|
||||||
|
cycleDetails.end_date ? (
|
||||||
<div className="h-full w-full pt-4">
|
<div className="h-full w-full pt-4">
|
||||||
<div className="flex items-start gap-4 py-2 text-xs">
|
<div className="flex items-start gap-4 py-2 text-xs">
|
||||||
<div className="flex items-center gap-3 text-custom-text-100">
|
<div className="flex items-center gap-3 text-custom-text-100">
|
||||||
@ -589,16 +583,14 @@ export const CycleDetailsSidebar: React.FC<Props> = observer((props) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{cycleDetails && cycleDetails.distribution && (
|
<div className="relative h-40 w-80">
|
||||||
<div className="relative h-40 w-80">
|
<ProgressChart
|
||||||
<ProgressChart
|
distribution={cycleDetails.distribution?.completion_chart}
|
||||||
distribution={cycleDetails.distribution?.completion_chart ?? {}}
|
startDate={cycleDetails.start_date}
|
||||||
startDate={cycleDetails.start_date ?? ""}
|
endDate={cycleDetails.end_date}
|
||||||
endDate={cycleDetails.end_date ?? ""}
|
totalIssues={cycleDetails.total_issues}
|
||||||
totalIssues={cycleDetails.total_issues}
|
/>
|
||||||
/>
|
</div>
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useUser } from "hooks/store";
|
import { useApplication, useEventTracker, useUser } from "hooks/store";
|
||||||
// ui
|
// ui
|
||||||
import { Button } from "@plane/ui";
|
import { Button } from "@plane/ui";
|
||||||
// assets
|
// assets
|
||||||
@ -14,6 +14,7 @@ export const DashboardProjectEmptyState = observer(() => {
|
|||||||
const {
|
const {
|
||||||
commandPalette: { toggleCreateProjectModal },
|
commandPalette: { toggleCreateProjectModal },
|
||||||
} = useApplication();
|
} = useApplication();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
const {
|
const {
|
||||||
membership: { currentWorkspaceRole },
|
membership: { currentWorkspaceRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
@ -31,7 +32,13 @@ export const DashboardProjectEmptyState = observer(() => {
|
|||||||
<Image src={ProjectEmptyStateImage} className="w-full" alt="Project empty state" />
|
<Image src={ProjectEmptyStateImage} className="w-full" alt="Project empty state" />
|
||||||
{canCreateProject && (
|
{canCreateProject && (
|
||||||
<div className="flex justify-center">
|
<div className="flex justify-center">
|
||||||
<Button variant="primary" onClick={() => toggleCreateProjectModal(true)}>
|
<Button
|
||||||
|
variant="primary"
|
||||||
|
onClick={() => {
|
||||||
|
setTrackElement("Project empty state");
|
||||||
|
toggleCreateProjectModal(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
Build your first project
|
Build your first project
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -3,7 +3,7 @@ import Link from "next/link";
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { Plus } from "lucide-react";
|
import { Plus } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useDashboard, useProject, useUser } from "hooks/store";
|
import { useApplication, useEventTracker, useDashboard, useProject, useUser } from "hooks/store";
|
||||||
// components
|
// components
|
||||||
import { WidgetLoader, WidgetProps } from "components/dashboard/widgets";
|
import { WidgetLoader, WidgetProps } from "components/dashboard/widgets";
|
||||||
// ui
|
// ui
|
||||||
@ -72,6 +72,7 @@ export const RecentProjectsWidget: React.FC<WidgetProps> = observer((props) => {
|
|||||||
const {
|
const {
|
||||||
commandPalette: { toggleCreateProjectModal },
|
commandPalette: { toggleCreateProjectModal },
|
||||||
} = useApplication();
|
} = useApplication();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
const {
|
const {
|
||||||
membership: { currentWorkspaceRole },
|
membership: { currentWorkspaceRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
@ -105,6 +106,7 @@ export const RecentProjectsWidget: React.FC<WidgetProps> = observer((props) => {
|
|||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
setTrackElement("Sidebar");
|
||||||
toggleCreateProjectModal(true);
|
toggleCreateProjectModal(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -5,6 +5,7 @@ import Link from "next/link";
|
|||||||
// hooks
|
// hooks
|
||||||
import {
|
import {
|
||||||
useApplication,
|
useApplication,
|
||||||
|
useEventTracker,
|
||||||
useCycle,
|
useCycle,
|
||||||
useLabel,
|
useLabel,
|
||||||
useMember,
|
useMember,
|
||||||
@ -70,8 +71,8 @@ export const CycleIssuesHeader: React.FC = observer(() => {
|
|||||||
const { currentProjectCycleIds, getCycleById } = useCycle();
|
const { currentProjectCycleIds, getCycleById } = useCycle();
|
||||||
const {
|
const {
|
||||||
commandPalette: { toggleCreateIssueModal },
|
commandPalette: { toggleCreateIssueModal },
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
} = useApplication();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
const {
|
const {
|
||||||
membership: { currentProjectRole },
|
membership: { currentProjectRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
@ -238,7 +239,7 @@ export const CycleIssuesHeader: React.FC = observer(() => {
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setTrackElement("CYCLE_PAGE_HEADER");
|
setTrackElement("Cycle issues page");
|
||||||
toggleCreateIssueModal(true, EIssuesStoreType.CYCLE);
|
toggleCreateIssueModal(true, EIssuesStoreType.CYCLE);
|
||||||
}}
|
}}
|
||||||
size="sm"
|
size="sm"
|
||||||
|
@ -3,7 +3,7 @@ import { useRouter } from "next/router";
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { Plus } from "lucide-react";
|
import { Plus } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useProject, useUser } from "hooks/store";
|
import { useApplication, useEventTracker, useProject, useUser } from "hooks/store";
|
||||||
// ui
|
// ui
|
||||||
import { Breadcrumbs, Button, ContrastIcon } from "@plane/ui";
|
import { Breadcrumbs, Button, ContrastIcon } from "@plane/ui";
|
||||||
// helpers
|
// helpers
|
||||||
@ -20,8 +20,8 @@ export const CyclesHeader: FC = observer(() => {
|
|||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const {
|
||||||
commandPalette: { toggleCreateCycleModal },
|
commandPalette: { toggleCreateCycleModal },
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
} = useApplication();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
const {
|
const {
|
||||||
membership: { currentProjectRole },
|
membership: { currentProjectRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
@ -70,7 +70,7 @@ export const CyclesHeader: FC = observer(() => {
|
|||||||
size="sm"
|
size="sm"
|
||||||
prependIcon={<Plus />}
|
prependIcon={<Plus />}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setTrackElement("CYCLES_PAGE_HEADER");
|
setTrackElement("Cycles page");
|
||||||
toggleCreateCycleModal(true);
|
toggleCreateCycleModal(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -5,6 +5,7 @@ import Link from "next/link";
|
|||||||
// hooks
|
// hooks
|
||||||
import {
|
import {
|
||||||
useApplication,
|
useApplication,
|
||||||
|
useEventTracker,
|
||||||
useLabel,
|
useLabel,
|
||||||
useMember,
|
useMember,
|
||||||
useModule,
|
useModule,
|
||||||
@ -73,8 +74,8 @@ export const ModuleIssuesHeader: React.FC = observer(() => {
|
|||||||
const { projectModuleIds, getModuleById } = useModule();
|
const { projectModuleIds, getModuleById } = useModule();
|
||||||
const {
|
const {
|
||||||
commandPalette: { toggleCreateIssueModal },
|
commandPalette: { toggleCreateIssueModal },
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
} = useApplication();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
const {
|
const {
|
||||||
membership: { currentProjectRole },
|
membership: { currentProjectRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
@ -241,7 +242,7 @@ export const ModuleIssuesHeader: React.FC = observer(() => {
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setTrackElement("MODULE_PAGE_HEADER");
|
setTrackElement("Module issues page");
|
||||||
toggleCreateIssueModal(true, EIssuesStoreType.MODULE);
|
toggleCreateIssueModal(true, EIssuesStoreType.MODULE);
|
||||||
}}
|
}}
|
||||||
size="sm"
|
size="sm"
|
||||||
|
@ -2,7 +2,7 @@ import { useRouter } from "next/router";
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { Plus } from "lucide-react";
|
import { Plus } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useProject, useUser } from "hooks/store";
|
import { useApplication, useEventTracker, useProject, useUser } from "hooks/store";
|
||||||
import useLocalStorage from "hooks/use-local-storage";
|
import useLocalStorage from "hooks/use-local-storage";
|
||||||
// ui
|
// ui
|
||||||
import { Breadcrumbs, Button, Tooltip, DiceIcon } from "@plane/ui";
|
import { Breadcrumbs, Button, Tooltip, DiceIcon } from "@plane/ui";
|
||||||
@ -21,6 +21,7 @@ export const ModulesListHeader: React.FC = observer(() => {
|
|||||||
const { workspaceSlug } = router.query;
|
const { workspaceSlug } = router.query;
|
||||||
// store hooks
|
// store hooks
|
||||||
const { commandPalette: commandPaletteStore } = useApplication();
|
const { commandPalette: commandPaletteStore } = useApplication();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
const {
|
const {
|
||||||
membership: { currentProjectRole },
|
membership: { currentProjectRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
@ -90,7 +91,10 @@ export const ModulesListHeader: React.FC = observer(() => {
|
|||||||
variant="primary"
|
variant="primary"
|
||||||
size="sm"
|
size="sm"
|
||||||
prependIcon={<Plus />}
|
prependIcon={<Plus />}
|
||||||
onClick={() => commandPaletteStore.toggleCreateModuleModal(true)}
|
onClick={() => {
|
||||||
|
setTrackElement("Modules page");
|
||||||
|
commandPaletteStore.toggleCreateModuleModal(true);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
Add Module
|
Add Module
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -4,7 +4,16 @@ import { useRouter } from "next/router";
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { ArrowLeft, Briefcase, Circle, ExternalLink, Plus } from "lucide-react";
|
import { ArrowLeft, Briefcase, Circle, ExternalLink, Plus } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useLabel, useProject, useProjectState, useUser, useInbox, useMember } from "hooks/store";
|
import {
|
||||||
|
useApplication,
|
||||||
|
useEventTracker,
|
||||||
|
useLabel,
|
||||||
|
useProject,
|
||||||
|
useProjectState,
|
||||||
|
useUser,
|
||||||
|
useInbox,
|
||||||
|
useMember,
|
||||||
|
} from "hooks/store";
|
||||||
// components
|
// components
|
||||||
import { DisplayFiltersSelection, FiltersDropdown, FilterSelection, LayoutSelection } from "components/issues";
|
import { DisplayFiltersSelection, FiltersDropdown, FilterSelection, LayoutSelection } from "components/issues";
|
||||||
import { ProjectAnalyticsModal } from "components/analytics";
|
import { ProjectAnalyticsModal } from "components/analytics";
|
||||||
@ -36,8 +45,8 @@ export const ProjectIssuesHeader: React.FC = observer(() => {
|
|||||||
} = useIssues(EIssuesStoreType.PROJECT);
|
} = useIssues(EIssuesStoreType.PROJECT);
|
||||||
const {
|
const {
|
||||||
commandPalette: { toggleCreateIssueModal },
|
commandPalette: { toggleCreateIssueModal },
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
} = useApplication();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
const {
|
const {
|
||||||
membership: { currentProjectRole },
|
membership: { currentProjectRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
@ -221,7 +230,7 @@ export const ProjectIssuesHeader: React.FC = observer(() => {
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setTrackElement("PROJECT_PAGE_HEADER");
|
setTrackElement("Project issues page");
|
||||||
toggleCreateIssueModal(true, EIssuesStoreType.PROJECT);
|
toggleCreateIssueModal(true, EIssuesStoreType.PROJECT);
|
||||||
}}
|
}}
|
||||||
size="sm"
|
size="sm"
|
||||||
|
@ -6,6 +6,7 @@ import Link from "next/link";
|
|||||||
// hooks
|
// hooks
|
||||||
import {
|
import {
|
||||||
useApplication,
|
useApplication,
|
||||||
|
useEventTracker,
|
||||||
useIssues,
|
useIssues,
|
||||||
useLabel,
|
useLabel,
|
||||||
useMember,
|
useMember,
|
||||||
@ -41,9 +42,9 @@ export const ProjectViewIssuesHeader: React.FC = observer(() => {
|
|||||||
const {
|
const {
|
||||||
issuesFilter: { issueFilters, updateFilters },
|
issuesFilter: { issueFilters, updateFilters },
|
||||||
} = useIssues(EIssuesStoreType.PROJECT_VIEW);
|
} = useIssues(EIssuesStoreType.PROJECT_VIEW);
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
const {
|
const {
|
||||||
commandPalette: { toggleCreateIssueModal },
|
commandPalette: { toggleCreateIssueModal },
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
} = useApplication();
|
||||||
const {
|
const {
|
||||||
membership: { currentProjectRole },
|
membership: { currentProjectRole },
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { Search, Plus, Briefcase } from "lucide-react";
|
import { Search, Plus, Briefcase } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useProject, useUser } from "hooks/store";
|
import { useApplication, useEventTracker, useProject, useUser } from "hooks/store";
|
||||||
// ui
|
// ui
|
||||||
import { Breadcrumbs, Button } from "@plane/ui";
|
import { Breadcrumbs, Button } from "@plane/ui";
|
||||||
// constants
|
// constants
|
||||||
@ -12,10 +12,8 @@ import { BreadcrumbLink } from "components/common";
|
|||||||
|
|
||||||
export const ProjectsHeader = observer(() => {
|
export const ProjectsHeader = observer(() => {
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { commandPalette: commandPaletteStore } = useApplication();
|
||||||
commandPalette: commandPaletteStore,
|
const { setTrackElement } = useEventTracker();
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
|
||||||
const {
|
const {
|
||||||
membership: { currentWorkspaceRole },
|
membership: { currentWorkspaceRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
@ -53,7 +51,7 @@ export const ProjectsHeader = observer(() => {
|
|||||||
prependIcon={<Plus />}
|
prependIcon={<Plus />}
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setTrackElement("PROJECTS_PAGE_HEADER");
|
setTrackElement("Projects page");
|
||||||
commandPaletteStore.toggleCreateProjectModal(true);
|
commandPaletteStore.toggleCreateProjectModal(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -4,7 +4,7 @@ import { observer } from "mobx-react-lite";
|
|||||||
import DatePicker from "react-datepicker";
|
import DatePicker from "react-datepicker";
|
||||||
import { Popover } from "@headlessui/react";
|
import { Popover } from "@headlessui/react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useUser, useInboxIssues, useIssueDetail, useWorkspace } from "hooks/store";
|
import { useUser, useInboxIssues, useIssueDetail, useWorkspace, useEventTracker } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// components
|
// components
|
||||||
import {
|
import {
|
||||||
@ -38,9 +38,7 @@ export const InboxIssueActionsHeader: FC<TInboxIssueActionsHeader> = observer((p
|
|||||||
// router
|
// router
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
// hooks
|
// hooks
|
||||||
const {
|
const { captureIssueEvent } = useEventTracker();
|
||||||
eventTracker: { postHogEventTracker },
|
|
||||||
} = useApplication();
|
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const {
|
const {
|
||||||
issues: { getInboxIssuesByInboxId, getInboxIssueByIssueId, updateInboxIssueStatus, removeInboxIssue },
|
issues: { getInboxIssuesByInboxId, getInboxIssueByIssueId, updateInboxIssueStatus, removeInboxIssue },
|
||||||
@ -87,17 +85,19 @@ export const InboxIssueActionsHeader: FC<TInboxIssueActionsHeader> = observer((p
|
|||||||
if (!workspaceSlug || !projectId || !inboxId || !inboxIssueId || !currentWorkspace)
|
if (!workspaceSlug || !projectId || !inboxId || !inboxIssueId || !currentWorkspace)
|
||||||
throw new Error("Missing required parameters");
|
throw new Error("Missing required parameters");
|
||||||
await removeInboxIssue(workspaceSlug, projectId, inboxId, inboxIssueId);
|
await removeInboxIssue(workspaceSlug, projectId, inboxId, inboxIssueId);
|
||||||
postHogEventTracker(
|
captureIssueEvent({
|
||||||
"ISSUE_DELETED",
|
eventName: "Issue deleted",
|
||||||
{
|
payload: {
|
||||||
|
id: inboxIssueId,
|
||||||
state: "SUCCESS",
|
state: "SUCCESS",
|
||||||
|
element: "Inbox page",
|
||||||
},
|
},
|
||||||
{
|
group: {
|
||||||
isGrouping: true,
|
isGrouping: true,
|
||||||
groupType: "Workspace_metrics",
|
groupType: "Workspace_metrics",
|
||||||
groupId: currentWorkspace?.id!,
|
groupId: currentWorkspace?.id!,
|
||||||
}
|
},
|
||||||
);
|
});
|
||||||
router.push({
|
router.push({
|
||||||
pathname: `/${workspaceSlug}/projects/${projectId}/inbox/${inboxId}`,
|
pathname: `/${workspaceSlug}/projects/${projectId}/inbox/${inboxId}`,
|
||||||
});
|
});
|
||||||
@ -107,17 +107,19 @@ export const InboxIssueActionsHeader: FC<TInboxIssueActionsHeader> = observer((p
|
|||||||
title: "Error!",
|
title: "Error!",
|
||||||
message: "Something went wrong while deleting inbox issue. Please try again.",
|
message: "Something went wrong while deleting inbox issue. Please try again.",
|
||||||
});
|
});
|
||||||
postHogEventTracker(
|
captureIssueEvent({
|
||||||
"ISSUE_DELETED",
|
eventName: "Issue deleted",
|
||||||
{
|
payload: {
|
||||||
|
id: inboxIssueId,
|
||||||
state: "FAILED",
|
state: "FAILED",
|
||||||
|
element: "Inbox page",
|
||||||
},
|
},
|
||||||
{
|
group: {
|
||||||
isGrouping: true,
|
isGrouping: true,
|
||||||
groupType: "Workspace_metrics",
|
groupType: "Workspace_metrics",
|
||||||
groupId: currentWorkspace?.id!,
|
groupId: currentWorkspace?.id!,
|
||||||
}
|
},
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
@ -130,7 +132,7 @@ export const InboxIssueActionsHeader: FC<TInboxIssueActionsHeader> = observer((p
|
|||||||
updateInboxIssueStatus,
|
updateInboxIssueStatus,
|
||||||
removeInboxIssue,
|
removeInboxIssue,
|
||||||
setToastAlert,
|
setToastAlert,
|
||||||
postHogEventTracker,
|
captureIssueEvent,
|
||||||
router,
|
router,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@ -6,7 +6,7 @@ import { Controller, useForm } from "react-hook-form";
|
|||||||
import { RichTextEditorWithRef } from "@plane/rich-text-editor";
|
import { RichTextEditorWithRef } from "@plane/rich-text-editor";
|
||||||
import { Sparkle } from "lucide-react";
|
import { Sparkle } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useWorkspace, useInboxIssues, useMention } from "hooks/store";
|
import { useApplication, useEventTracker, useWorkspace, useInboxIssues, useMention } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// services
|
// services
|
||||||
import { FileService } from "services/file.service";
|
import { FileService } from "services/file.service";
|
||||||
@ -63,8 +63,8 @@ export const CreateInboxIssueModal: React.FC<Props> = observer((props) => {
|
|||||||
} = useInboxIssues();
|
} = useInboxIssues();
|
||||||
const {
|
const {
|
||||||
config: { envConfig },
|
config: { envConfig },
|
||||||
eventTracker: { postHogEventTracker },
|
|
||||||
} = useApplication();
|
} = useApplication();
|
||||||
|
const { captureIssueEvent } = useEventTracker();
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@ -93,32 +93,37 @@ export const CreateInboxIssueModal: React.FC<Props> = observer((props) => {
|
|||||||
router.push(`/${workspaceSlug}/projects/${projectId}/inbox/${inboxId}?inboxIssueId=${res.id}`);
|
router.push(`/${workspaceSlug}/projects/${projectId}/inbox/${inboxId}?inboxIssueId=${res.id}`);
|
||||||
handleClose();
|
handleClose();
|
||||||
} else reset(defaultValues);
|
} else reset(defaultValues);
|
||||||
postHogEventTracker(
|
captureIssueEvent({
|
||||||
"ISSUE_CREATED",
|
eventName: "Issue created",
|
||||||
{
|
payload: {
|
||||||
...res,
|
...formData,
|
||||||
state: "SUCCESS",
|
state: "SUCCESS",
|
||||||
|
element: "Inbox page",
|
||||||
},
|
},
|
||||||
{
|
group: {
|
||||||
isGrouping: true,
|
isGrouping: true,
|
||||||
groupType: "Workspace_metrics",
|
groupType: "Workspace_metrics",
|
||||||
groupId: currentWorkspace?.id!,
|
groupId: currentWorkspace?.id!,
|
||||||
}
|
},
|
||||||
);
|
path: router.pathname,
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
postHogEventTracker(
|
captureIssueEvent({
|
||||||
"ISSUE_CREATED",
|
eventName: "Issue created",
|
||||||
{
|
payload: {
|
||||||
|
...formData,
|
||||||
state: "FAILED",
|
state: "FAILED",
|
||||||
|
element: "Inbox page",
|
||||||
},
|
},
|
||||||
{
|
group: {
|
||||||
isGrouping: true,
|
isGrouping: true,
|
||||||
groupType: "Workspace_metrics",
|
groupType: "Workspace_metrics",
|
||||||
groupId: currentWorkspace?.id!,
|
groupId: currentWorkspace?.id!,
|
||||||
}
|
},
|
||||||
);
|
path: router.pathname,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import { observer } from "mobx-react-lite";
|
|||||||
import { useFormContext, Controller } from "react-hook-form";
|
import { useFormContext, Controller } from "react-hook-form";
|
||||||
import { Plus } from "lucide-react";
|
import { Plus } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useProject } from "hooks/store";
|
import { useApplication, useEventTracker, useProject } from "hooks/store";
|
||||||
// components
|
// components
|
||||||
import { CustomSelect, Input } from "@plane/ui";
|
import { CustomSelect, Input } from "@plane/ui";
|
||||||
// helpers
|
// helpers
|
||||||
@ -14,10 +14,8 @@ import { IJiraImporterForm } from "@plane/types";
|
|||||||
|
|
||||||
export const JiraGetImportDetail: React.FC = observer(() => {
|
export const JiraGetImportDetail: React.FC = observer(() => {
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { commandPalette: commandPaletteStore } = useApplication();
|
||||||
commandPalette: commandPaletteStore,
|
const { setTrackElement } = useEventTracker();
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
|
||||||
const { workspaceProjectIds, getProjectById } = useProject();
|
const { workspaceProjectIds, getProjectById } = useProject();
|
||||||
// form info
|
// form info
|
||||||
const {
|
const {
|
||||||
@ -202,7 +200,7 @@ export const JiraGetImportDetail: React.FC = observer(() => {
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setTrackElement("JIRA_IMPORT_DETAIL");
|
setTrackElement("Jira import detail page");
|
||||||
commandPaletteStore.toggleCreateProjectModal(true);
|
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"
|
className="flex cursor-pointer select-none items-center space-x-2 truncate rounded px-1 py-1.5 text-custom-text-200"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { FC, useMemo } from "react";
|
import { FC, useMemo } from "react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useIssueDetail } from "hooks/store";
|
import { useEventTracker, useIssueDetail } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// components
|
// components
|
||||||
import { IssueAttachmentUpload } from "./attachment-upload";
|
import { IssueAttachmentUpload } from "./attachment-upload";
|
||||||
@ -23,6 +23,7 @@ export const IssueAttachmentRoot: FC<TIssueAttachmentRoot> = (props) => {
|
|||||||
const { workspaceSlug, projectId, issueId, disabled = false } = props;
|
const { workspaceSlug, projectId, issueId, disabled = false } = props;
|
||||||
// hooks
|
// hooks
|
||||||
const { createAttachment, removeAttachment } = useIssueDetail();
|
const { createAttachment, removeAttachment } = useIssueDetail();
|
||||||
|
const { captureIssueEvent } = useEventTracker();
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
|
|
||||||
const handleAttachmentOperations: TAttachmentOperations = useMemo(
|
const handleAttachmentOperations: TAttachmentOperations = useMemo(
|
||||||
@ -30,13 +31,25 @@ export const IssueAttachmentRoot: FC<TIssueAttachmentRoot> = (props) => {
|
|||||||
create: async (data: FormData) => {
|
create: async (data: FormData) => {
|
||||||
try {
|
try {
|
||||||
if (!workspaceSlug || !projectId || !issueId) throw new Error("Missing required fields");
|
if (!workspaceSlug || !projectId || !issueId) throw new Error("Missing required fields");
|
||||||
await createAttachment(workspaceSlug, projectId, issueId, data);
|
const res = await createAttachment(workspaceSlug, projectId, issueId, data);
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
message: "The attachment has been successfully uploaded",
|
message: "The attachment has been successfully uploaded",
|
||||||
type: "success",
|
type: "success",
|
||||||
title: "Attachment uploaded",
|
title: "Attachment uploaded",
|
||||||
});
|
});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { id: issueId, state: "SUCCESS", element: "Issue detail page" },
|
||||||
|
updates: {
|
||||||
|
changed_property: "attachment",
|
||||||
|
change_details: res.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { id: issueId, state: "FAILED", element: "Issue detail page" },
|
||||||
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
message: "The attachment could not be uploaded",
|
message: "The attachment could not be uploaded",
|
||||||
type: "error",
|
type: "error",
|
||||||
@ -53,7 +66,23 @@ export const IssueAttachmentRoot: FC<TIssueAttachmentRoot> = (props) => {
|
|||||||
type: "success",
|
type: "success",
|
||||||
title: "Attachment removed",
|
title: "Attachment removed",
|
||||||
});
|
});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { id: issueId, state: "SUCCESS", element: "Issue detail page" },
|
||||||
|
updates: {
|
||||||
|
changed_property: "attachment",
|
||||||
|
change_details: "",
|
||||||
|
},
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { id: issueId, state: "FAILED", element: "Issue detail page" },
|
||||||
|
updates: {
|
||||||
|
changed_property: "attachment",
|
||||||
|
change_details: "",
|
||||||
|
},
|
||||||
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
message: "The Attachment could not be removed",
|
message: "The Attachment could not be removed",
|
||||||
type: "error",
|
type: "error",
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
import { FC, useMemo } from "react";
|
import { FC, useMemo } from "react";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
// components
|
// components
|
||||||
import { InboxIssueMainContent } from "./main-content";
|
import { InboxIssueMainContent } from "./main-content";
|
||||||
import { InboxIssueDetailsSidebar } from "./sidebar";
|
import { InboxIssueDetailsSidebar } from "./sidebar";
|
||||||
// hooks
|
// hooks
|
||||||
import { useInboxIssues, useIssueDetail, useUser } from "hooks/store";
|
import { useEventTracker, useInboxIssues, useIssueDetail, useUser } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// types
|
// types
|
||||||
import { TIssue } from "@plane/types";
|
import { TIssue } from "@plane/types";
|
||||||
@ -21,6 +22,8 @@ export type TInboxIssueDetailRoot = {
|
|||||||
|
|
||||||
export const InboxIssueDetailRoot: FC<TInboxIssueDetailRoot> = (props) => {
|
export const InboxIssueDetailRoot: FC<TInboxIssueDetailRoot> = (props) => {
|
||||||
const { workspaceSlug, projectId, inboxId, issueId } = props;
|
const { workspaceSlug, projectId, inboxId, issueId } = props;
|
||||||
|
// router
|
||||||
|
const router = useRouter();
|
||||||
// hooks
|
// hooks
|
||||||
const {
|
const {
|
||||||
issues: { fetchInboxIssueById, updateInboxIssue, removeInboxIssue },
|
issues: { fetchInboxIssueById, updateInboxIssue, removeInboxIssue },
|
||||||
@ -28,6 +31,7 @@ export const InboxIssueDetailRoot: FC<TInboxIssueDetailRoot> = (props) => {
|
|||||||
const {
|
const {
|
||||||
issue: { getIssueById },
|
issue: { getIssueById },
|
||||||
} = useIssueDetail();
|
} = useIssueDetail();
|
||||||
|
const { captureIssueEvent } = useEventTracker();
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
const {
|
const {
|
||||||
membership: { currentProjectRole },
|
membership: { currentProjectRole },
|
||||||
@ -50,7 +54,7 @@ export const InboxIssueDetailRoot: FC<TInboxIssueDetailRoot> = (props) => {
|
|||||||
showToast: boolean = true
|
showToast: boolean = true
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
await updateInboxIssue(workspaceSlug, projectId, inboxId, issueId, data);
|
const response = await updateInboxIssue(workspaceSlug, projectId, inboxId, issueId, data);
|
||||||
if (showToast) {
|
if (showToast) {
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Issue updated successfully",
|
title: "Issue updated successfully",
|
||||||
@ -58,12 +62,30 @@ export const InboxIssueDetailRoot: FC<TInboxIssueDetailRoot> = (props) => {
|
|||||||
message: "Issue updated successfully",
|
message: "Issue updated successfully",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Inbox issue updated",
|
||||||
|
payload: { ...response, state: "SUCCESS", element: "Inbox" },
|
||||||
|
updates: {
|
||||||
|
changed_property: Object.keys(data).join(","),
|
||||||
|
change_details: Object.values(data).join(","),
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Issue update failed",
|
title: "Issue update failed",
|
||||||
type: "error",
|
type: "error",
|
||||||
message: "Issue update failed",
|
message: "Issue update failed",
|
||||||
});
|
});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Inbox issue updated",
|
||||||
|
payload: { state: "SUCCESS", element: "Inbox" },
|
||||||
|
updates: {
|
||||||
|
changed_property: Object.keys(data).join(","),
|
||||||
|
change_details: Object.values(data).join(","),
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
remove: async (workspaceSlug: string, projectId: string, issueId: string) => {
|
remove: async (workspaceSlug: string, projectId: string, issueId: string) => {
|
||||||
@ -74,7 +96,17 @@ export const InboxIssueDetailRoot: FC<TInboxIssueDetailRoot> = (props) => {
|
|||||||
type: "success",
|
type: "success",
|
||||||
message: "Issue deleted successfully",
|
message: "Issue deleted successfully",
|
||||||
});
|
});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Inbox issue deleted",
|
||||||
|
payload: { id: issueId, state: "SUCCESS", element: "Inbox" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Inbox issue deleted",
|
||||||
|
payload: { id: issueId, state: "FAILED", element: "Inbox" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Issue delete failed",
|
title: "Issue delete failed",
|
||||||
type: "error",
|
type: "error",
|
||||||
|
@ -9,7 +9,7 @@ import { EmptyState } from "components/common";
|
|||||||
// images
|
// images
|
||||||
import emptyIssue from "public/empty-state/issue.svg";
|
import emptyIssue from "public/empty-state/issue.svg";
|
||||||
// hooks
|
// hooks
|
||||||
import { useIssueDetail, useIssues, useUser } from "hooks/store";
|
import { useEventTracker, useIssueDetail, useIssues, useUser } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// types
|
// types
|
||||||
import { TIssue } from "@plane/types";
|
import { TIssue } from "@plane/types";
|
||||||
@ -70,6 +70,7 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = (props) => {
|
|||||||
const {
|
const {
|
||||||
issues: { removeIssue: removeArchivedIssue },
|
issues: { removeIssue: removeArchivedIssue },
|
||||||
} = useIssues(EIssuesStoreType.ARCHIVED);
|
} = useIssues(EIssuesStoreType.ARCHIVED);
|
||||||
|
const { captureIssueEvent } = useEventTracker();
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
const {
|
const {
|
||||||
membership: { currentProjectRole },
|
membership: { currentProjectRole },
|
||||||
@ -92,7 +93,7 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = (props) => {
|
|||||||
showToast: boolean = true
|
showToast: boolean = true
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
await updateIssue(workspaceSlug, projectId, issueId, data);
|
const response = await updateIssue(workspaceSlug, projectId, issueId, data);
|
||||||
if (showToast) {
|
if (showToast) {
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Issue updated successfully",
|
title: "Issue updated successfully",
|
||||||
@ -100,7 +101,25 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = (props) => {
|
|||||||
message: "Issue updated successfully",
|
message: "Issue updated successfully",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { ...response, state: "SUCCESS", element: "Issue detail page" },
|
||||||
|
updates: {
|
||||||
|
changed_property: Object.keys(data).join(","),
|
||||||
|
change_details: Object.values(data).join(","),
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { state: "FAILED", element: "Issue detail page" },
|
||||||
|
updates: {
|
||||||
|
changed_property: Object.keys(data).join(","),
|
||||||
|
change_details: Object.values(data).join(","),
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Issue update failed",
|
title: "Issue update failed",
|
||||||
type: "error",
|
type: "error",
|
||||||
@ -110,30 +129,59 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = (props) => {
|
|||||||
},
|
},
|
||||||
remove: async (workspaceSlug: string, projectId: string, issueId: string) => {
|
remove: async (workspaceSlug: string, projectId: string, issueId: string) => {
|
||||||
try {
|
try {
|
||||||
if (is_archived) await removeArchivedIssue(workspaceSlug, projectId, issueId);
|
let response;
|
||||||
else await removeIssue(workspaceSlug, projectId, issueId);
|
if (is_archived) response = await removeArchivedIssue(workspaceSlug, projectId, issueId);
|
||||||
|
else response = await removeIssue(workspaceSlug, projectId, issueId);
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Issue deleted successfully",
|
title: "Issue deleted successfully",
|
||||||
type: "success",
|
type: "success",
|
||||||
message: "Issue deleted successfully",
|
message: "Issue deleted successfully",
|
||||||
});
|
});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue deleted",
|
||||||
|
payload: { id: issueId, state: "SUCCESS", element: "Issue detail page" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Issue delete failed",
|
title: "Issue delete failed",
|
||||||
type: "error",
|
type: "error",
|
||||||
message: "Issue delete failed",
|
message: "Issue delete failed",
|
||||||
});
|
});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue deleted",
|
||||||
|
payload: { id: issueId, state: "FAILED", element: "Issue detail page" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addIssueToCycle: async (workspaceSlug: string, projectId: string, cycleId: string, issueIds: string[]) => {
|
addIssueToCycle: async (workspaceSlug: string, projectId: string, cycleId: string, issueIds: string[]) => {
|
||||||
try {
|
try {
|
||||||
await addIssueToCycle(workspaceSlug, projectId, cycleId, issueIds);
|
const response = await addIssueToCycle(workspaceSlug, projectId, cycleId, issueIds);
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Cycle added to issue successfully",
|
title: "Cycle added to issue successfully",
|
||||||
type: "success",
|
type: "success",
|
||||||
message: "Issue added to issue successfully",
|
message: "Issue added to issue successfully",
|
||||||
});
|
});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { ...response, state: "SUCCESS", element: "Issue detail page" },
|
||||||
|
updates: {
|
||||||
|
changed_property: "cycle_id",
|
||||||
|
change_details: cycleId,
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { state: "FAILED", element: "Issue detail page" },
|
||||||
|
updates: {
|
||||||
|
changed_property: "cycle_id",
|
||||||
|
change_details: cycleId,
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Cycle add to issue failed",
|
title: "Cycle add to issue failed",
|
||||||
type: "error",
|
type: "error",
|
||||||
@ -143,13 +191,31 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = (props) => {
|
|||||||
},
|
},
|
||||||
removeIssueFromCycle: async (workspaceSlug: string, projectId: string, cycleId: string, issueId: string) => {
|
removeIssueFromCycle: async (workspaceSlug: string, projectId: string, cycleId: string, issueId: string) => {
|
||||||
try {
|
try {
|
||||||
await removeIssueFromCycle(workspaceSlug, projectId, cycleId, issueId);
|
const response = await removeIssueFromCycle(workspaceSlug, projectId, cycleId, issueId);
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Cycle removed from issue successfully",
|
title: "Cycle removed from issue successfully",
|
||||||
type: "success",
|
type: "success",
|
||||||
message: "Cycle removed from issue successfully",
|
message: "Cycle removed from issue successfully",
|
||||||
});
|
});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { ...response, state: "SUCCESS", element: "Issue detail page" },
|
||||||
|
updates: {
|
||||||
|
changed_property: "cycle_id",
|
||||||
|
change_details: "",
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { state: "FAILED", element: "Issue detail page" },
|
||||||
|
updates: {
|
||||||
|
changed_property: "cycle_id",
|
||||||
|
change_details: "",
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Cycle remove from issue failed",
|
title: "Cycle remove from issue failed",
|
||||||
type: "error",
|
type: "error",
|
||||||
@ -159,13 +225,31 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = (props) => {
|
|||||||
},
|
},
|
||||||
addModulesToIssue: async (workspaceSlug: string, projectId: string, issueId: string, moduleIds: string[]) => {
|
addModulesToIssue: async (workspaceSlug: string, projectId: string, issueId: string, moduleIds: string[]) => {
|
||||||
try {
|
try {
|
||||||
await addModulesToIssue(workspaceSlug, projectId, issueId, moduleIds);
|
const response = await addModulesToIssue(workspaceSlug, projectId, issueId, moduleIds);
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Module added to issue successfully",
|
title: "Module added to issue successfully",
|
||||||
type: "success",
|
type: "success",
|
||||||
message: "Module added to issue successfully",
|
message: "Module added to issue successfully",
|
||||||
});
|
});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { ...response, state: "SUCCESS", element: "Issue detail page" },
|
||||||
|
updates: {
|
||||||
|
changed_property: "module_id",
|
||||||
|
change_details: moduleIds,
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { id: issueId, state: "FAILED", element: "Issue detail page" },
|
||||||
|
updates: {
|
||||||
|
changed_property: "module_id",
|
||||||
|
change_details: moduleIds,
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Module add to issue failed",
|
title: "Module add to issue failed",
|
||||||
type: "error",
|
type: "error",
|
||||||
@ -181,7 +265,25 @@ export const IssueDetailRoot: FC<TIssueDetailRoot> = (props) => {
|
|||||||
type: "success",
|
type: "success",
|
||||||
message: "Module removed from issue successfully",
|
message: "Module removed from issue successfully",
|
||||||
});
|
});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { id: issueId, state: "SUCCESS", element: "Issue detail page" },
|
||||||
|
updates: {
|
||||||
|
changed_property: "module_id",
|
||||||
|
change_details: "",
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { id: issueId, state: "FAILED", element: "Issue detail page" },
|
||||||
|
updates: {
|
||||||
|
changed_property: "module_id",
|
||||||
|
change_details: "",
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Module remove from issue failed",
|
title: "Module remove from issue failed",
|
||||||
type: "error",
|
type: "error",
|
||||||
|
@ -3,7 +3,7 @@ import { useRouter } from "next/router";
|
|||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
// hooks
|
// hooks
|
||||||
import { useProject } from "hooks/store";
|
import { useEventTracker, useProject } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
import useKeypress from "hooks/use-keypress";
|
import useKeypress from "hooks/use-keypress";
|
||||||
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
||||||
@ -64,6 +64,7 @@ export const CalendarQuickAddIssueForm: React.FC<Props> = observer((props) => {
|
|||||||
const { workspaceSlug, projectId } = router.query;
|
const { workspaceSlug, projectId } = router.query;
|
||||||
// store hooks
|
// store hooks
|
||||||
const { getProjectById } = useProject();
|
const { getProjectById } = useProject();
|
||||||
|
const { captureIssueEvent } = useEventTracker();
|
||||||
// refs
|
// refs
|
||||||
const ref = useRef<HTMLDivElement>(null);
|
const ref = useRef<HTMLDivElement>(null);
|
||||||
// states
|
// states
|
||||||
@ -126,7 +127,13 @@ export const CalendarQuickAddIssueForm: React.FC<Props> = observer((props) => {
|
|||||||
...payload,
|
...payload,
|
||||||
},
|
},
|
||||||
viewId
|
viewId
|
||||||
));
|
).then((res) => {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue created",
|
||||||
|
payload: { ...res, state: "SUCCESS", element: "Calendar quick add" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
|
}));
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "success",
|
type: "success",
|
||||||
title: "Success!",
|
title: "Success!",
|
||||||
@ -134,6 +141,11 @@ export const CalendarQuickAddIssueForm: React.FC<Props> = observer((props) => {
|
|||||||
});
|
});
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue created",
|
||||||
|
payload: { ...payload, state: "FAILED", element: "Calendar quick add" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "error",
|
type: "error",
|
||||||
title: "Error!",
|
title: "Error!",
|
||||||
|
@ -2,7 +2,7 @@ import { useState } from "react";
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { PlusIcon } from "lucide-react";
|
import { PlusIcon } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useIssueDetail, useIssues, useUser } from "hooks/store";
|
import { useApplication, useEventTracker, useIssueDetail, useIssues, useUser } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// components
|
// components
|
||||||
import { EmptyState } from "components/common";
|
import { EmptyState } from "components/common";
|
||||||
@ -32,8 +32,8 @@ export const CycleEmptyState: React.FC<Props> = observer((props) => {
|
|||||||
const { updateIssue, fetchIssue } = useIssueDetail();
|
const { updateIssue, fetchIssue } = useIssueDetail();
|
||||||
const {
|
const {
|
||||||
commandPalette: { toggleCreateIssueModal },
|
commandPalette: { toggleCreateIssueModal },
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
} = useApplication();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
const {
|
const {
|
||||||
membership: { currentProjectRole: userRole },
|
membership: { currentProjectRole: userRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
@ -81,7 +81,7 @@ export const CycleEmptyState: React.FC<Props> = observer((props) => {
|
|||||||
text: "New issue",
|
text: "New issue",
|
||||||
icon: <PlusIcon className="h-3 w-3" strokeWidth={2} />,
|
icon: <PlusIcon className="h-3 w-3" strokeWidth={2} />,
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
setTrackElement("CYCLE_EMPTY_STATE");
|
setTrackElement("Cycle issue empty state");
|
||||||
toggleCreateIssueModal(true, EIssuesStoreType.CYCLE);
|
toggleCreateIssueModal(true, EIssuesStoreType.CYCLE);
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { Plus, PlusIcon } from "lucide-react";
|
import { Plus, PlusIcon } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useProject } from "hooks/store";
|
import { useApplication, useEventTracker, useProject } from "hooks/store";
|
||||||
// components
|
// components
|
||||||
import { EmptyState } from "components/common";
|
import { EmptyState } from "components/common";
|
||||||
// assets
|
// assets
|
||||||
@ -12,8 +12,8 @@ export const GlobalViewEmptyState: React.FC = observer(() => {
|
|||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const {
|
||||||
commandPalette: { toggleCreateIssueModal, toggleCreateProjectModal },
|
commandPalette: { toggleCreateIssueModal, toggleCreateProjectModal },
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
} = useApplication();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
const { workspaceProjectIds } = useProject();
|
const { workspaceProjectIds } = useProject();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -27,7 +27,7 @@ export const GlobalViewEmptyState: React.FC = observer(() => {
|
|||||||
icon: <Plus className="h-4 w-4" />,
|
icon: <Plus className="h-4 w-4" />,
|
||||||
text: "New Project",
|
text: "New Project",
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
setTrackElement("ALL_ISSUES_EMPTY_STATE");
|
setTrackElement("All issues empty state");
|
||||||
toggleCreateProjectModal(true);
|
toggleCreateProjectModal(true);
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
@ -41,7 +41,7 @@ export const GlobalViewEmptyState: React.FC = observer(() => {
|
|||||||
text: "New issue",
|
text: "New issue",
|
||||||
icon: <PlusIcon className="h-3 w-3" strokeWidth={2} />,
|
icon: <PlusIcon className="h-3 w-3" strokeWidth={2} />,
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
setTrackElement("ALL_ISSUES_EMPTY_STATE");
|
setTrackElement("All issues empty state");
|
||||||
toggleCreateIssueModal(true);
|
toggleCreateIssueModal(true);
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
|
@ -2,7 +2,7 @@ import { useState } from "react";
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { PlusIcon } from "lucide-react";
|
import { PlusIcon } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useIssues, useUser } from "hooks/store";
|
import { useApplication, useEventTracker, useIssues, useUser } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// components
|
// components
|
||||||
import { EmptyState } from "components/common";
|
import { EmptyState } from "components/common";
|
||||||
@ -32,8 +32,8 @@ export const ModuleEmptyState: React.FC<Props> = observer((props) => {
|
|||||||
|
|
||||||
const {
|
const {
|
||||||
commandPalette: { toggleCreateIssueModal },
|
commandPalette: { toggleCreateIssueModal },
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
} = useApplication();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
const {
|
const {
|
||||||
membership: { currentProjectRole: userRole },
|
membership: { currentProjectRole: userRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
@ -76,7 +76,7 @@ export const ModuleEmptyState: React.FC<Props> = observer((props) => {
|
|||||||
text: "New issue",
|
text: "New issue",
|
||||||
icon: <PlusIcon className="h-3 w-3" strokeWidth={2} />,
|
icon: <PlusIcon className="h-3 w-3" strokeWidth={2} />,
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
setTrackElement("MODULE_EMPTY_STATE");
|
setTrackElement("Module issue empty state");
|
||||||
toggleCreateIssueModal(true, EIssuesStoreType.MODULE);
|
toggleCreateIssueModal(true, EIssuesStoreType.MODULE);
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
|
@ -3,7 +3,7 @@ import { useRouter } from "next/router";
|
|||||||
import size from "lodash/size";
|
import size from "lodash/size";
|
||||||
import { useTheme } from "next-themes";
|
import { useTheme } from "next-themes";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useIssues, useUser } from "hooks/store";
|
import { useApplication, useEventTracker, useIssues, useUser } from "hooks/store";
|
||||||
// components
|
// components
|
||||||
import { EmptyState, getEmptyStateImagePath } from "components/empty-state";
|
import { EmptyState, getEmptyStateImagePath } from "components/empty-state";
|
||||||
// constants
|
// constants
|
||||||
@ -30,10 +30,8 @@ export const ProjectEmptyState: React.FC = observer(() => {
|
|||||||
// theme
|
// theme
|
||||||
const { resolvedTheme } = useTheme();
|
const { resolvedTheme } = useTheme();
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { commandPalette: commandPaletteStore } = useApplication();
|
||||||
commandPalette: commandPaletteStore,
|
const { setTrackElement } = useEventTracker();
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
|
||||||
const {
|
const {
|
||||||
membership: { currentProjectRole },
|
membership: { currentProjectRole },
|
||||||
currentUser,
|
currentUser,
|
||||||
@ -90,7 +88,7 @@ export const ProjectEmptyState: React.FC = observer(() => {
|
|||||||
text: "Create your first issue",
|
text: "Create your first issue",
|
||||||
|
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
setTrackElement("PROJECT_EMPTY_STATE");
|
setTrackElement("Project issue empty state");
|
||||||
commandPaletteStore.toggleCreateIssueModal(true, EIssuesStoreType.PROJECT);
|
commandPaletteStore.toggleCreateIssueModal(true, EIssuesStoreType.PROJECT);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { PlusIcon } from "lucide-react";
|
import { PlusIcon } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication } from "hooks/store";
|
import { useApplication, useEventTracker } from "hooks/store";
|
||||||
// components
|
// components
|
||||||
import { EmptyState } from "components/common";
|
import { EmptyState } from "components/common";
|
||||||
// assets
|
// assets
|
||||||
@ -10,10 +10,8 @@ import { EIssuesStoreType } from "constants/issue";
|
|||||||
|
|
||||||
export const ProjectViewEmptyState: React.FC = observer(() => {
|
export const ProjectViewEmptyState: React.FC = observer(() => {
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { commandPalette: commandPaletteStore } = useApplication();
|
||||||
commandPalette: commandPaletteStore,
|
const { setTrackElement } = useEventTracker();
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="grid h-full w-full place-items-center">
|
<div className="grid h-full w-full place-items-center">
|
||||||
@ -25,7 +23,7 @@ export const ProjectViewEmptyState: React.FC = observer(() => {
|
|||||||
text: "New issue",
|
text: "New issue",
|
||||||
icon: <PlusIcon className="h-3 w-3" strokeWidth={2} />,
|
icon: <PlusIcon className="h-3 w-3" strokeWidth={2} />,
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
setTrackElement("VIEW_EMPTY_STATE");
|
setTrackElement("View issue empty state");
|
||||||
commandPaletteStore.toggleCreateIssueModal(true, EIssuesStoreType.PROJECT_VIEW);
|
commandPaletteStore.toggleCreateIssueModal(true, EIssuesStoreType.PROJECT_VIEW);
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
|
@ -4,7 +4,7 @@ import { useForm } from "react-hook-form";
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { PlusIcon } from "lucide-react";
|
import { PlusIcon } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useProject } from "hooks/store";
|
import { useEventTracker, useProject } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
import useKeypress from "hooks/use-keypress";
|
import useKeypress from "hooks/use-keypress";
|
||||||
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
||||||
@ -66,6 +66,7 @@ export const GanttQuickAddIssueForm: React.FC<IGanttQuickAddIssueForm> = observe
|
|||||||
const { workspaceSlug, projectId } = router.query;
|
const { workspaceSlug, projectId } = router.query;
|
||||||
// hooks
|
// hooks
|
||||||
const { getProjectById } = useProject();
|
const { getProjectById } = useProject();
|
||||||
|
const { captureIssueEvent } = useEventTracker();
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
|
|
||||||
const projectDetail = (projectId && getProjectById(projectId.toString())) || undefined;
|
const projectDetail = (projectId && getProjectById(projectId.toString())) || undefined;
|
||||||
@ -108,13 +109,24 @@ export const GanttQuickAddIssueForm: React.FC<IGanttQuickAddIssueForm> = observe
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
quickAddCallback &&
|
quickAddCallback &&
|
||||||
(await quickAddCallback(workspaceSlug.toString(), projectId.toString(), { ...payload }, viewId));
|
(await quickAddCallback(workspaceSlug.toString(), projectId.toString(), { ...payload }, viewId).then((res) => {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue created",
|
||||||
|
payload: { ...res, state: "SUCCESS", element: "Gantt quick add" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
|
}));
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "success",
|
type: "success",
|
||||||
title: "Success!",
|
title: "Success!",
|
||||||
message: "Issue created successfully.",
|
message: "Issue created successfully.",
|
||||||
});
|
});
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue created",
|
||||||
|
payload: { ...payload, state: "FAILED", element: "Gantt quick add" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "error",
|
type: "error",
|
||||||
title: "Error!",
|
title: "Error!",
|
||||||
|
@ -3,7 +3,7 @@ import { DragDropContext, DragStart, DraggableLocation, DropResult, Droppable }
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
// hooks
|
// hooks
|
||||||
import { useUser } from "hooks/store";
|
import { useEventTracker, useUser } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// ui
|
// ui
|
||||||
import { Spinner } from "@plane/ui";
|
import { Spinner } from "@plane/ui";
|
||||||
@ -73,6 +73,7 @@ export const BaseKanBanRoot: React.FC<IBaseKanBanLayout> = observer((props: IBas
|
|||||||
const {
|
const {
|
||||||
membership: { currentProjectRole },
|
membership: { currentProjectRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
|
const { captureIssueEvent } = useEventTracker();
|
||||||
const { issueMap } = useIssues();
|
const { issueMap } = useIssues();
|
||||||
// toast alert
|
// toast alert
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
@ -205,6 +206,11 @@ export const BaseKanBanRoot: React.FC<IBaseKanBanLayout> = observer((props: IBas
|
|||||||
handleIssues(issueMap[dragState.draggedIssueId!], EIssueActions.DELETE);
|
handleIssues(issueMap[dragState.draggedIssueId!], EIssueActions.DELETE);
|
||||||
setDeleteIssueModal(false);
|
setDeleteIssueModal(false);
|
||||||
setDragState({});
|
setDragState({});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue deleted",
|
||||||
|
payload: { id: dragState.draggedIssueId!, state: "FAILED", element: "Kanban layout drag & drop" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -44,8 +44,8 @@ const KanbanIssueDetailsBlock: React.FC<IssueDetailsBlockProps> = observer((prop
|
|||||||
} = useApplication();
|
} = useApplication();
|
||||||
const { setPeekIssue } = useIssueDetail();
|
const { setPeekIssue } = useIssueDetail();
|
||||||
|
|
||||||
const updateIssue = (issueToUpdate: TIssue) => {
|
const updateIssue = async (issueToUpdate: TIssue) => {
|
||||||
if (issueToUpdate) handleIssues(issueToUpdate, EIssueActions.UPDATE);
|
if (issueToUpdate) await handleIssues(issueToUpdate, EIssueActions.UPDATE);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleIssuePeekOverview = (issue: TIssue) =>
|
const handleIssuePeekOverview = (issue: TIssue) =>
|
||||||
@ -81,6 +81,7 @@ const KanbanIssueDetailsBlock: React.FC<IssueDetailsBlockProps> = observer((prop
|
|||||||
className="flex flex-wrap items-center gap-2 whitespace-nowrap"
|
className="flex flex-wrap items-center gap-2 whitespace-nowrap"
|
||||||
issue={issue}
|
issue={issue}
|
||||||
displayProperties={displayProperties}
|
displayProperties={displayProperties}
|
||||||
|
activeLayout="Kanban"
|
||||||
handleIssues={updateIssue}
|
handleIssues={updateIssue}
|
||||||
isReadOnly={isReadOnly}
|
isReadOnly={isReadOnly}
|
||||||
/>
|
/>
|
||||||
|
@ -8,6 +8,7 @@ import { CreateUpdateIssueModal, CreateUpdateDraftIssueModal } from "components/
|
|||||||
import { Minimize2, Maximize2, Circle, Plus } from "lucide-react";
|
import { Minimize2, Maximize2, Circle, Plus } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
|
import { useEventTracker } from "hooks/store";
|
||||||
// mobx
|
// mobx
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
// types
|
// types
|
||||||
@ -44,10 +45,12 @@ export const HeaderGroupByCard: FC<IHeaderGroupByCard> = observer((props) => {
|
|||||||
addIssuesToView,
|
addIssuesToView,
|
||||||
} = props;
|
} = props;
|
||||||
const verticalAlignPosition = sub_group_by ? false : kanbanFilters?.group_by.includes(column_id);
|
const verticalAlignPosition = sub_group_by ? false : kanbanFilters?.group_by.includes(column_id);
|
||||||
|
// states
|
||||||
const [isOpen, setIsOpen] = React.useState(false);
|
const [isOpen, setIsOpen] = React.useState(false);
|
||||||
const [openExistingIssueListModal, setOpenExistingIssueListModal] = React.useState(false);
|
const [openExistingIssueListModal, setOpenExistingIssueListModal] = React.useState(false);
|
||||||
|
// hooks
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
|
// router
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { workspaceSlug, projectId, moduleId, cycleId } = router.query;
|
const { workspaceSlug, projectId, moduleId, cycleId } = router.query;
|
||||||
|
|
||||||
@ -143,17 +146,30 @@ export const HeaderGroupByCard: FC<IHeaderGroupByCard> = observer((props) => {
|
|||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<CustomMenu.MenuItem onClick={() => setIsOpen(true)}>
|
<CustomMenu.MenuItem
|
||||||
|
onClick={() => {
|
||||||
|
setTrackElement("Kanban layout");
|
||||||
|
setIsOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
<span className="flex items-center justify-start gap-2">Create issue</span>
|
<span className="flex items-center justify-start gap-2">Create issue</span>
|
||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
<CustomMenu.MenuItem onClick={() => setOpenExistingIssueListModal(true)}>
|
<CustomMenu.MenuItem
|
||||||
|
onClick={() => {
|
||||||
|
setTrackElement("Kanban layout");
|
||||||
|
setOpenExistingIssueListModal(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
<span className="flex items-center justify-start gap-2">Add an existing issue</span>
|
<span className="flex items-center justify-start gap-2">Add an existing issue</span>
|
||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
</CustomMenu>
|
</CustomMenu>
|
||||||
) : (
|
) : (
|
||||||
<div
|
<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"
|
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={() => setIsOpen(true)}
|
onClick={() => {
|
||||||
|
setTrackElement("Kanban layout");
|
||||||
|
setIsOpen(true);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Plus width={14} strokeWidth={2} />
|
<Plus width={14} strokeWidth={2} />
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,7 +4,7 @@ import { useForm } from "react-hook-form";
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { PlusIcon } from "lucide-react";
|
import { PlusIcon } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useProject } from "hooks/store";
|
import { useEventTracker, useProject } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
import useKeypress from "hooks/use-keypress";
|
import useKeypress from "hooks/use-keypress";
|
||||||
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
||||||
@ -60,6 +60,7 @@ export const KanBanQuickAddIssueForm: React.FC<IKanBanQuickAddIssueForm> = obser
|
|||||||
const { workspaceSlug, projectId } = router.query;
|
const { workspaceSlug, projectId } = router.query;
|
||||||
// store hooks
|
// store hooks
|
||||||
const { getProjectById } = useProject();
|
const { getProjectById } = useProject();
|
||||||
|
const { captureIssueEvent } = useEventTracker();
|
||||||
|
|
||||||
const projectDetail = projectId ? getProjectById(projectId.toString()) : null;
|
const projectDetail = projectId ? getProjectById(projectId.toString()) : null;
|
||||||
|
|
||||||
@ -103,13 +104,24 @@ export const KanBanQuickAddIssueForm: React.FC<IKanBanQuickAddIssueForm> = obser
|
|||||||
...payload,
|
...payload,
|
||||||
},
|
},
|
||||||
viewId
|
viewId
|
||||||
));
|
).then((res) => {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue created",
|
||||||
|
payload: { ...res, state: "SUCCESS", element: "Kanban quick add" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
|
}));
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "success",
|
type: "success",
|
||||||
title: "Success!",
|
title: "Success!",
|
||||||
message: "Issue created successfully.",
|
message: "Issue created successfully.",
|
||||||
});
|
});
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue created",
|
||||||
|
payload: { ...payload, state: "FAILED", element: "Kanban quick add" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
console.error(err);
|
console.error(err);
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "error",
|
type: "error",
|
||||||
|
@ -14,7 +14,7 @@ import { EIssueActions } from "../types";
|
|||||||
interface IssueBlockProps {
|
interface IssueBlockProps {
|
||||||
issueId: string;
|
issueId: string;
|
||||||
issuesMap: TIssueMap;
|
issuesMap: TIssueMap;
|
||||||
handleIssues: (issue: TIssue, action: EIssueActions) => void;
|
handleIssues: (issue: TIssue, action: EIssueActions) => Promise<void>;
|
||||||
quickActions: (issue: TIssue) => React.ReactNode;
|
quickActions: (issue: TIssue) => React.ReactNode;
|
||||||
displayProperties: IIssueDisplayProperties | undefined;
|
displayProperties: IIssueDisplayProperties | undefined;
|
||||||
canEditProperties: (projectId: string | undefined) => boolean;
|
canEditProperties: (projectId: string | undefined) => boolean;
|
||||||
@ -29,8 +29,8 @@ export const IssueBlock: React.FC<IssueBlockProps> = observer((props: IssueBlock
|
|||||||
const { getProjectById } = useProject();
|
const { getProjectById } = useProject();
|
||||||
const { peekIssue, setPeekIssue } = useIssueDetail();
|
const { peekIssue, setPeekIssue } = useIssueDetail();
|
||||||
|
|
||||||
const updateIssue = (issueToUpdate: TIssue) => {
|
const updateIssue = async (issueToUpdate: TIssue) => {
|
||||||
handleIssues(issueToUpdate, EIssueActions.UPDATE);
|
await handleIssues(issueToUpdate, EIssueActions.UPDATE);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleIssuePeekOverview = (issue: TIssue) =>
|
const handleIssuePeekOverview = (issue: TIssue) =>
|
||||||
@ -88,6 +88,7 @@ export const IssueBlock: React.FC<IssueBlockProps> = observer((props: IssueBlock
|
|||||||
isReadOnly={!canEditIssueProperties}
|
isReadOnly={!canEditIssueProperties}
|
||||||
handleIssues={updateIssue}
|
handleIssues={updateIssue}
|
||||||
displayProperties={displayProperties}
|
displayProperties={displayProperties}
|
||||||
|
activeLayout="List"
|
||||||
/>
|
/>
|
||||||
{quickActions(issue)}
|
{quickActions(issue)}
|
||||||
</>
|
</>
|
||||||
|
@ -9,7 +9,7 @@ interface Props {
|
|||||||
issueIds: TGroupedIssues | TUnGroupedIssues | any;
|
issueIds: TGroupedIssues | TUnGroupedIssues | any;
|
||||||
issuesMap: TIssueMap;
|
issuesMap: TIssueMap;
|
||||||
canEditProperties: (projectId: string | undefined) => boolean;
|
canEditProperties: (projectId: string | undefined) => boolean;
|
||||||
handleIssues: (issue: TIssue, action: EIssueActions) => void;
|
handleIssues: (issue: TIssue, action: EIssueActions) => Promise<void>;
|
||||||
quickActions: (issue: TIssue) => React.ReactNode;
|
quickActions: (issue: TIssue) => React.ReactNode;
|
||||||
displayProperties: IIssueDisplayProperties | undefined;
|
displayProperties: IIssueDisplayProperties | undefined;
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,8 @@ import { ExistingIssuesListModal } from "components/core";
|
|||||||
import { CustomMenu } from "@plane/ui";
|
import { CustomMenu } from "@plane/ui";
|
||||||
// mobx
|
// mobx
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
|
// hooks
|
||||||
|
import { useEventTracker } from "hooks/store";
|
||||||
// types
|
// types
|
||||||
import { TIssue, ISearchIssueResponse } from "@plane/types";
|
import { TIssue, ISearchIssueResponse } from "@plane/types";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
@ -27,6 +29,8 @@ export const HeaderGroupByCard = observer(
|
|||||||
({ icon, title, count, issuePayload, disableIssueCreation, storeType, addIssuesToView }: IHeaderGroupByCard) => {
|
({ icon, title, count, issuePayload, disableIssueCreation, storeType, addIssuesToView }: IHeaderGroupByCard) => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { workspaceSlug, projectId, moduleId, cycleId } = router.query;
|
const { workspaceSlug, projectId, moduleId, cycleId } = router.query;
|
||||||
|
// hooks
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
|
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
|
|
||||||
@ -76,17 +80,30 @@ export const HeaderGroupByCard = observer(
|
|||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<CustomMenu.MenuItem onClick={() => setIsOpen(true)}>
|
<CustomMenu.MenuItem
|
||||||
|
onClick={() => {
|
||||||
|
setTrackElement("List layout");
|
||||||
|
setIsOpen(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
<span className="flex items-center justify-start gap-2">Create issue</span>
|
<span className="flex items-center justify-start gap-2">Create issue</span>
|
||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
<CustomMenu.MenuItem onClick={() => setOpenExistingIssueListModal(true)}>
|
<CustomMenu.MenuItem
|
||||||
|
onClick={() => {
|
||||||
|
setTrackElement("List layout");
|
||||||
|
setOpenExistingIssueListModal(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
<span className="flex items-center justify-start gap-2">Add an existing issue</span>
|
<span className="flex items-center justify-start gap-2">Add an existing issue</span>
|
||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
</CustomMenu>
|
</CustomMenu>
|
||||||
) : (
|
) : (
|
||||||
<div
|
<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"
|
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={() => setIsOpen(true)}
|
onClick={() => {
|
||||||
|
setTrackElement("List layout");
|
||||||
|
setIsOpen(true);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Plus width={14} strokeWidth={2} />
|
<Plus width={14} strokeWidth={2} />
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { FC, useEffect, useState, useRef } from "react";
|
import { FC, useEffect, useState, useRef, use } from "react";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { PlusIcon } from "lucide-react";
|
import { PlusIcon } from "lucide-react";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
// hooks
|
// hooks
|
||||||
import { useProject } from "hooks/store";
|
import { useEventTracker, useProject } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
import useKeypress from "hooks/use-keypress";
|
import useKeypress from "hooks/use-keypress";
|
||||||
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
||||||
@ -64,6 +64,7 @@ export const ListQuickAddIssueForm: FC<IListQuickAddIssueForm> = observer((props
|
|||||||
const { workspaceSlug, projectId } = router.query;
|
const { workspaceSlug, projectId } = router.query;
|
||||||
// hooks
|
// hooks
|
||||||
const { getProjectById } = useProject();
|
const { getProjectById } = useProject();
|
||||||
|
const { captureIssueEvent } = useEventTracker();
|
||||||
|
|
||||||
const projectDetail = (projectId && getProjectById(projectId.toString())) || undefined;
|
const projectDetail = (projectId && getProjectById(projectId.toString())) || undefined;
|
||||||
|
|
||||||
@ -100,13 +101,24 @@ export const ListQuickAddIssueForm: FC<IListQuickAddIssueForm> = observer((props
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
quickAddCallback &&
|
quickAddCallback &&
|
||||||
(await quickAddCallback(workspaceSlug.toString(), projectId.toString(), { ...payload }, viewId));
|
(await quickAddCallback(workspaceSlug.toString(), projectId.toString(), { ...payload }, viewId).then((res) => {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue created",
|
||||||
|
payload: { ...res, state: "SUCCESS", element: "List quick add" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
|
}));
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "success",
|
type: "success",
|
||||||
title: "Success!",
|
title: "Success!",
|
||||||
message: "Issue created successfully.",
|
message: "Issue created successfully.",
|
||||||
});
|
});
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue created",
|
||||||
|
payload: { ...payload, state: "FAILED", element: "List quick add" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "error",
|
type: "error",
|
||||||
title: "Error!",
|
title: "Error!",
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
import { CalendarCheck2, CalendarClock, Layers, Link, Paperclip } from "lucide-react";
|
import { CalendarCheck2, CalendarClock, Layers, Link, Paperclip } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useEstimate, useLabel } from "hooks/store";
|
import { useEventTracker, useEstimate, useLabel } from "hooks/store";
|
||||||
// components
|
// components
|
||||||
import { IssuePropertyLabels } from "../properties/labels";
|
import { IssuePropertyLabels } from "../properties/labels";
|
||||||
import { Tooltip } from "@plane/ui";
|
import { Tooltip } from "@plane/ui";
|
||||||
@ -20,43 +21,118 @@ import { TIssue, IIssueDisplayProperties, TIssuePriorities } from "@plane/types"
|
|||||||
|
|
||||||
export interface IIssueProperties {
|
export interface IIssueProperties {
|
||||||
issue: TIssue;
|
issue: TIssue;
|
||||||
handleIssues: (issue: TIssue) => void;
|
handleIssues: (issue: TIssue) => Promise<void>;
|
||||||
displayProperties: IIssueDisplayProperties | undefined;
|
displayProperties: IIssueDisplayProperties | undefined;
|
||||||
isReadOnly: boolean;
|
isReadOnly: boolean;
|
||||||
className: string;
|
className: string;
|
||||||
|
activeLayout: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
|
export const IssueProperties: React.FC<IIssueProperties> = observer((props) => {
|
||||||
const { issue, handleIssues, displayProperties, isReadOnly, className } = props;
|
const { issue, handleIssues, displayProperties, activeLayout, isReadOnly, className } = props;
|
||||||
|
// store hooks
|
||||||
const { labelMap } = useLabel();
|
const { labelMap } = useLabel();
|
||||||
|
const { captureIssueEvent } = useEventTracker();
|
||||||
|
// router
|
||||||
|
const router = useRouter();
|
||||||
const { areEstimatesEnabledForCurrentProject } = useEstimate();
|
const { areEstimatesEnabledForCurrentProject } = useEstimate();
|
||||||
|
const currentLayout = `${activeLayout} layout`;
|
||||||
const handleState = (stateId: string) => {
|
const handleState = (stateId: string) => {
|
||||||
handleIssues({ ...issue, state_id: stateId });
|
handleIssues({ ...issue, state_id: stateId }).then(() => {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { ...issue, state: "SUCCESS", element: currentLayout },
|
||||||
|
path: router.asPath,
|
||||||
|
updates: {
|
||||||
|
changed_property: "state",
|
||||||
|
change_details: stateId,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handlePriority = (value: TIssuePriorities) => {
|
const handlePriority = (value: TIssuePriorities) => {
|
||||||
handleIssues({ ...issue, priority: value });
|
handleIssues({ ...issue, priority: value }).then(() => {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { ...issue, state: "SUCCESS", element: currentLayout },
|
||||||
|
path: router.asPath,
|
||||||
|
updates: {
|
||||||
|
changed_property: "priority",
|
||||||
|
change_details: value,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleLabel = (ids: string[]) => {
|
const handleLabel = (ids: string[]) => {
|
||||||
handleIssues({ ...issue, label_ids: ids });
|
handleIssues({ ...issue, label_ids: ids }).then(() => {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { ...issue, state: "SUCCESS", element: currentLayout },
|
||||||
|
path: router.asPath,
|
||||||
|
updates: {
|
||||||
|
changed_property: "labels",
|
||||||
|
change_details: ids,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleAssignee = (ids: string[]) => {
|
const handleAssignee = (ids: string[]) => {
|
||||||
handleIssues({ ...issue, assignee_ids: ids });
|
handleIssues({ ...issue, assignee_ids: ids }).then(() => {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { ...issue, state: "SUCCESS", element: currentLayout },
|
||||||
|
path: router.asPath,
|
||||||
|
updates: {
|
||||||
|
changed_property: "assignees",
|
||||||
|
change_details: ids,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleStartDate = (date: Date | null) => {
|
const handleStartDate = (date: Date | null) => {
|
||||||
handleIssues({ ...issue, start_date: date ? renderFormattedPayloadDate(date) : null });
|
handleIssues({ ...issue, start_date: date ? renderFormattedPayloadDate(date) : null }).then(() => {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { ...issue, state: "SUCCESS", element: currentLayout },
|
||||||
|
path: router.asPath,
|
||||||
|
updates: {
|
||||||
|
changed_property: "start_date",
|
||||||
|
change_details: date ? renderFormattedPayloadDate(date) : null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleTargetDate = (date: Date | null) => {
|
const handleTargetDate = (date: Date | null) => {
|
||||||
handleIssues({ ...issue, target_date: date ? renderFormattedPayloadDate(date) : null });
|
handleIssues({ ...issue, target_date: date ? renderFormattedPayloadDate(date) : null }).then(() => {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { ...issue, state: "SUCCESS", element: currentLayout },
|
||||||
|
path: router.asPath,
|
||||||
|
updates: {
|
||||||
|
changed_property: "target_date",
|
||||||
|
change_details: date ? renderFormattedPayloadDate(date) : null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleEstimate = (value: number | null) => {
|
const handleEstimate = (value: number | null) => {
|
||||||
handleIssues({ ...issue, estimate_point: value });
|
handleIssues({ ...issue, estimate_point: value }).then(() => {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { ...issue, state: "SUCCESS", element: currentLayout },
|
||||||
|
path: router.asPath,
|
||||||
|
updates: {
|
||||||
|
changed_property: "estimate_point",
|
||||||
|
change_details: value,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!displayProperties) return null;
|
if (!displayProperties) return null;
|
||||||
|
@ -4,6 +4,7 @@ import { CustomMenu } from "@plane/ui";
|
|||||||
import { Copy, Link, Pencil, Trash2 } from "lucide-react";
|
import { Copy, Link, Pencil, Trash2 } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
|
import { useEventTracker } from "hooks/store";
|
||||||
// components
|
// components
|
||||||
import { CreateUpdateIssueModal, DeleteIssueModal } from "components/issues";
|
import { CreateUpdateIssueModal, DeleteIssueModal } from "components/issues";
|
||||||
// helpers
|
// helpers
|
||||||
@ -23,6 +24,8 @@ export const AllIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
|||||||
// router
|
// router
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { workspaceSlug } = router.query;
|
const { workspaceSlug } = router.query;
|
||||||
|
// hooks
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
// toast alert
|
// toast alert
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
|
|
||||||
@ -81,6 +84,7 @@ export const AllIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
|||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
<CustomMenu.MenuItem
|
<CustomMenu.MenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
setTrackElement("Global issues");
|
||||||
setIssueToEdit(issue);
|
setIssueToEdit(issue);
|
||||||
setCreateUpdateIssueModal(true);
|
setCreateUpdateIssueModal(true);
|
||||||
}}
|
}}
|
||||||
@ -92,6 +96,7 @@ export const AllIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
|||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
<CustomMenu.MenuItem
|
<CustomMenu.MenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
setTrackElement("Global issues");
|
||||||
setCreateUpdateIssueModal(true);
|
setCreateUpdateIssueModal(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -102,6 +107,7 @@ export const AllIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
|||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
<CustomMenu.MenuItem
|
<CustomMenu.MenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
setTrackElement("Global issues");
|
||||||
setDeleteIssueModal(true);
|
setDeleteIssueModal(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -4,23 +4,30 @@ import { CustomMenu } from "@plane/ui";
|
|||||||
import { Link, Trash2 } from "lucide-react";
|
import { Link, Trash2 } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
|
import { useEventTracker, useIssues } from "hooks/store";
|
||||||
// components
|
// components
|
||||||
import { DeleteArchivedIssueModal } from "components/issues";
|
import { DeleteArchivedIssueModal } from "components/issues";
|
||||||
// helpers
|
// helpers
|
||||||
import { copyUrlToClipboard } from "helpers/string.helper";
|
import { copyUrlToClipboard } from "helpers/string.helper";
|
||||||
// types
|
// types
|
||||||
import { IQuickActionProps } from "../list/list-view-types";
|
import { IQuickActionProps } from "../list/list-view-types";
|
||||||
|
// constants
|
||||||
|
import { EIssuesStoreType } from "constants/issue";
|
||||||
|
|
||||||
export const ArchivedIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
export const ArchivedIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
||||||
const { issue, handleDelete, customActionButton, portalElement } = props;
|
const { issue, handleDelete, customActionButton, portalElement } = props;
|
||||||
|
// router
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { workspaceSlug } = router.query;
|
const { workspaceSlug } = router.query;
|
||||||
|
|
||||||
// states
|
// states
|
||||||
const [deleteIssueModal, setDeleteIssueModal] = useState(false);
|
const [deleteIssueModal, setDeleteIssueModal] = useState(false);
|
||||||
|
// toast alert
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
|
// store hooks
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
|
const { issuesFilter } = useIssues(EIssuesStoreType.ARCHIVED);
|
||||||
|
|
||||||
|
const activeLayout = `${issuesFilter.issueFilters?.displayFilters?.layout} layout`;
|
||||||
|
|
||||||
const handleCopyIssueLink = () => {
|
const handleCopyIssueLink = () => {
|
||||||
copyUrlToClipboard(`${workspaceSlug}/projects/${issue.project}/archived-issues/${issue.id}`).then(() =>
|
copyUrlToClipboard(`${workspaceSlug}/projects/${issue.project}/archived-issues/${issue.id}`).then(() =>
|
||||||
@ -59,6 +66,7 @@ export const ArchivedIssueQuickActions: React.FC<IQuickActionProps> = (props) =>
|
|||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
<CustomMenu.MenuItem
|
<CustomMenu.MenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
setTrackElement(activeLayout);
|
||||||
setDeleteIssueModal(true);
|
setDeleteIssueModal(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -4,6 +4,7 @@ import { CustomMenu } from "@plane/ui";
|
|||||||
import { Copy, Link, Pencil, Trash2, XCircle } from "lucide-react";
|
import { Copy, Link, Pencil, Trash2, XCircle } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
|
import { useEventTracker, useIssues } from "hooks/store";
|
||||||
// components
|
// components
|
||||||
import { CreateUpdateIssueModal, DeleteIssueModal } from "components/issues";
|
import { CreateUpdateIssueModal, DeleteIssueModal } from "components/issues";
|
||||||
// helpers
|
// helpers
|
||||||
@ -23,9 +24,14 @@ export const CycleIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
|||||||
// router
|
// router
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { workspaceSlug, cycleId } = router.query;
|
const { workspaceSlug, cycleId } = router.query;
|
||||||
|
// store hooks
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
|
const { issuesFilter } = useIssues(EIssuesStoreType.CYCLE);
|
||||||
// toast alert
|
// toast alert
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
|
|
||||||
|
const activeLayout = `${issuesFilter.issueFilters?.displayFilters?.layout} layout`;
|
||||||
|
|
||||||
const handleCopyIssueLink = () => {
|
const handleCopyIssueLink = () => {
|
||||||
copyUrlToClipboard(`${workspaceSlug}/projects/${issue.project}/issues/${issue.id}`).then(() =>
|
copyUrlToClipboard(`${workspaceSlug}/projects/${issue.project}/issues/${issue.id}`).then(() =>
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
@ -85,6 +91,7 @@ export const CycleIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
|||||||
...issue,
|
...issue,
|
||||||
cycle: cycleId?.toString() ?? null,
|
cycle: cycleId?.toString() ?? null,
|
||||||
});
|
});
|
||||||
|
setTrackElement(activeLayout);
|
||||||
setCreateUpdateIssueModal(true);
|
setCreateUpdateIssueModal(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -105,6 +112,7 @@ export const CycleIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
|||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
<CustomMenu.MenuItem
|
<CustomMenu.MenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
setTrackElement(activeLayout);
|
||||||
setCreateUpdateIssueModal(true);
|
setCreateUpdateIssueModal(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -115,6 +123,7 @@ export const CycleIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
|||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
<CustomMenu.MenuItem
|
<CustomMenu.MenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
setTrackElement(activeLayout);
|
||||||
setDeleteIssueModal(true);
|
setDeleteIssueModal(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -4,6 +4,7 @@ import { CustomMenu } from "@plane/ui";
|
|||||||
import { Copy, Link, Pencil, Trash2, XCircle } from "lucide-react";
|
import { Copy, Link, Pencil, Trash2, XCircle } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
|
import { useIssues, useEventTracker } from "hooks/store";
|
||||||
// components
|
// components
|
||||||
import { CreateUpdateIssueModal, DeleteIssueModal } from "components/issues";
|
import { CreateUpdateIssueModal, DeleteIssueModal } from "components/issues";
|
||||||
// helpers
|
// helpers
|
||||||
@ -23,9 +24,14 @@ export const ModuleIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
|||||||
// router
|
// router
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { workspaceSlug, moduleId } = router.query;
|
const { workspaceSlug, moduleId } = router.query;
|
||||||
|
// store hooks
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
|
const { issuesFilter } = useIssues(EIssuesStoreType.MODULE);
|
||||||
// toast alert
|
// toast alert
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
|
|
||||||
|
const activeLayout = `${issuesFilter.issueFilters?.displayFilters?.layout} layout`;
|
||||||
|
|
||||||
const handleCopyIssueLink = () => {
|
const handleCopyIssueLink = () => {
|
||||||
copyUrlToClipboard(`${workspaceSlug}/projects/${issue.project}/issues/${issue.id}`).then(() =>
|
copyUrlToClipboard(`${workspaceSlug}/projects/${issue.project}/issues/${issue.id}`).then(() =>
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
@ -82,6 +88,7 @@ export const ModuleIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
|||||||
<CustomMenu.MenuItem
|
<CustomMenu.MenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIssueToEdit({ ...issue, module: moduleId?.toString() ?? null });
|
setIssueToEdit({ ...issue, module: moduleId?.toString() ?? null });
|
||||||
|
setTrackElement(activeLayout);
|
||||||
setCreateUpdateIssueModal(true);
|
setCreateUpdateIssueModal(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -102,6 +109,7 @@ export const ModuleIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
|||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
<CustomMenu.MenuItem
|
<CustomMenu.MenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
setTrackElement(activeLayout);
|
||||||
setCreateUpdateIssueModal(true);
|
setCreateUpdateIssueModal(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -114,6 +122,7 @@ export const ModuleIssueQuickActions: React.FC<IQuickActionProps> = (props) => {
|
|||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
setTrackElement(activeLayout);
|
||||||
setDeleteIssueModal(true);
|
setDeleteIssueModal(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -3,7 +3,7 @@ import { useRouter } from "next/router";
|
|||||||
import { CustomMenu } from "@plane/ui";
|
import { CustomMenu } from "@plane/ui";
|
||||||
import { Copy, Link, Pencil, Trash2 } from "lucide-react";
|
import { Copy, Link, Pencil, Trash2 } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useUser } from "hooks/store";
|
import { useEventTracker, useIssues, useUser } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// components
|
// components
|
||||||
import { CreateUpdateIssueModal, DeleteIssueModal } from "components/issues";
|
import { CreateUpdateIssueModal, DeleteIssueModal } from "components/issues";
|
||||||
@ -29,6 +29,10 @@ export const ProjectIssueQuickActions: React.FC<IQuickActionProps> = (props) =>
|
|||||||
const {
|
const {
|
||||||
membership: { currentProjectRole },
|
membership: { currentProjectRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
|
const { issuesFilter } = useIssues(EIssuesStoreType.PROJECT);
|
||||||
|
|
||||||
|
const activeLayout = `${issuesFilter.issueFilters?.displayFilters?.layout} layout`;
|
||||||
|
|
||||||
const isEditingAllowed = !!currentProjectRole && currentProjectRole >= EUserProjectRoles.MEMBER;
|
const isEditingAllowed = !!currentProjectRole && currentProjectRole >= EUserProjectRoles.MEMBER;
|
||||||
|
|
||||||
@ -91,6 +95,7 @@ export const ProjectIssueQuickActions: React.FC<IQuickActionProps> = (props) =>
|
|||||||
<>
|
<>
|
||||||
<CustomMenu.MenuItem
|
<CustomMenu.MenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
setTrackElement(activeLayout);
|
||||||
setIssueToEdit(issue);
|
setIssueToEdit(issue);
|
||||||
setCreateUpdateIssueModal(true);
|
setCreateUpdateIssueModal(true);
|
||||||
}}
|
}}
|
||||||
@ -102,6 +107,7 @@ export const ProjectIssueQuickActions: React.FC<IQuickActionProps> = (props) =>
|
|||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
<CustomMenu.MenuItem
|
<CustomMenu.MenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
setTrackElement(activeLayout);
|
||||||
setCreateUpdateIssueModal(true);
|
setCreateUpdateIssueModal(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -112,6 +118,7 @@ export const ProjectIssueQuickActions: React.FC<IQuickActionProps> = (props) =>
|
|||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
<CustomMenu.MenuItem
|
<CustomMenu.MenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
setTrackElement(activeLayout);
|
||||||
setDeleteIssueModal(true);
|
setDeleteIssueModal(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -5,7 +5,7 @@ import useSWR from "swr";
|
|||||||
import isEmpty from "lodash/isEmpty";
|
import isEmpty from "lodash/isEmpty";
|
||||||
import { useTheme } from "next-themes";
|
import { useTheme } from "next-themes";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useGlobalView, useIssues, useProject, useUser } from "hooks/store";
|
import { useApplication, useEventTracker, useGlobalView, useIssues, useProject, useUser } from "hooks/store";
|
||||||
import { useWorkspaceIssueProperties } from "hooks/use-workspace-issue-properties";
|
import { useWorkspaceIssueProperties } from "hooks/use-workspace-issue-properties";
|
||||||
// components
|
// components
|
||||||
import { GlobalViewsAppliedFiltersRoot, IssuePeekOverview } from "components/issues";
|
import { GlobalViewsAppliedFiltersRoot, IssuePeekOverview } from "components/issues";
|
||||||
@ -44,6 +44,7 @@ export const AllIssueLayoutRoot: React.FC = observer(() => {
|
|||||||
} = useUser();
|
} = useUser();
|
||||||
const { fetchAllGlobalViews } = useGlobalView();
|
const { fetchAllGlobalViews } = useGlobalView();
|
||||||
const { workspaceProjectIds } = useProject();
|
const { workspaceProjectIds } = useProject();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
|
|
||||||
const isDefaultView = ["all-issues", "assigned", "created", "subscribed"].includes(groupedIssueIds.dataViewId);
|
const isDefaultView = ["all-issues", "assigned", "created", "subscribed"].includes(groupedIssueIds.dataViewId);
|
||||||
const currentView = isDefaultView ? groupedIssueIds.dataViewId : "custom-view";
|
const currentView = isDefaultView ? groupedIssueIds.dataViewId : "custom-view";
|
||||||
@ -201,12 +202,18 @@ export const AllIssueLayoutRoot: React.FC = observer(() => {
|
|||||||
? currentView !== "custom-view" && currentView !== "subscribed"
|
? currentView !== "custom-view" && currentView !== "subscribed"
|
||||||
? {
|
? {
|
||||||
text: "Create new issue",
|
text: "Create new issue",
|
||||||
onClick: () => commandPaletteStore.toggleCreateIssueModal(true, EIssuesStoreType.PROJECT),
|
onClick: () => {
|
||||||
|
setTrackElement("All issues empty state");
|
||||||
|
commandPaletteStore.toggleCreateIssueModal(true, EIssuesStoreType.PROJECT);
|
||||||
|
},
|
||||||
}
|
}
|
||||||
: undefined
|
: undefined
|
||||||
: {
|
: {
|
||||||
text: "Start your first project",
|
text: "Start your first project",
|
||||||
onClick: () => commandPaletteStore.toggleCreateProjectModal(true),
|
onClick: () => {
|
||||||
|
setTrackElement("All issues empty state");
|
||||||
|
commandPaletteStore.toggleCreateProjectModal(true);
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
disabled={!isEditingAllowed}
|
disabled={!isEditingAllowed}
|
||||||
|
@ -7,7 +7,7 @@ import { TIssue } from "@plane/types";
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
issue: TIssue;
|
issue: TIssue;
|
||||||
onChange: (issue: TIssue, data: Partial<TIssue>) => void;
|
onChange: (issue: TIssue, data: Partial<TIssue>, updates: any) => void;
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -18,7 +18,16 @@ export const SpreadsheetAssigneeColumn: React.FC<Props> = observer((props: Props
|
|||||||
<div className="h-11 border-b-[0.5px] border-custom-border-200">
|
<div className="h-11 border-b-[0.5px] border-custom-border-200">
|
||||||
<ProjectMemberDropdown
|
<ProjectMemberDropdown
|
||||||
value={issue?.assignee_ids ?? []}
|
value={issue?.assignee_ids ?? []}
|
||||||
onChange={(data) => onChange(issue, { assignee_ids: data })}
|
onChange={(data) => {
|
||||||
|
onChange(
|
||||||
|
issue,
|
||||||
|
{ assignee_ids: data },
|
||||||
|
{
|
||||||
|
changed_property: "assignees",
|
||||||
|
change_details: data,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}}
|
||||||
projectId={issue?.project_id}
|
projectId={issue?.project_id}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
multiple
|
multiple
|
||||||
|
@ -9,7 +9,7 @@ import { TIssue } from "@plane/types";
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
issue: TIssue;
|
issue: TIssue;
|
||||||
onChange: (issue: TIssue, data: Partial<TIssue>) => void;
|
onChange: (issue: TIssue, data: Partial<TIssue>, updates: any) => void;
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -20,7 +20,17 @@ export const SpreadsheetDueDateColumn: React.FC<Props> = observer((props: Props)
|
|||||||
<div className="h-11 border-b-[0.5px] border-custom-border-200">
|
<div className="h-11 border-b-[0.5px] border-custom-border-200">
|
||||||
<DateDropdown
|
<DateDropdown
|
||||||
value={issue.target_date}
|
value={issue.target_date}
|
||||||
onChange={(data) => onChange(issue, { target_date: data ? renderFormattedPayloadDate(data) : null })}
|
onChange={(data) => {
|
||||||
|
const targetDate = data ? renderFormattedPayloadDate(data) : null;
|
||||||
|
onChange(
|
||||||
|
issue,
|
||||||
|
{ target_date: targetDate },
|
||||||
|
{
|
||||||
|
changed_property: "target_date",
|
||||||
|
change_details: targetDate,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
placeholder="Due date"
|
placeholder="Due date"
|
||||||
buttonVariant="transparent-with-text"
|
buttonVariant="transparent-with-text"
|
||||||
|
@ -6,7 +6,7 @@ import { TIssue } from "@plane/types";
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
issue: TIssue;
|
issue: TIssue;
|
||||||
onChange: (issue: TIssue, data: Partial<TIssue>) => void;
|
onChange: (issue: TIssue, data: Partial<TIssue>, updates: any) => void;
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -17,7 +17,9 @@ export const SpreadsheetEstimateColumn: React.FC<Props> = observer((props: Props
|
|||||||
<div className="h-11 border-b-[0.5px] border-custom-border-200">
|
<div className="h-11 border-b-[0.5px] border-custom-border-200">
|
||||||
<EstimateDropdown
|
<EstimateDropdown
|
||||||
value={issue.estimate_point}
|
value={issue.estimate_point}
|
||||||
onChange={(data) => onChange(issue, { estimate_point: data })}
|
onChange={(data) =>
|
||||||
|
onChange(issue, { estimate_point: data }, { changed_property: "estimate_point", change_details: data })
|
||||||
|
}
|
||||||
projectId={issue.project_id}
|
projectId={issue.project_id}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
buttonVariant="transparent-with-text"
|
buttonVariant="transparent-with-text"
|
||||||
|
@ -9,7 +9,7 @@ import { TIssue } from "@plane/types";
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
issue: TIssue;
|
issue: TIssue;
|
||||||
onChange: (issue: TIssue, data: Partial<TIssue>) => void;
|
onChange: (issue: TIssue, data: Partial<TIssue>, updates: any) => void;
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -25,9 +25,7 @@ export const SpreadsheetLabelColumn: React.FC<Props> = observer((props: Props) =
|
|||||||
projectId={issue.project_id ?? null}
|
projectId={issue.project_id ?? null}
|
||||||
value={issue.label_ids}
|
value={issue.label_ids}
|
||||||
defaultOptions={defaultLabelOptions}
|
defaultOptions={defaultLabelOptions}
|
||||||
onChange={(data) => {
|
onChange={(data) => onChange(issue, { label_ids: data },{ changed_property: "labels", change_details: data })}
|
||||||
onChange(issue, { label_ids: data });
|
|
||||||
}}
|
|
||||||
className="h-11 w-full border-b-[0.5px] border-custom-border-200 hover:bg-custom-background-80"
|
className="h-11 w-full border-b-[0.5px] border-custom-border-200 hover:bg-custom-background-80"
|
||||||
buttonClassName="px-2.5 h-full"
|
buttonClassName="px-2.5 h-full"
|
||||||
hideDropdownArrow
|
hideDropdownArrow
|
||||||
|
@ -7,7 +7,7 @@ import { TIssue } from "@plane/types";
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
issue: TIssue;
|
issue: TIssue;
|
||||||
onChange: (issue: TIssue, data: Partial<TIssue>) => void;
|
onChange: (issue: TIssue, data: Partial<TIssue>,updates:any) => void;
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ export const SpreadsheetPriorityColumn: React.FC<Props> = observer((props: Props
|
|||||||
<div className="h-11 border-b-[0.5px] border-custom-border-200">
|
<div className="h-11 border-b-[0.5px] border-custom-border-200">
|
||||||
<PriorityDropdown
|
<PriorityDropdown
|
||||||
value={issue.priority}
|
value={issue.priority}
|
||||||
onChange={(data) => onChange(issue, { priority: data })}
|
onChange={(data) => onChange(issue, { priority: data },{changed_property:"priority",change_details:data})}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
buttonVariant="transparent-with-text"
|
buttonVariant="transparent-with-text"
|
||||||
buttonClassName="rounded-none text-left"
|
buttonClassName="rounded-none text-left"
|
||||||
|
@ -9,7 +9,7 @@ import { TIssue } from "@plane/types";
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
issue: TIssue;
|
issue: TIssue;
|
||||||
onChange: (issue: TIssue, data: Partial<TIssue>) => void;
|
onChange: (issue: TIssue, data: Partial<TIssue>, updates: any) => void;
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -20,7 +20,17 @@ export const SpreadsheetStartDateColumn: React.FC<Props> = observer((props: Prop
|
|||||||
<div className="h-11 border-b-[0.5px] border-custom-border-200">
|
<div className="h-11 border-b-[0.5px] border-custom-border-200">
|
||||||
<DateDropdown
|
<DateDropdown
|
||||||
value={issue.start_date}
|
value={issue.start_date}
|
||||||
onChange={(data) => onChange(issue, { start_date: data ? renderFormattedPayloadDate(data) : null })}
|
onChange={(data) => {
|
||||||
|
const startDate = data ? renderFormattedPayloadDate(data) : null;
|
||||||
|
onChange(
|
||||||
|
issue,
|
||||||
|
{ start_date: startDate },
|
||||||
|
{
|
||||||
|
changed_property: "start_date",
|
||||||
|
change_details: startDate,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
placeholder="Start date"
|
placeholder="Start date"
|
||||||
buttonVariant="transparent-with-text"
|
buttonVariant="transparent-with-text"
|
||||||
|
@ -7,7 +7,7 @@ import { TIssue } from "@plane/types";
|
|||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
issue: TIssue;
|
issue: TIssue;
|
||||||
onChange: (issue: TIssue, data: Partial<TIssue>) => void;
|
onChange: (issue: TIssue, data: Partial<TIssue>, updates: any) => void;
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ export const SpreadsheetStateColumn: React.FC<Props> = observer((props) => {
|
|||||||
<StateDropdown
|
<StateDropdown
|
||||||
projectId={issue.project_id}
|
projectId={issue.project_id}
|
||||||
value={issue.state_id}
|
value={issue.state_id}
|
||||||
onChange={(data) => onChange(issue, { state_id: data })}
|
onChange={(data) => onChange(issue, { state_id: data }, { changed_property: "state", change_details: data })}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
buttonVariant="transparent-with-text"
|
buttonVariant="transparent-with-text"
|
||||||
buttonClassName="rounded-none text-left"
|
buttonClassName="rounded-none text-left"
|
||||||
|
@ -11,7 +11,7 @@ import { WithDisplayPropertiesHOC } from "../properties/with-display-properties-
|
|||||||
import { ControlLink, Tooltip } from "@plane/ui";
|
import { ControlLink, Tooltip } from "@plane/ui";
|
||||||
// hooks
|
// hooks
|
||||||
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
||||||
import { useIssueDetail, useProject } from "hooks/store";
|
import { useEventTracker, useIssueDetail, useProject } from "hooks/store";
|
||||||
// helper
|
// helper
|
||||||
import { cn } from "helpers/common.helper";
|
import { cn } from "helpers/common.helper";
|
||||||
// types
|
// types
|
||||||
@ -51,6 +51,7 @@ export const SpreadsheetIssueRow = observer((props: Props) => {
|
|||||||
//hooks
|
//hooks
|
||||||
const { getProjectById } = useProject();
|
const { getProjectById } = useProject();
|
||||||
const { peekIssue, setPeekIssue } = useIssueDetail();
|
const { peekIssue, setPeekIssue } = useIssueDetail();
|
||||||
|
const { captureIssueEvent } = useEventTracker();
|
||||||
// states
|
// states
|
||||||
const [isMenuActive, setIsMenuActive] = useState(false);
|
const [isMenuActive, setIsMenuActive] = useState(false);
|
||||||
const [isExpanded, setExpanded] = useState<boolean>(false);
|
const [isExpanded, setExpanded] = useState<boolean>(false);
|
||||||
@ -174,8 +175,19 @@ export const SpreadsheetIssueRow = observer((props: Props) => {
|
|||||||
<td className="h-11 w-full min-w-[8rem] bg-custom-background-100 text-sm after:absolute after:w-full after:bottom-[-1px] after:border after:border-custom-border-100 border-r-[1px] border-custom-border-100">
|
<td className="h-11 w-full min-w-[8rem] bg-custom-background-100 text-sm after:absolute after:w-full after:bottom-[-1px] after:border after:border-custom-border-100 border-r-[1px] border-custom-border-100">
|
||||||
<Column
|
<Column
|
||||||
issue={issueDetail}
|
issue={issueDetail}
|
||||||
onChange={(issue: TIssue, data: Partial<TIssue>) =>
|
onChange={(issue: TIssue, data: Partial<TIssue>, updates: any) =>
|
||||||
handleIssues({ ...issue, ...data }, EIssueActions.UPDATE)
|
handleIssues({ ...issue, ...data }, EIssueActions.UPDATE).then(() => {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: {
|
||||||
|
...issue,
|
||||||
|
...data,
|
||||||
|
element: "Spreadsheet layout",
|
||||||
|
},
|
||||||
|
updates: updates,
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
|
})
|
||||||
}
|
}
|
||||||
disabled={disableUserActions}
|
disabled={disableUserActions}
|
||||||
/>
|
/>
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import { useEffect, useState, useRef } from "react";
|
import { useEffect, useState, useRef } from "react";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { PlusIcon } from "lucide-react";
|
import { PlusIcon } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useProject, useWorkspace } from "hooks/store";
|
import { useEventTracker, useProject, useWorkspace } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
import useKeypress from "hooks/use-keypress";
|
import useKeypress from "hooks/use-keypress";
|
||||||
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
||||||
@ -58,6 +59,9 @@ export const SpreadsheetQuickAddIssueForm: React.FC<Props> = observer((props) =>
|
|||||||
// store hooks
|
// store hooks
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const { currentProjectDetails } = useProject();
|
const { currentProjectDetails } = useProject();
|
||||||
|
const { captureIssueEvent } = useEventTracker();
|
||||||
|
// router
|
||||||
|
const router = useRouter();
|
||||||
// form info
|
// form info
|
||||||
const {
|
const {
|
||||||
reset,
|
reset,
|
||||||
@ -155,13 +159,26 @@ export const SpreadsheetQuickAddIssueForm: React.FC<Props> = observer((props) =>
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
quickAddCallback &&
|
quickAddCallback &&
|
||||||
(await quickAddCallback(currentWorkspace.slug, currentProjectDetails.id, { ...payload } as TIssue, viewId));
|
(await quickAddCallback(currentWorkspace.slug, currentProjectDetails.id, { ...payload } as TIssue, viewId).then(
|
||||||
|
(res) => {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue created",
|
||||||
|
payload: { ...res, state: "SUCCESS", element: "Spreadsheet quick add" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
));
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "success",
|
type: "success",
|
||||||
title: "Success!",
|
title: "Success!",
|
||||||
message: "Issue created successfully.",
|
message: "Issue created successfully.",
|
||||||
});
|
});
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue created",
|
||||||
|
payload: { ...payload, state: "FAILED", element: "Spreadsheet quick add" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
console.error(err);
|
console.error(err);
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "error",
|
type: "error",
|
||||||
|
@ -3,6 +3,7 @@ import { useRouter } from "next/router";
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
// hooks
|
// hooks
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
|
import { useEventTracker } from "hooks/store";
|
||||||
// services
|
// services
|
||||||
import { IssueDraftService } from "services/issue";
|
import { IssueDraftService } from "services/issue";
|
||||||
// components
|
// components
|
||||||
@ -42,6 +43,8 @@ export const DraftIssueLayout: React.FC<DraftIssueProps> = observer((props) => {
|
|||||||
const { workspaceSlug } = router.query;
|
const { workspaceSlug } = router.query;
|
||||||
// toast alert
|
// toast alert
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
|
// store hooks
|
||||||
|
const { captureIssueEvent } = useEventTracker();
|
||||||
|
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
if (changesMade) setIssueDiscardModal(true);
|
if (changesMade) setIssueDiscardModal(true);
|
||||||
@ -55,24 +58,33 @@ export const DraftIssueLayout: React.FC<DraftIssueProps> = observer((props) => {
|
|||||||
|
|
||||||
await issueDraftService
|
await issueDraftService
|
||||||
.createDraftIssue(workspaceSlug.toString(), projectId.toString(), payload)
|
.createDraftIssue(workspaceSlug.toString(), projectId.toString(), payload)
|
||||||
.then(() => {
|
.then((res) => {
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "success",
|
type: "success",
|
||||||
title: "Success!",
|
title: "Success!",
|
||||||
message: "Draft Issue created successfully.",
|
message: "Draft Issue created successfully.",
|
||||||
});
|
});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Draft issue created",
|
||||||
|
payload: { ...res, state: "SUCCESS" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
onChange(null);
|
onChange(null);
|
||||||
setIssueDiscardModal(false);
|
setIssueDiscardModal(false);
|
||||||
onClose(false);
|
onClose(false);
|
||||||
})
|
})
|
||||||
.catch(() =>
|
.catch(() => {
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "error",
|
type: "error",
|
||||||
title: "Error!",
|
title: "Error!",
|
||||||
message: "Issue could not be created. Please try again.",
|
message: "Issue could not be created. Please try again.",
|
||||||
})
|
});
|
||||||
);
|
captureIssueEvent({
|
||||||
|
eventName: "Draft issue created",
|
||||||
|
payload: { ...payload, state: "FAILED" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { Dialog, Transition } from "@headlessui/react";
|
import { Dialog, Transition } from "@headlessui/react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useCycle, useIssues, useModule, useProject, useWorkspace } from "hooks/store";
|
import { useApplication, useEventTracker, useCycle, useIssues, useModule, useProject, useWorkspace } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
import useLocalStorage from "hooks/use-local-storage";
|
import useLocalStorage from "hooks/use-local-storage";
|
||||||
// components
|
// components
|
||||||
@ -12,7 +13,6 @@ import { IssueFormRoot } from "./form";
|
|||||||
import type { TIssue } from "@plane/types";
|
import type { TIssue } from "@plane/types";
|
||||||
// constants
|
// constants
|
||||||
import { EIssuesStoreType, TCreateModalStoreTypes } from "constants/issue";
|
import { EIssuesStoreType, TCreateModalStoreTypes } from "constants/issue";
|
||||||
|
|
||||||
export interface IssuesModalProps {
|
export interface IssuesModalProps {
|
||||||
data?: Partial<TIssue>;
|
data?: Partial<TIssue>;
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
@ -29,9 +29,7 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer((prop
|
|||||||
const [createMore, setCreateMore] = useState(false);
|
const [createMore, setCreateMore] = useState(false);
|
||||||
const [activeProjectId, setActiveProjectId] = useState<string | null>(null);
|
const [activeProjectId, setActiveProjectId] = useState<string | null>(null);
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { captureIssueEvent } = useEventTracker();
|
||||||
eventTracker: { postHogEventTracker },
|
|
||||||
} = useApplication();
|
|
||||||
const {
|
const {
|
||||||
router: { workspaceSlug, projectId, cycleId, moduleId, viewId: projectViewId },
|
router: { workspaceSlug, projectId, cycleId, moduleId, viewId: projectViewId },
|
||||||
} = useApplication();
|
} = useApplication();
|
||||||
@ -67,6 +65,8 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer((prop
|
|||||||
viewId: moduleId,
|
viewId: moduleId,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
// router
|
||||||
|
const router = useRouter();
|
||||||
// toast alert
|
// toast alert
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
// local storage
|
// local storage
|
||||||
@ -141,18 +141,16 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer((prop
|
|||||||
title: "Success!",
|
title: "Success!",
|
||||||
message: "Issue created successfully.",
|
message: "Issue created successfully.",
|
||||||
});
|
});
|
||||||
postHogEventTracker(
|
captureIssueEvent({
|
||||||
"ISSUE_CREATED",
|
eventName: "Issue created",
|
||||||
{
|
payload: { ...response, state: "SUCCESS" },
|
||||||
...response,
|
path: router.asPath,
|
||||||
state: "SUCCESS",
|
group: {
|
||||||
},
|
|
||||||
{
|
|
||||||
isGrouping: true,
|
isGrouping: true,
|
||||||
groupType: "Workspace_metrics",
|
groupType: "Workspace_metrics",
|
||||||
groupId: currentWorkspace?.id!,
|
groupId: currentWorkspace?.id!,
|
||||||
}
|
},
|
||||||
);
|
});
|
||||||
!createMore && handleClose();
|
!createMore && handleClose();
|
||||||
return response;
|
return response;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -161,17 +159,16 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer((prop
|
|||||||
title: "Error!",
|
title: "Error!",
|
||||||
message: "Issue could not be created. Please try again.",
|
message: "Issue could not be created. Please try again.",
|
||||||
});
|
});
|
||||||
postHogEventTracker(
|
captureIssueEvent({
|
||||||
"ISSUE_CREATED",
|
eventName: "Issue created",
|
||||||
{
|
payload: { ...payload, state: "FAILED" },
|
||||||
state: "FAILED",
|
path: router.asPath,
|
||||||
},
|
group: {
|
||||||
{
|
|
||||||
isGrouping: true,
|
isGrouping: true,
|
||||||
groupType: "Workspace_metrics",
|
groupType: "Workspace_metrics",
|
||||||
groupId: currentWorkspace?.id!,
|
groupId: currentWorkspace?.id!,
|
||||||
}
|
},
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -185,18 +182,16 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer((prop
|
|||||||
title: "Success!",
|
title: "Success!",
|
||||||
message: "Issue updated successfully.",
|
message: "Issue updated successfully.",
|
||||||
});
|
});
|
||||||
postHogEventTracker(
|
captureIssueEvent({
|
||||||
"ISSUE_UPDATED",
|
eventName: "Issue updated",
|
||||||
{
|
payload: { ...response, state: "SUCCESS" },
|
||||||
...response,
|
path: router.asPath,
|
||||||
state: "SUCCESS",
|
group: {
|
||||||
},
|
|
||||||
{
|
|
||||||
isGrouping: true,
|
isGrouping: true,
|
||||||
groupType: "Workspace_metrics",
|
groupType: "Workspace_metrics",
|
||||||
groupId: currentWorkspace?.id!,
|
groupId: currentWorkspace?.id!,
|
||||||
}
|
},
|
||||||
);
|
});
|
||||||
handleClose();
|
handleClose();
|
||||||
return response;
|
return response;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -205,17 +200,16 @@ export const CreateUpdateIssueModal: React.FC<IssuesModalProps> = observer((prop
|
|||||||
title: "Error!",
|
title: "Error!",
|
||||||
message: "Issue could not be created. Please try again.",
|
message: "Issue could not be created. Please try again.",
|
||||||
});
|
});
|
||||||
postHogEventTracker(
|
captureIssueEvent({
|
||||||
"ISSUE_UPDATED",
|
eventName: "Issue updated",
|
||||||
{
|
payload: { ...payload, state: "FAILED" },
|
||||||
state: "FAILED",
|
path: router.asPath,
|
||||||
},
|
group: {
|
||||||
{
|
|
||||||
isGrouping: true,
|
isGrouping: true,
|
||||||
groupType: "Workspace_metrics",
|
groupType: "Workspace_metrics",
|
||||||
groupId: currentWorkspace?.id!,
|
groupId: currentWorkspace?.id!,
|
||||||
}
|
},
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { FC, Fragment, useEffect, useState, useMemo } from "react";
|
import { FC, Fragment, useEffect, useState, useMemo } from "react";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
// hooks
|
// hooks
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
import { useIssueDetail, useIssues, useUser } from "hooks/store";
|
import { useEventTracker, useIssueDetail, useIssues, useUser } from "hooks/store";
|
||||||
// components
|
// components
|
||||||
import { IssueView } from "components/issues";
|
import { IssueView } from "components/issues";
|
||||||
// types
|
// types
|
||||||
@ -47,6 +48,8 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
|
|||||||
const { is_archived = false, onIssueUpdate } = props;
|
const { is_archived = false, onIssueUpdate } = props;
|
||||||
// hooks
|
// hooks
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
|
// router
|
||||||
|
const router = useRouter();
|
||||||
const {
|
const {
|
||||||
membership: { currentWorkspaceAllProjectsRole },
|
membership: { currentWorkspaceAllProjectsRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
@ -61,6 +64,7 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
|
|||||||
} = useIssueDetail();
|
} = useIssueDetail();
|
||||||
const { addIssueToCycle, removeIssueFromCycle, addModulesToIssue, removeIssueFromModule, removeModulesFromIssue } =
|
const { addIssueToCycle, removeIssueFromCycle, addModulesToIssue, removeIssueFromModule, removeModulesFromIssue } =
|
||||||
useIssueDetail();
|
useIssueDetail();
|
||||||
|
const { captureIssueEvent } = useEventTracker();
|
||||||
// state
|
// state
|
||||||
const [loader, setLoader] = useState(false);
|
const [loader, setLoader] = useState(false);
|
||||||
|
|
||||||
@ -98,7 +102,21 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
|
|||||||
type: "success",
|
type: "success",
|
||||||
message: "Issue updated successfully",
|
message: "Issue updated successfully",
|
||||||
});
|
});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { ...response, state: "SUCCESS", element: "Issue peek-overview" },
|
||||||
|
updates: {
|
||||||
|
changed_property: Object.keys(data).join(","),
|
||||||
|
change_details: Object.values(data).join(","),
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { state: "FAILED", element: "Issue peek-overview" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Issue update failed",
|
title: "Issue update failed",
|
||||||
type: "error",
|
type: "error",
|
||||||
@ -108,30 +126,59 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
|
|||||||
},
|
},
|
||||||
remove: async (workspaceSlug: string, projectId: string, issueId: string) => {
|
remove: async (workspaceSlug: string, projectId: string, issueId: string) => {
|
||||||
try {
|
try {
|
||||||
if (is_archived) await removeArchivedIssue(workspaceSlug, projectId, issueId);
|
let response;
|
||||||
else await removeIssue(workspaceSlug, projectId, issueId);
|
if (is_archived) response = await removeArchivedIssue(workspaceSlug, projectId, issueId);
|
||||||
|
else response = await removeIssue(workspaceSlug, projectId, issueId);
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Issue deleted successfully",
|
title: "Issue deleted successfully",
|
||||||
type: "success",
|
type: "success",
|
||||||
message: "Issue deleted successfully",
|
message: "Issue deleted successfully",
|
||||||
});
|
});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue deleted",
|
||||||
|
payload: { id: issueId, state: "SUCCESS", element: "Issue peek-overview" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Issue delete failed",
|
title: "Issue delete failed",
|
||||||
type: "error",
|
type: "error",
|
||||||
message: "Issue delete failed",
|
message: "Issue delete failed",
|
||||||
});
|
});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue deleted",
|
||||||
|
payload: { id: issueId, state: "FAILED", element: "Issue peek-overview" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addIssueToCycle: async (workspaceSlug: string, projectId: string, cycleId: string, issueIds: string[]) => {
|
addIssueToCycle: async (workspaceSlug: string, projectId: string, cycleId: string, issueIds: string[]) => {
|
||||||
try {
|
try {
|
||||||
await addIssueToCycle(workspaceSlug, projectId, cycleId, issueIds);
|
const response = await addIssueToCycle(workspaceSlug, projectId, cycleId, issueIds);
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Cycle added to issue successfully",
|
title: "Cycle added to issue successfully",
|
||||||
type: "success",
|
type: "success",
|
||||||
message: "Issue added to issue successfully",
|
message: "Issue added to issue successfully",
|
||||||
});
|
});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { ...response, state: "SUCCESS", element: "Issue peek-overview" },
|
||||||
|
updates: {
|
||||||
|
changed_property: "cycle_id",
|
||||||
|
change_details: cycleId,
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { state: "FAILED", element: "Issue peek-overview" },
|
||||||
|
updates: {
|
||||||
|
changed_property: "cycle_id",
|
||||||
|
change_details: cycleId,
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Cycle add to issue failed",
|
title: "Cycle add to issue failed",
|
||||||
type: "error",
|
type: "error",
|
||||||
@ -141,29 +188,65 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
|
|||||||
},
|
},
|
||||||
removeIssueFromCycle: async (workspaceSlug: string, projectId: string, cycleId: string, issueId: string) => {
|
removeIssueFromCycle: async (workspaceSlug: string, projectId: string, cycleId: string, issueId: string) => {
|
||||||
try {
|
try {
|
||||||
await removeIssueFromCycle(workspaceSlug, projectId, cycleId, issueId);
|
const response = await removeIssueFromCycle(workspaceSlug, projectId, cycleId, issueId);
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Cycle removed from issue successfully",
|
title: "Cycle removed from issue successfully",
|
||||||
type: "success",
|
type: "success",
|
||||||
message: "Cycle removed from issue successfully",
|
message: "Cycle removed from issue successfully",
|
||||||
});
|
});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { ...response, state: "SUCCESS", element: "Issue peek-overview" },
|
||||||
|
updates: {
|
||||||
|
changed_property: "cycle_id",
|
||||||
|
change_details: "",
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Cycle remove from issue failed",
|
title: "Cycle remove from issue failed",
|
||||||
type: "error",
|
type: "error",
|
||||||
message: "Cycle remove from issue failed",
|
message: "Cycle remove from issue failed",
|
||||||
});
|
});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { state: "FAILED", element: "Issue peek-overview" },
|
||||||
|
updates: {
|
||||||
|
changed_property: "cycle_id",
|
||||||
|
change_details: "",
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addModulesToIssue: async (workspaceSlug: string, projectId: string, issueId: string, moduleIds: string[]) => {
|
addModulesToIssue: async (workspaceSlug: string, projectId: string, issueId: string, moduleIds: string[]) => {
|
||||||
try {
|
try {
|
||||||
await addModulesToIssue(workspaceSlug, projectId, issueId, moduleIds);
|
const response = await addModulesToIssue(workspaceSlug, projectId, issueId, moduleIds);
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Module added to issue successfully",
|
title: "Module added to issue successfully",
|
||||||
type: "success",
|
type: "success",
|
||||||
message: "Module added to issue successfully",
|
message: "Module added to issue successfully",
|
||||||
});
|
});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { ...response, state: "SUCCESS", element: "Issue peek-overview" },
|
||||||
|
updates: {
|
||||||
|
changed_property: "module_id",
|
||||||
|
change_details: moduleIds,
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { id: issueId, state: "FAILED", element: "Issue peek-overview" },
|
||||||
|
updates: {
|
||||||
|
changed_property: "module_id",
|
||||||
|
change_details: moduleIds,
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Module add to issue failed",
|
title: "Module add to issue failed",
|
||||||
type: "error",
|
type: "error",
|
||||||
@ -179,7 +262,25 @@ export const IssuePeekOverview: FC<IIssuePeekOverview> = observer((props) => {
|
|||||||
type: "success",
|
type: "success",
|
||||||
message: "Module removed from issue successfully",
|
message: "Module removed from issue successfully",
|
||||||
});
|
});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { id: issueId, state: "SUCCESS", element: "Issue peek-overview" },
|
||||||
|
updates: {
|
||||||
|
changed_property: "module_id",
|
||||||
|
change_details: "",
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Issue updated",
|
||||||
|
payload: { id: issueId, state: "FAILED", element: "Issue peek-overview" },
|
||||||
|
updates: {
|
||||||
|
changed_property: "module_id",
|
||||||
|
change_details: "",
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
title: "Module remove from issue failed",
|
title: "Module remove from issue failed",
|
||||||
type: "error",
|
type: "error",
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { FC, useMemo, useState } from "react";
|
import { FC, useMemo, useState } from "react";
|
||||||
|
import { useRouter } from "next/router";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { Plus, ChevronRight, ChevronDown, Loader } from "lucide-react";
|
import { Plus, ChevronRight, ChevronDown, Loader } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useIssueDetail } from "hooks/store";
|
import { useEventTracker, useIssueDetail } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// components
|
// components
|
||||||
import { ExistingIssuesListModal } from "components/core";
|
import { ExistingIssuesListModal } from "components/core";
|
||||||
@ -43,6 +44,8 @@ export type TSubIssueOperations = {
|
|||||||
|
|
||||||
export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
|
export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
|
||||||
const { workspaceSlug, projectId, parentIssueId, disabled = false } = props;
|
const { workspaceSlug, projectId, parentIssueId, disabled = false } = props;
|
||||||
|
// router
|
||||||
|
const router = useRouter();
|
||||||
// store hooks
|
// store hooks
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
const {
|
const {
|
||||||
@ -54,6 +57,7 @@ export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
|
|||||||
removeSubIssue,
|
removeSubIssue,
|
||||||
deleteSubIssue,
|
deleteSubIssue,
|
||||||
} = useIssueDetail();
|
} = useIssueDetail();
|
||||||
|
const { setTrackElement, captureIssueEvent } = useEventTracker();
|
||||||
// state
|
// state
|
||||||
|
|
||||||
type TIssueCrudState = { toggle: boolean; parentIssueId: string | undefined; issue: TIssue | undefined };
|
type TIssueCrudState = { toggle: boolean; parentIssueId: string | undefined; issue: TIssue | undefined };
|
||||||
@ -151,6 +155,15 @@ export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
|
|||||||
try {
|
try {
|
||||||
setSubIssueHelpers(parentIssueId, "issue_loader", issueId);
|
setSubIssueHelpers(parentIssueId, "issue_loader", issueId);
|
||||||
await updateSubIssue(workspaceSlug, projectId, parentIssueId, issueId, issueData, oldIssue, fromModal);
|
await updateSubIssue(workspaceSlug, projectId, parentIssueId, issueId, issueData, oldIssue, fromModal);
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Sub-issue updated",
|
||||||
|
payload: { ...oldIssue, ...issueData, state: "SUCCESS", element: "Issue detail page" },
|
||||||
|
updates: {
|
||||||
|
changed_property: Object.keys(issueData).join(","),
|
||||||
|
change_details: Object.values(issueData).join(","),
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "success",
|
type: "success",
|
||||||
title: "Sub-issue updated successfully",
|
title: "Sub-issue updated successfully",
|
||||||
@ -158,6 +171,15 @@ export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
|
|||||||
});
|
});
|
||||||
setSubIssueHelpers(parentIssueId, "issue_loader", issueId);
|
setSubIssueHelpers(parentIssueId, "issue_loader", issueId);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Sub-issue updated",
|
||||||
|
payload: { ...oldIssue, ...issueData, state: "FAILED", element: "Issue detail page" },
|
||||||
|
updates: {
|
||||||
|
changed_property: Object.keys(issueData).join(","),
|
||||||
|
change_details: Object.values(issueData).join(","),
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "error",
|
type: "error",
|
||||||
title: "Error updating sub-issue",
|
title: "Error updating sub-issue",
|
||||||
@ -174,8 +196,26 @@ export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
|
|||||||
title: "Sub-issue removed successfully",
|
title: "Sub-issue removed successfully",
|
||||||
message: "Sub-issue removed successfully",
|
message: "Sub-issue removed successfully",
|
||||||
});
|
});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Sub-issue removed",
|
||||||
|
payload: { id: issueId, state: "SUCCESS", element: "Issue detail page" },
|
||||||
|
updates: {
|
||||||
|
changed_property: "parent_id",
|
||||||
|
change_details: parentIssueId,
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
setSubIssueHelpers(parentIssueId, "issue_loader", issueId);
|
setSubIssueHelpers(parentIssueId, "issue_loader", issueId);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Sub-issue removed",
|
||||||
|
payload: { id: issueId, state: "FAILED", element: "Issue detail page" },
|
||||||
|
updates: {
|
||||||
|
changed_property: "parent_id",
|
||||||
|
change_details: parentIssueId,
|
||||||
|
},
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "error",
|
type: "error",
|
||||||
title: "Error removing sub-issue",
|
title: "Error removing sub-issue",
|
||||||
@ -192,8 +232,18 @@ export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
|
|||||||
title: "Issue deleted successfully",
|
title: "Issue deleted successfully",
|
||||||
message: "Issue deleted successfully",
|
message: "Issue deleted successfully",
|
||||||
});
|
});
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Sub-issue deleted",
|
||||||
|
payload: { id: issueId, state: "SUCCESS", element: "Issue detail page" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
setSubIssueHelpers(parentIssueId, "issue_loader", issueId);
|
setSubIssueHelpers(parentIssueId, "issue_loader", issueId);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
captureIssueEvent({
|
||||||
|
eventName: "Sub-issue removed",
|
||||||
|
payload: { id: issueId, state: "FAILED", element: "Issue detail page" },
|
||||||
|
path: router.asPath,
|
||||||
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "error",
|
type: "error",
|
||||||
title: "Error deleting issue",
|
title: "Error deleting issue",
|
||||||
@ -258,13 +308,19 @@ export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
|
|||||||
<div className="ml-auto flex flex-shrink-0 select-none items-center gap-2">
|
<div className="ml-auto flex flex-shrink-0 select-none items-center gap-2">
|
||||||
<div
|
<div
|
||||||
className="cursor-pointer rounded border border-custom-border-100 p-1.5 px-2 shadow transition-all hover:bg-custom-background-80"
|
className="cursor-pointer rounded border border-custom-border-100 p-1.5 px-2 shadow transition-all hover:bg-custom-background-80"
|
||||||
onClick={() => handleIssueCrudState("create", parentIssueId, null)}
|
onClick={() => {
|
||||||
|
setTrackElement("Issue detail add sub-issue");
|
||||||
|
handleIssueCrudState("create", parentIssueId, null);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
Add sub-issue
|
Add sub-issue
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="cursor-pointer rounded border border-custom-border-100 p-1.5 px-2 shadow transition-all hover:bg-custom-background-80"
|
className="cursor-pointer rounded border border-custom-border-100 p-1.5 px-2 shadow transition-all hover:bg-custom-background-80"
|
||||||
onClick={() => handleIssueCrudState("existing", parentIssueId, null)}
|
onClick={() => {
|
||||||
|
setTrackElement("Issue detail add sub-issue");
|
||||||
|
handleIssueCrudState("existing", parentIssueId, null);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
Add an existing issue
|
Add an existing issue
|
||||||
</div>
|
</div>
|
||||||
@ -301,6 +357,7 @@ export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
|
|||||||
>
|
>
|
||||||
<CustomMenu.MenuItem
|
<CustomMenu.MenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
setTrackElement("Issue detail add sub-issue");
|
||||||
handleIssueCrudState("create", parentIssueId, null);
|
handleIssueCrudState("create", parentIssueId, null);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -308,6 +365,7 @@ export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
|
|||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
<CustomMenu.MenuItem
|
<CustomMenu.MenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
setTrackElement("Issue detail add sub-issue");
|
||||||
handleIssueCrudState("existing", parentIssueId, null);
|
handleIssueCrudState("existing", parentIssueId, null);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -335,6 +393,7 @@ export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
|
|||||||
>
|
>
|
||||||
<CustomMenu.MenuItem
|
<CustomMenu.MenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
setTrackElement("Issue detail nested sub-issue");
|
||||||
handleIssueCrudState("create", parentIssueId, null);
|
handleIssueCrudState("create", parentIssueId, null);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -342,6 +401,7 @@ export const SubIssuesRoot: FC<ISubIssuesRoot> = observer((props) => {
|
|||||||
</CustomMenu.MenuItem>
|
</CustomMenu.MenuItem>
|
||||||
<CustomMenu.MenuItem
|
<CustomMenu.MenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
setTrackElement("Issue detail nested sub-issue");
|
||||||
handleIssueCrudState("existing", parentIssueId, null);
|
handleIssueCrudState("existing", parentIssueId, null);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -3,7 +3,7 @@ import { useRouter } from "next/router";
|
|||||||
import { Dialog, Transition } from "@headlessui/react";
|
import { Dialog, Transition } from "@headlessui/react";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useModule } from "hooks/store";
|
import { useEventTracker, useModule } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// ui
|
// ui
|
||||||
import { Button } from "@plane/ui";
|
import { Button } from "@plane/ui";
|
||||||
@ -26,9 +26,7 @@ export const DeleteModuleModal: React.FC<Props> = observer((props) => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { workspaceSlug, projectId, moduleId, peekModule } = router.query;
|
const { workspaceSlug, projectId, moduleId, peekModule } = router.query;
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { captureModuleEvent } = useEventTracker();
|
||||||
eventTracker: { postHogEventTracker },
|
|
||||||
} = useApplication();
|
|
||||||
const { deleteModule } = useModule();
|
const { deleteModule } = useModule();
|
||||||
// toast alert
|
// toast alert
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
@ -52,8 +50,9 @@ export const DeleteModuleModal: React.FC<Props> = observer((props) => {
|
|||||||
title: "Success!",
|
title: "Success!",
|
||||||
message: "Module deleted successfully.",
|
message: "Module deleted successfully.",
|
||||||
});
|
});
|
||||||
postHogEventTracker("MODULE_DELETED", {
|
captureModuleEvent({
|
||||||
state: "SUCCESS",
|
eventName: "Module deleted",
|
||||||
|
payload: { ...data, state: "SUCCESS" },
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
@ -62,8 +61,9 @@ export const DeleteModuleModal: React.FC<Props> = observer((props) => {
|
|||||||
title: "Error!",
|
title: "Error!",
|
||||||
message: "Module could not be deleted. Please try again.",
|
message: "Module could not be deleted. Please try again.",
|
||||||
});
|
});
|
||||||
postHogEventTracker("MODULE_DELETED", {
|
captureModuleEvent({
|
||||||
state: "FAILED",
|
eventName: "Module deleted",
|
||||||
|
payload: { ...data, state: "FAILED" },
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
@ -3,7 +3,7 @@ import { observer } from "mobx-react-lite";
|
|||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { Dialog, Transition } from "@headlessui/react";
|
import { Dialog, Transition } from "@headlessui/react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useModule, useProject } from "hooks/store";
|
import { useEventTracker, useModule, useProject } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// components
|
// components
|
||||||
import { ModuleForm } from "components/modules";
|
import { ModuleForm } from "components/modules";
|
||||||
@ -31,9 +31,7 @@ export const CreateUpdateModuleModal: React.FC<Props> = observer((props) => {
|
|||||||
// states
|
// states
|
||||||
const [activeProject, setActiveProject] = useState<string | null>(null);
|
const [activeProject, setActiveProject] = useState<string | null>(null);
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { captureModuleEvent } = useEventTracker();
|
||||||
eventTracker: { postHogEventTracker },
|
|
||||||
} = useApplication();
|
|
||||||
const { workspaceProjectIds } = useProject();
|
const { workspaceProjectIds } = useProject();
|
||||||
const { createModule, updateModuleDetails } = useModule();
|
const { createModule, updateModuleDetails } = useModule();
|
||||||
// toast alert
|
// toast alert
|
||||||
@ -55,15 +53,14 @@ export const CreateUpdateModuleModal: React.FC<Props> = observer((props) => {
|
|||||||
await createModule(workspaceSlug.toString(), selectedProjectId, payload)
|
await createModule(workspaceSlug.toString(), selectedProjectId, payload)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
handleClose();
|
handleClose();
|
||||||
|
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "success",
|
type: "success",
|
||||||
title: "Success!",
|
title: "Success!",
|
||||||
message: "Module created successfully.",
|
message: "Module created successfully.",
|
||||||
});
|
});
|
||||||
postHogEventTracker("MODULE_CREATED", {
|
captureModuleEvent({
|
||||||
...res,
|
eventName: "Module created",
|
||||||
state: "SUCCESS",
|
payload: { ...res, state: "SUCCESS" },
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
@ -72,8 +69,9 @@ export const CreateUpdateModuleModal: React.FC<Props> = observer((props) => {
|
|||||||
title: "Error!",
|
title: "Error!",
|
||||||
message: err.detail ?? "Module could not be created. Please try again.",
|
message: err.detail ?? "Module could not be created. Please try again.",
|
||||||
});
|
});
|
||||||
postHogEventTracker("MODULE_CREATED", {
|
captureModuleEvent({
|
||||||
state: "FAILED",
|
eventName: "Module created",
|
||||||
|
payload: { ...data, state: "FAILED" },
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -91,9 +89,9 @@ export const CreateUpdateModuleModal: React.FC<Props> = observer((props) => {
|
|||||||
title: "Success!",
|
title: "Success!",
|
||||||
message: "Module updated successfully.",
|
message: "Module updated successfully.",
|
||||||
});
|
});
|
||||||
postHogEventTracker("MODULE_UPDATED", {
|
captureModuleEvent({
|
||||||
...res,
|
eventName: "Module updated",
|
||||||
state: "SUCCESS",
|
payload: { ...res, state: "SUCCESS" },
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
@ -102,8 +100,9 @@ export const CreateUpdateModuleModal: React.FC<Props> = observer((props) => {
|
|||||||
title: "Error!",
|
title: "Error!",
|
||||||
message: err.detail ?? "Module could not be updated. Please try again.",
|
message: err.detail ?? "Module could not be updated. Please try again.",
|
||||||
});
|
});
|
||||||
postHogEventTracker("MODULE_UPDATED", {
|
captureModuleEvent({
|
||||||
state: "FAILED",
|
eventName: "Module updated",
|
||||||
|
payload: { ...data, state: "FAILED" },
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -4,7 +4,7 @@ import { useRouter } from "next/router";
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { Info, LinkIcon, Pencil, Star, Trash2 } from "lucide-react";
|
import { Info, LinkIcon, Pencil, Star, Trash2 } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useModule, useUser } from "hooks/store";
|
import { useEventTracker, useModule, useUser } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// components
|
// components
|
||||||
import { CreateUpdateModuleModal, DeleteModuleModal } from "components/modules";
|
import { CreateUpdateModuleModal, DeleteModuleModal } from "components/modules";
|
||||||
@ -36,6 +36,7 @@ export const ModuleCardItem: React.FC<Props> = observer((props) => {
|
|||||||
membership: { currentProjectRole },
|
membership: { currentProjectRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
const { getModuleById, addModuleToFavorites, removeModuleFromFavorites } = useModule();
|
const { getModuleById, addModuleToFavorites, removeModuleFromFavorites } = useModule();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
// derived values
|
// derived values
|
||||||
const moduleDetails = getModuleById(moduleId);
|
const moduleDetails = getModuleById(moduleId);
|
||||||
const isEditingAllowed = !!currentProjectRole && currentProjectRole >= EUserProjectRoles.MEMBER;
|
const isEditingAllowed = !!currentProjectRole && currentProjectRole >= EUserProjectRoles.MEMBER;
|
||||||
@ -83,12 +84,14 @@ export const ModuleCardItem: React.FC<Props> = observer((props) => {
|
|||||||
const handleEditModule = (e: React.MouseEvent<HTMLButtonElement>) => {
|
const handleEditModule = (e: React.MouseEvent<HTMLButtonElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
setTrackElement("Modules page board layout");
|
||||||
setEditModal(true);
|
setEditModal(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleDeleteModule = (e: React.MouseEvent<HTMLButtonElement>) => {
|
const handleDeleteModule = (e: React.MouseEvent<HTMLButtonElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
setTrackElement("Modules page board layout");
|
||||||
setDeleteModal(true);
|
setDeleteModal(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import { useRouter } from "next/router";
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { Check, Info, LinkIcon, Pencil, Star, Trash2, User2 } from "lucide-react";
|
import { Check, Info, LinkIcon, Pencil, Star, Trash2, User2 } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useModule, useUser } from "hooks/store";
|
import { useModule, useUser, useEventTracker } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// components
|
// components
|
||||||
import { CreateUpdateModuleModal, DeleteModuleModal } from "components/modules";
|
import { CreateUpdateModuleModal, DeleteModuleModal } from "components/modules";
|
||||||
@ -36,6 +36,7 @@ export const ModuleListItem: React.FC<Props> = observer((props) => {
|
|||||||
membership: { currentProjectRole },
|
membership: { currentProjectRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
const { getModuleById, addModuleToFavorites, removeModuleFromFavorites } = useModule();
|
const { getModuleById, addModuleToFavorites, removeModuleFromFavorites } = useModule();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
// derived values
|
// derived values
|
||||||
const moduleDetails = getModuleById(moduleId);
|
const moduleDetails = getModuleById(moduleId);
|
||||||
const isEditingAllowed = !!currentProjectRole && currentProjectRole >= EUserProjectRoles.MEMBER;
|
const isEditingAllowed = !!currentProjectRole && currentProjectRole >= EUserProjectRoles.MEMBER;
|
||||||
@ -83,12 +84,14 @@ export const ModuleListItem: React.FC<Props> = observer((props) => {
|
|||||||
const handleEditModule = (e: React.MouseEvent<HTMLButtonElement>) => {
|
const handleEditModule = (e: React.MouseEvent<HTMLButtonElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
setTrackElement("Modules page list layout");
|
||||||
setEditModal(true);
|
setEditModal(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleDeleteModule = (e: React.MouseEvent<HTMLButtonElement>) => {
|
const handleDeleteModule = (e: React.MouseEvent<HTMLButtonElement>) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
setTrackElement("Modules page list layout");
|
||||||
setDeleteModal(true);
|
setDeleteModal(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import { useRouter } from "next/router";
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { useTheme } from "next-themes";
|
import { useTheme } from "next-themes";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useModule, useUser } from "hooks/store";
|
import { useApplication, useEventTracker, useModule, useUser } from "hooks/store";
|
||||||
import useLocalStorage from "hooks/use-local-storage";
|
import useLocalStorage from "hooks/use-local-storage";
|
||||||
// components
|
// components
|
||||||
import { ModuleCardItem, ModuleListItem, ModulePeekOverview, ModulesListGanttChartView } from "components/modules";
|
import { ModuleCardItem, ModuleListItem, ModulePeekOverview, ModulesListGanttChartView } from "components/modules";
|
||||||
@ -20,6 +20,7 @@ export const ModulesListView: React.FC = observer(() => {
|
|||||||
const { resolvedTheme } = useTheme();
|
const { resolvedTheme } = useTheme();
|
||||||
// store hooks
|
// store hooks
|
||||||
const { commandPalette: commandPaletteStore } = useApplication();
|
const { commandPalette: commandPaletteStore } = useApplication();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
const {
|
const {
|
||||||
membership: { currentProjectRole },
|
membership: { currentProjectRole },
|
||||||
currentUser,
|
currentUser,
|
||||||
@ -106,7 +107,10 @@ export const ModulesListView: React.FC = observer(() => {
|
|||||||
}}
|
}}
|
||||||
primaryButton={{
|
primaryButton={{
|
||||||
text: "Build your first module",
|
text: "Build your first module",
|
||||||
onClick: () => commandPaletteStore.toggleCreateModuleModal(true),
|
onClick: () => {
|
||||||
|
setTrackElement("Module empty state");
|
||||||
|
commandPaletteStore.toggleCreateModuleModal(true);
|
||||||
|
},
|
||||||
}}
|
}}
|
||||||
size="lg"
|
size="lg"
|
||||||
disabled={!isEditingAllowed}
|
disabled={!isEditingAllowed}
|
||||||
|
@ -16,7 +16,7 @@ import {
|
|||||||
UserCircle2,
|
UserCircle2,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useModule, useUser } from "hooks/store";
|
import { useModule, useUser, useEventTracker } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// components
|
// components
|
||||||
import { LinkModal, LinksList, SidebarProgressStats } from "components/core";
|
import { LinkModal, LinksList, SidebarProgressStats } from "components/core";
|
||||||
@ -66,7 +66,7 @@ export const ModuleDetailsSidebar: React.FC<Props> = observer((props) => {
|
|||||||
membership: { currentProjectRole },
|
membership: { currentProjectRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
const { getModuleById, updateModuleDetails, createModuleLink, updateModuleLink, deleteModuleLink } = useModule();
|
const { getModuleById, updateModuleDetails, createModuleLink, updateModuleLink, deleteModuleLink } = useModule();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
const moduleDetails = getModuleById(moduleId);
|
const moduleDetails = getModuleById(moduleId);
|
||||||
|
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
@ -262,13 +262,7 @@ export const ModuleDetailsSidebar: React.FC<Props> = observer((props) => {
|
|||||||
const moduleStatus = MODULE_STATUS.find((status) => status.value === moduleDetails.status);
|
const moduleStatus = MODULE_STATUS.find((status) => status.value === moduleDetails.status);
|
||||||
|
|
||||||
const issueCount =
|
const issueCount =
|
||||||
moduleDetails.total_issues === 0
|
moduleDetails.total_issues === 0 ? "0 Issue" : `${moduleDetails.completed_issues}/${moduleDetails.total_issues}`;
|
||||||
? "0 Issue"
|
|
||||||
: moduleDetails.total_issues === moduleDetails.completed_issues
|
|
||||||
? moduleDetails.total_issues > 1
|
|
||||||
? `${moduleDetails.total_issues}`
|
|
||||||
: `${moduleDetails.total_issues}`
|
|
||||||
: `${moduleDetails.completed_issues}/${moduleDetails.total_issues}`;
|
|
||||||
|
|
||||||
const isEditingAllowed = !!currentProjectRole && currentProjectRole >= EUserProjectRoles.MEMBER;
|
const isEditingAllowed = !!currentProjectRole && currentProjectRole >= EUserProjectRoles.MEMBER;
|
||||||
|
|
||||||
@ -303,7 +297,12 @@ export const ModuleDetailsSidebar: React.FC<Props> = observer((props) => {
|
|||||||
</button>
|
</button>
|
||||||
{isEditingAllowed && (
|
{isEditingAllowed && (
|
||||||
<CustomMenu placement="bottom-end" ellipsis>
|
<CustomMenu placement="bottom-end" ellipsis>
|
||||||
<CustomMenu.MenuItem onClick={() => setModuleDeleteModal(true)}>
|
<CustomMenu.MenuItem
|
||||||
|
onClick={() => {
|
||||||
|
setTrackElement("Module peek-overview");
|
||||||
|
setModuleDeleteModal(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
<span className="flex items-center justify-start gap-2">
|
<span className="flex items-center justify-start gap-2">
|
||||||
<Trash2 className="h-3 w-3" />
|
<Trash2 className="h-3 w-3" />
|
||||||
<span>Delete module</span>
|
<span>Delete module</span>
|
||||||
@ -582,7 +581,7 @@ export const ModuleDetailsSidebar: React.FC<Props> = observer((props) => {
|
|||||||
<Transition show={open}>
|
<Transition show={open}>
|
||||||
<Disclosure.Panel>
|
<Disclosure.Panel>
|
||||||
<div className="flex flex-col gap-3">
|
<div className="flex flex-col gap-3">
|
||||||
{isStartValid && isEndValid ? (
|
{moduleDetails.start_date && moduleDetails.target_date ? (
|
||||||
<div className=" h-full w-full pt-4">
|
<div className=" h-full w-full pt-4">
|
||||||
<div className="flex items-start gap-4 py-2 text-xs">
|
<div className="flex items-start gap-4 py-2 text-xs">
|
||||||
<div className="flex items-center gap-3 text-custom-text-100">
|
<div className="flex items-center gap-3 text-custom-text-100">
|
||||||
@ -598,9 +597,9 @@ export const ModuleDetailsSidebar: React.FC<Props> = observer((props) => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="relative h-40 w-80">
|
<div className="relative h-40 w-80">
|
||||||
<ProgressChart
|
<ProgressChart
|
||||||
distribution={moduleDetails.distribution?.completion_chart}
|
distribution={moduleDetails.distribution?.completion_chart ?? {}}
|
||||||
startDate={moduleDetails.start_date ?? ""}
|
startDate={moduleDetails.start_date}
|
||||||
endDate={moduleDetails.target_date ?? ""}
|
endDate={moduleDetails.target_date}
|
||||||
totalIssues={moduleDetails.total_issues}
|
totalIssues={moduleDetails.total_issues}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import useSWR, { mutate } from "swr";
|
import useSWR, { mutate } from "swr";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useUser, useWorkspace } from "hooks/store";
|
import { useEventTracker, useUser, useWorkspace } from "hooks/store";
|
||||||
// components
|
// components
|
||||||
import { Button } from "@plane/ui";
|
import { Button } from "@plane/ui";
|
||||||
// helpers
|
// helpers
|
||||||
@ -15,6 +15,7 @@ import { ROLE } from "constants/workspace";
|
|||||||
import { IWorkspaceMemberInvitation } from "@plane/types";
|
import { IWorkspaceMemberInvitation } from "@plane/types";
|
||||||
// icons
|
// icons
|
||||||
import { CheckCircle2, Search } from "lucide-react";
|
import { CheckCircle2, Search } from "lucide-react";
|
||||||
|
import {} from "hooks/store/use-event-tracker";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
handleNextStep: () => void;
|
handleNextStep: () => void;
|
||||||
@ -28,9 +29,7 @@ export const Invitations: React.FC<Props> = (props) => {
|
|||||||
const [isJoiningWorkspaces, setIsJoiningWorkspaces] = useState(false);
|
const [isJoiningWorkspaces, setIsJoiningWorkspaces] = useState(false);
|
||||||
const [invitationsRespond, setInvitationsRespond] = useState<string[]>([]);
|
const [invitationsRespond, setInvitationsRespond] = useState<string[]>([]);
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { captureEvent } = useEventTracker();
|
||||||
eventTracker: { postHogEventTracker },
|
|
||||||
} = useApplication();
|
|
||||||
const { currentUser, updateCurrentUser } = useUser();
|
const { currentUser, updateCurrentUser } = useUser();
|
||||||
const { workspaces, fetchWorkspaces } = useWorkspace();
|
const { workspaces, fetchWorkspaces } = useWorkspace();
|
||||||
|
|
||||||
@ -63,7 +62,7 @@ export const Invitations: React.FC<Props> = (props) => {
|
|||||||
await workspaceService
|
await workspaceService
|
||||||
.joinWorkspaces({ invitations: invitationsRespond })
|
.joinWorkspaces({ invitations: invitationsRespond })
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
postHogEventTracker("MEMBER_ACCEPTED", { ...res, state: "SUCCESS", accepted_from: "App" });
|
captureEvent("Member accepted", { ...res, state: "SUCCESS", accepted_from: "App" });
|
||||||
await fetchWorkspaces();
|
await fetchWorkspaces();
|
||||||
await mutate(USER_WORKSPACES);
|
await mutate(USER_WORKSPACES);
|
||||||
await updateLastWorkspace();
|
await updateLastWorkspace();
|
||||||
@ -72,7 +71,7 @@ export const Invitations: React.FC<Props> = (props) => {
|
|||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
postHogEventTracker("MEMBER_ACCEPTED", { state: "FAILED", accepted_from: "App" });
|
captureEvent("Member accepted", { state: "FAILED", accepted_from: "App" });
|
||||||
})
|
})
|
||||||
.finally(() => setIsJoiningWorkspaces(false));
|
.finally(() => setIsJoiningWorkspaces(false));
|
||||||
};
|
};
|
||||||
|
@ -3,7 +3,7 @@ import Image from "next/image";
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { X } from "lucide-react";
|
import { X } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useUser } from "hooks/store";
|
import { useApplication, useEventTracker, useUser } from "hooks/store";
|
||||||
// components
|
// components
|
||||||
import { TourSidebar } from "components/onboarding";
|
import { TourSidebar } from "components/onboarding";
|
||||||
// ui
|
// ui
|
||||||
@ -78,10 +78,8 @@ export const TourRoot: React.FC<Props> = observer((props) => {
|
|||||||
// states
|
// states
|
||||||
const [step, setStep] = useState<TTourSteps>("welcome");
|
const [step, setStep] = useState<TTourSteps>("welcome");
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { commandPalette: commandPaletteStore } = useApplication();
|
||||||
commandPalette: commandPaletteStore,
|
const { setTrackElement } = useEventTracker();
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
|
||||||
const { currentUser } = useUser();
|
const { currentUser } = useUser();
|
||||||
|
|
||||||
const currentStepIndex = TOUR_STEPS.findIndex((tourStep) => tourStep.key === step);
|
const currentStepIndex = TOUR_STEPS.findIndex((tourStep) => tourStep.key === step);
|
||||||
@ -159,7 +157,7 @@ export const TourRoot: React.FC<Props> = observer((props) => {
|
|||||||
variant="primary"
|
variant="primary"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onComplete();
|
onComplete();
|
||||||
setTrackElement("ONBOARDING_TOUR");
|
setTrackElement("Onboarding tour");
|
||||||
commandPaletteStore.toggleCreateProjectModal(true);
|
commandPaletteStore.toggleCreateProjectModal(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -2,7 +2,7 @@ import { useEffect } from "react";
|
|||||||
import { useTheme } from "next-themes";
|
import { useTheme } from "next-themes";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useDashboard, useProject, useUser } from "hooks/store";
|
import { useApplication, useEventTracker, useDashboard, useProject, useUser } from "hooks/store";
|
||||||
// components
|
// components
|
||||||
import { TourRoot } from "components/onboarding";
|
import { TourRoot } from "components/onboarding";
|
||||||
import { UserGreetingsView } from "components/user";
|
import { UserGreetingsView } from "components/user";
|
||||||
@ -18,9 +18,9 @@ export const WorkspaceDashboardView = observer(() => {
|
|||||||
// theme
|
// theme
|
||||||
const { resolvedTheme } = useTheme();
|
const { resolvedTheme } = useTheme();
|
||||||
// store hooks
|
// store hooks
|
||||||
|
const { captureEvent, setTrackElement } = useEventTracker();
|
||||||
const {
|
const {
|
||||||
commandPalette: { toggleCreateProjectModal },
|
commandPalette: { toggleCreateProjectModal },
|
||||||
eventTracker: { postHogEventTracker },
|
|
||||||
router: { workspaceSlug },
|
router: { workspaceSlug },
|
||||||
} = useApplication();
|
} = useApplication();
|
||||||
const {
|
const {
|
||||||
@ -37,7 +37,7 @@ export const WorkspaceDashboardView = observer(() => {
|
|||||||
const handleTourCompleted = () => {
|
const handleTourCompleted = () => {
|
||||||
updateTourCompleted()
|
updateTourCompleted()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
postHogEventTracker("USER_TOUR_COMPLETE", {
|
captureEvent("User tour complete", {
|
||||||
user_id: currentUser?.id,
|
user_id: currentUser?.id,
|
||||||
email: currentUser?.email,
|
email: currentUser?.email,
|
||||||
state: "SUCCESS",
|
state: "SUCCESS",
|
||||||
@ -62,7 +62,7 @@ export const WorkspaceDashboardView = observer(() => {
|
|||||||
{homeDashboardId && joinedProjectIds ? (
|
{homeDashboardId && joinedProjectIds ? (
|
||||||
<>
|
<>
|
||||||
{joinedProjectIds.length > 0 ? (
|
{joinedProjectIds.length > 0 ? (
|
||||||
<div className="space-y-7 p-7 bg-custom-background-90 h-full w-full flex flex-col overflow-y-auto">
|
<div className="flex h-full w-full flex-col space-y-7 overflow-y-auto bg-custom-background-90 p-7">
|
||||||
<IssuePeekOverview />
|
<IssuePeekOverview />
|
||||||
{currentUser && <UserGreetingsView user={currentUser} />}
|
{currentUser && <UserGreetingsView user={currentUser} />}
|
||||||
{currentUser && !currentUser.is_tour_completed && (
|
{currentUser && !currentUser.is_tour_completed && (
|
||||||
@ -81,7 +81,10 @@ export const WorkspaceDashboardView = observer(() => {
|
|||||||
progress."
|
progress."
|
||||||
primaryButton={{
|
primaryButton={{
|
||||||
text: "Build your first project",
|
text: "Build your first project",
|
||||||
onClick: () => toggleCreateProjectModal(true),
|
onClick: () => {
|
||||||
|
setTrackElement("Dashboard");
|
||||||
|
toggleCreateProjectModal(true);
|
||||||
|
},
|
||||||
}}
|
}}
|
||||||
comicBox={{
|
comicBox={{
|
||||||
title: "Everything starts with a project in Plane",
|
title: "Everything starts with a project in Plane",
|
||||||
@ -93,7 +96,7 @@ export const WorkspaceDashboardView = observer(() => {
|
|||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<div className="h-full w-full grid place-items-center">
|
<div className="grid h-full w-full place-items-center">
|
||||||
<Spinner />
|
<Spinner />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { useTheme } from "next-themes";
|
import { useTheme } from "next-themes";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useProject, useUser } from "hooks/store";
|
import { useApplication, useEventTracker, useProject, useUser } from "hooks/store";
|
||||||
// components
|
// components
|
||||||
import { ProjectCard } from "components/project";
|
import { ProjectCard } from "components/project";
|
||||||
import { Loader } from "@plane/ui";
|
import { Loader } from "@plane/ui";
|
||||||
@ -13,10 +13,8 @@ export const ProjectCardList = observer(() => {
|
|||||||
// theme
|
// theme
|
||||||
const { resolvedTheme } = useTheme();
|
const { resolvedTheme } = useTheme();
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { commandPalette: commandPaletteStore } = useApplication();
|
||||||
commandPalette: commandPaletteStore,
|
const { setTrackElement } = useEventTracker();
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
|
||||||
const {
|
const {
|
||||||
membership: { currentWorkspaceRole },
|
membership: { currentWorkspaceRole },
|
||||||
currentUser,
|
currentUser,
|
||||||
@ -66,7 +64,7 @@ export const ProjectCardList = observer(() => {
|
|||||||
primaryButton={{
|
primaryButton={{
|
||||||
text: "Start your first project",
|
text: "Start your first project",
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
setTrackElement("PROJECTS_EMPTY_STATE");
|
setTrackElement("Project empty state");
|
||||||
commandPaletteStore.toggleCreateProjectModal(true);
|
commandPaletteStore.toggleCreateProjectModal(true);
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
|
@ -4,7 +4,7 @@ import { Dialog, Transition } from "@headlessui/react";
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { X } from "lucide-react";
|
import { X } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useProject, useUser, useWorkspace } from "hooks/store";
|
import { useEventTracker, useProject, useUser, useWorkspace } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// ui
|
// ui
|
||||||
import { Button, CustomSelect, Input, TextArea } from "@plane/ui";
|
import { Button, CustomSelect, Input, TextArea } from "@plane/ui";
|
||||||
@ -61,9 +61,7 @@ export interface ICreateProjectForm {
|
|||||||
export const CreateProjectModal: FC<Props> = observer((props) => {
|
export const CreateProjectModal: FC<Props> = observer((props) => {
|
||||||
const { isOpen, onClose, setToFavorite = false, workspaceSlug } = props;
|
const { isOpen, onClose, setToFavorite = false, workspaceSlug } = props;
|
||||||
// store
|
// store
|
||||||
const {
|
const { captureProjectEvent } = useEventTracker();
|
||||||
eventTracker: { postHogEventTracker },
|
|
||||||
} = useApplication();
|
|
||||||
const {
|
const {
|
||||||
membership: { currentWorkspaceRole },
|
membership: { currentWorkspaceRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
@ -135,10 +133,14 @@ export const CreateProjectModal: FC<Props> = observer((props) => {
|
|||||||
...res,
|
...res,
|
||||||
state: "SUCCESS",
|
state: "SUCCESS",
|
||||||
};
|
};
|
||||||
postHogEventTracker("PROJECT_CREATED", newPayload, {
|
captureProjectEvent({
|
||||||
isGrouping: true,
|
eventName: "Project created",
|
||||||
groupType: "Workspace_metrics",
|
payload: newPayload,
|
||||||
groupId: res.workspace,
|
group: {
|
||||||
|
isGrouping: true,
|
||||||
|
groupType: "Workspace_metrics",
|
||||||
|
groupId: res.workspace,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "success",
|
type: "success",
|
||||||
@ -157,17 +159,18 @@ export const CreateProjectModal: FC<Props> = observer((props) => {
|
|||||||
title: "Error!",
|
title: "Error!",
|
||||||
message: err.data[key],
|
message: err.data[key],
|
||||||
});
|
});
|
||||||
postHogEventTracker(
|
captureProjectEvent({
|
||||||
"PROJECT_CREATED",
|
eventName: "Project created",
|
||||||
{
|
payload: {
|
||||||
|
...payload,
|
||||||
state: "FAILED",
|
state: "FAILED",
|
||||||
},
|
},
|
||||||
{
|
group: {
|
||||||
isGrouping: true,
|
isGrouping: true,
|
||||||
groupType: "Workspace_metrics",
|
groupType: "Workspace_metrics",
|
||||||
groupId: currentWorkspace?.id!,
|
groupId: currentWorkspace?.id!,
|
||||||
}
|
},
|
||||||
);
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -4,7 +4,7 @@ import { Controller, useForm } from "react-hook-form";
|
|||||||
import { Dialog, Transition } from "@headlessui/react";
|
import { Dialog, Transition } from "@headlessui/react";
|
||||||
import { AlertTriangle } from "lucide-react";
|
import { AlertTriangle } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useProject, useWorkspace } from "hooks/store";
|
import { useEventTracker, useProject, useWorkspace } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// ui
|
// ui
|
||||||
import { Button, Input } from "@plane/ui";
|
import { Button, Input } from "@plane/ui";
|
||||||
@ -25,9 +25,7 @@ const defaultValues = {
|
|||||||
export const DeleteProjectModal: React.FC<DeleteProjectModal> = (props) => {
|
export const DeleteProjectModal: React.FC<DeleteProjectModal> = (props) => {
|
||||||
const { isOpen, project, onClose } = props;
|
const { isOpen, project, onClose } = props;
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { captureProjectEvent } = useEventTracker();
|
||||||
eventTracker: { postHogEventTracker },
|
|
||||||
} = useApplication();
|
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const { deleteProject } = useProject();
|
const { deleteProject } = useProject();
|
||||||
// router
|
// router
|
||||||
@ -63,17 +61,15 @@ export const DeleteProjectModal: React.FC<DeleteProjectModal> = (props) => {
|
|||||||
if (projectId && projectId.toString() === project.id) router.push(`/${workspaceSlug}/projects`);
|
if (projectId && projectId.toString() === project.id) router.push(`/${workspaceSlug}/projects`);
|
||||||
|
|
||||||
handleClose();
|
handleClose();
|
||||||
postHogEventTracker(
|
captureProjectEvent({
|
||||||
"PROJECT_DELETED",
|
eventName: "Project deleted",
|
||||||
{
|
payload: { ...project, state: "SUCCESS", element: "Project general settings" },
|
||||||
state: "SUCCESS",
|
group: {
|
||||||
},
|
|
||||||
{
|
|
||||||
isGrouping: true,
|
isGrouping: true,
|
||||||
groupType: "Workspace_metrics",
|
groupType: "Workspace_metrics",
|
||||||
groupId: currentWorkspace?.id!,
|
groupId: currentWorkspace?.id!,
|
||||||
}
|
},
|
||||||
);
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "success",
|
type: "success",
|
||||||
title: "Success!",
|
title: "Success!",
|
||||||
@ -81,17 +77,15 @@ export const DeleteProjectModal: React.FC<DeleteProjectModal> = (props) => {
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
postHogEventTracker(
|
captureProjectEvent({
|
||||||
"PROJECT_DELETED",
|
eventName: "Project deleted",
|
||||||
{
|
payload: { ...project, state: "FAILED", element: "Project general settings" },
|
||||||
state: "FAILED",
|
group: {
|
||||||
},
|
|
||||||
{
|
|
||||||
isGrouping: true,
|
isGrouping: true,
|
||||||
groupType: "Workspace_metrics",
|
groupType: "Workspace_metrics",
|
||||||
groupId: currentWorkspace?.id!,
|
groupId: currentWorkspace?.id!,
|
||||||
}
|
},
|
||||||
);
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "error",
|
type: "error",
|
||||||
title: "Error!",
|
title: "Error!",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { FC, useEffect, useState } from "react";
|
import { FC, useEffect, useState } from "react";
|
||||||
import { Controller, useForm } from "react-hook-form";
|
import { Controller, useForm } from "react-hook-form";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useProject, useWorkspace } from "hooks/store";
|
import { useEventTracker, useProject, useWorkspace } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// components
|
// components
|
||||||
import EmojiIconPicker from "components/emoji-icon-picker";
|
import EmojiIconPicker from "components/emoji-icon-picker";
|
||||||
@ -32,9 +32,7 @@ export const ProjectDetailsForm: FC<IProjectDetailsForm> = (props) => {
|
|||||||
// states
|
// states
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { captureProjectEvent } = useEventTracker();
|
||||||
eventTracker: { postHogEventTracker },
|
|
||||||
} = useApplication();
|
|
||||||
const { currentWorkspace } = useWorkspace();
|
const { currentWorkspace } = useWorkspace();
|
||||||
const { updateProject } = useProject();
|
const { updateProject } = useProject();
|
||||||
// toast alert
|
// toast alert
|
||||||
@ -79,15 +77,15 @@ export const ProjectDetailsForm: FC<IProjectDetailsForm> = (props) => {
|
|||||||
|
|
||||||
return updateProject(workspaceSlug.toString(), project.id, payload)
|
return updateProject(workspaceSlug.toString(), project.id, payload)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
postHogEventTracker(
|
captureProjectEvent({
|
||||||
"PROJECT_UPDATED",
|
eventName: "Project updated",
|
||||||
{ ...res, state: "SUCCESS" },
|
payload: { ...res, state: "SUCCESS", element: "Project general settings" },
|
||||||
{
|
group: {
|
||||||
isGrouping: true,
|
isGrouping: true,
|
||||||
groupType: "Workspace_metrics",
|
groupType: "Workspace_metrics",
|
||||||
groupId: res.workspace,
|
groupId: res.workspace,
|
||||||
}
|
},
|
||||||
);
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "success",
|
type: "success",
|
||||||
title: "Success!",
|
title: "Success!",
|
||||||
@ -95,17 +93,15 @@ export const ProjectDetailsForm: FC<IProjectDetailsForm> = (props) => {
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
postHogEventTracker(
|
captureProjectEvent({
|
||||||
"PROJECT_UPDATED",
|
eventName: "Project updated",
|
||||||
{
|
payload: { ...payload, state: "FAILED", element: "Project general settings" },
|
||||||
state: "FAILED",
|
group: {
|
||||||
},
|
|
||||||
{
|
|
||||||
isGrouping: true,
|
isGrouping: true,
|
||||||
groupType: "Workspace_metrics",
|
groupType: "Workspace_metrics",
|
||||||
groupId: currentWorkspace?.id!,
|
groupId: currentWorkspace?.id,
|
||||||
}
|
},
|
||||||
);
|
});
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "error",
|
type: "error",
|
||||||
title: "Error!",
|
title: "Error!",
|
||||||
|
@ -5,7 +5,7 @@ import { Dialog, Transition } from "@headlessui/react";
|
|||||||
import { AlertTriangleIcon } from "lucide-react";
|
import { AlertTriangleIcon } from "lucide-react";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useUser } from "hooks/store";
|
import { useEventTracker, useUser } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// ui
|
// ui
|
||||||
import { Button, Input } from "@plane/ui";
|
import { Button, Input } from "@plane/ui";
|
||||||
@ -34,9 +34,7 @@ export const LeaveProjectModal: FC<ILeaveProjectModal> = observer((props) => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { workspaceSlug } = router.query;
|
const { workspaceSlug } = router.query;
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { captureEvent } = useEventTracker();
|
||||||
eventTracker: { postHogEventTracker },
|
|
||||||
} = useApplication();
|
|
||||||
const {
|
const {
|
||||||
membership: { leaveProject },
|
membership: { leaveProject },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
@ -65,7 +63,7 @@ export const LeaveProjectModal: FC<ILeaveProjectModal> = observer((props) => {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
handleClose();
|
handleClose();
|
||||||
router.push(`/${workspaceSlug}/projects`);
|
router.push(`/${workspaceSlug}/projects`);
|
||||||
postHogEventTracker("PROJECT_MEMBER_LEAVE", {
|
captureEvent("Project member leave", {
|
||||||
state: "SUCCESS",
|
state: "SUCCESS",
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
@ -75,7 +73,7 @@ export const LeaveProjectModal: FC<ILeaveProjectModal> = observer((props) => {
|
|||||||
title: "Error!",
|
title: "Error!",
|
||||||
message: "Something went wrong please try again later.",
|
message: "Something went wrong please try again later.",
|
||||||
});
|
});
|
||||||
postHogEventTracker("PROJECT_MEMBER_LEAVE", {
|
captureEvent("Project member leave", {
|
||||||
state: "FAILED",
|
state: "FAILED",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -2,7 +2,7 @@ import { useState } from "react";
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { Search } from "lucide-react";
|
import { Search } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useMember } from "hooks/store";
|
import { useEventTracker, useMember } from "hooks/store";
|
||||||
// components
|
// components
|
||||||
import { ProjectMemberListItem, SendProjectInvitationModal } from "components/project";
|
import { ProjectMemberListItem, SendProjectInvitationModal } from "components/project";
|
||||||
// ui
|
// ui
|
||||||
@ -13,9 +13,7 @@ export const ProjectMemberList: React.FC = observer(() => {
|
|||||||
const [inviteModal, setInviteModal] = useState(false);
|
const [inviteModal, setInviteModal] = useState(false);
|
||||||
const [searchQuery, setSearchQuery] = useState("");
|
const [searchQuery, setSearchQuery] = useState("");
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { setTrackElement } = useEventTracker();
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
|
||||||
const {
|
const {
|
||||||
project: { projectMemberIds, getProjectMemberDetails },
|
project: { projectMemberIds, getProjectMemberDetails },
|
||||||
} = useMember();
|
} = useMember();
|
||||||
|
@ -5,7 +5,7 @@ import { useForm, Controller, useFieldArray } from "react-hook-form";
|
|||||||
import { Dialog, Transition } from "@headlessui/react";
|
import { Dialog, Transition } from "@headlessui/react";
|
||||||
import { ChevronDown, Plus, X } from "lucide-react";
|
import { ChevronDown, Plus, X } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useMember, useUser, useWorkspace } from "hooks/store";
|
import { useEventTracker, useMember, useUser, useWorkspace } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// ui
|
// ui
|
||||||
import { Avatar, Button, CustomSelect, CustomSearchSelect } from "@plane/ui";
|
import { Avatar, Button, CustomSelect, CustomSearchSelect } from "@plane/ui";
|
||||||
@ -45,9 +45,7 @@ export const SendProjectInvitationModal: React.FC<Props> = observer((props) => {
|
|||||||
// toast alert
|
// toast alert
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { captureEvent } = useEventTracker();
|
||||||
eventTracker: { postHogEventTracker },
|
|
||||||
} = useApplication();
|
|
||||||
const {
|
const {
|
||||||
membership: { currentProjectRole },
|
membership: { currentProjectRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
@ -89,8 +87,8 @@ export const SendProjectInvitationModal: React.FC<Props> = observer((props) => {
|
|||||||
type: "success",
|
type: "success",
|
||||||
message: "Members added successfully.",
|
message: "Members added successfully.",
|
||||||
});
|
});
|
||||||
postHogEventTracker(
|
captureEvent(
|
||||||
"MEMBER_ADDED",
|
"Member added",
|
||||||
{
|
{
|
||||||
...res,
|
...res,
|
||||||
state: "SUCCESS",
|
state: "SUCCESS",
|
||||||
@ -104,8 +102,8 @@ export const SendProjectInvitationModal: React.FC<Props> = observer((props) => {
|
|||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
postHogEventTracker(
|
captureEvent(
|
||||||
"MEMBER_ADDED",
|
"Member added",
|
||||||
{
|
{
|
||||||
state: "FAILED",
|
state: "FAILED",
|
||||||
},
|
},
|
||||||
|
@ -4,7 +4,7 @@ import { observer } from "mobx-react-lite";
|
|||||||
import { ContrastIcon, FileText, Inbox, Layers } from "lucide-react";
|
import { ContrastIcon, FileText, Inbox, Layers } from "lucide-react";
|
||||||
import { DiceIcon, ToggleSwitch } from "@plane/ui";
|
import { DiceIcon, ToggleSwitch } from "@plane/ui";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useProject, useUser, useWorkspace } from "hooks/store";
|
import { useEventTracker, useProject, useUser, useWorkspace } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// types
|
// types
|
||||||
import { IProject } from "@plane/types";
|
import { IProject } from "@plane/types";
|
||||||
@ -51,9 +51,7 @@ export const ProjectFeaturesList: FC<Props> = observer(() => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { workspaceSlug, projectId } = router.query;
|
const { workspaceSlug, projectId } = router.query;
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { setTrackElement, captureEvent } = useEventTracker();
|
||||||
eventTracker: { setTrackElement, postHogEventTracker },
|
|
||||||
} = useApplication();
|
|
||||||
const {
|
const {
|
||||||
currentUser,
|
currentUser,
|
||||||
membership: { currentProjectRole },
|
membership: { currentProjectRole },
|
||||||
@ -94,7 +92,7 @@ export const ProjectFeaturesList: FC<Props> = observer(() => {
|
|||||||
value={Boolean(currentProjectDetails?.[feature.property as keyof IProject])}
|
value={Boolean(currentProjectDetails?.[feature.property as keyof IProject])}
|
||||||
onChange={() => {
|
onChange={() => {
|
||||||
setTrackElement("PROJECT_SETTINGS_FEATURES_PAGE");
|
setTrackElement("PROJECT_SETTINGS_FEATURES_PAGE");
|
||||||
postHogEventTracker(`TOGGLE_${feature.title.toUpperCase()}`, {
|
captureEvent(`Toggle ${feature.title.toLowerCase()}`, {
|
||||||
workspace_id: currentWorkspace?.id,
|
workspace_id: currentWorkspace?.id,
|
||||||
workspace_slug: currentWorkspace?.slug,
|
workspace_slug: currentWorkspace?.slug,
|
||||||
project_id: currentProjectDetails?.id,
|
project_id: currentProjectDetails?.id,
|
||||||
|
@ -18,7 +18,7 @@ import {
|
|||||||
MoreHorizontal,
|
MoreHorizontal,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useProject } from "hooks/store";
|
import { useApplication,useEventTracker, useProject } from "hooks/store";
|
||||||
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// helpers
|
// helpers
|
||||||
@ -73,10 +73,8 @@ export const ProjectSidebarListItem: React.FC<Props> = observer((props) => {
|
|||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
const { projectId, provided, snapshot, handleCopyText, shortContextMenu = false } = props;
|
const { projectId, provided, snapshot, handleCopyText, shortContextMenu = false } = props;
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { theme: themeStore } = useApplication();
|
||||||
theme: themeStore,
|
const { setTrackElement } = useEventTracker();
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
|
||||||
const { addProjectToFavorites, removeProjectFromFavorites, getProjectById } = useProject();
|
const { addProjectToFavorites, removeProjectFromFavorites, getProjectById } = useProject();
|
||||||
// states
|
// states
|
||||||
const [leaveProjectModalOpen, setLeaveProjectModal] = useState(false);
|
const [leaveProjectModalOpen, setLeaveProjectModal] = useState(false);
|
||||||
@ -149,8 +147,9 @@ export const ProjectSidebarListItem: React.FC<Props> = observer((props) => {
|
|||||||
{({ open }) => (
|
{({ open }) => (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
className={`group relative flex w-full items-center rounded-md px-2 py-1 text-custom-sidebar-text-10 hover:bg-custom-sidebar-background-80 ${snapshot?.isDragging ? "opacity-60" : ""
|
className={`group relative flex w-full items-center rounded-md px-2 py-1 text-custom-sidebar-text-10 hover:bg-custom-sidebar-background-80 ${
|
||||||
} ${isMenuActive ? "!bg-custom-sidebar-background-80" : ""}`}
|
snapshot?.isDragging ? "opacity-60" : ""
|
||||||
|
} ${isMenuActive ? "!bg-custom-sidebar-background-80" : ""}`}
|
||||||
>
|
>
|
||||||
{provided && (
|
{provided && (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
@ -159,9 +158,11 @@ export const ProjectSidebarListItem: React.FC<Props> = observer((props) => {
|
|||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className={`absolute -left-2.5 top-1/2 hidden -translate-y-1/2 rounded p-0.5 text-custom-sidebar-text-400 ${isCollapsed ? "" : "group-hover:!flex"
|
className={`absolute -left-2.5 top-1/2 hidden -translate-y-1/2 rounded p-0.5 text-custom-sidebar-text-400 ${
|
||||||
} ${project.sort_order === null ? "cursor-not-allowed opacity-60" : ""} ${isMenuActive ? "!flex" : ""
|
isCollapsed ? "" : "group-hover:!flex"
|
||||||
}`}
|
} ${project.sort_order === null ? "cursor-not-allowed opacity-60" : ""} ${
|
||||||
|
isMenuActive ? "!flex" : ""
|
||||||
|
}`}
|
||||||
{...provided?.dragHandleProps}
|
{...provided?.dragHandleProps}
|
||||||
>
|
>
|
||||||
<MoreVertical className="h-3.5" />
|
<MoreVertical className="h-3.5" />
|
||||||
@ -172,12 +173,14 @@ export const ProjectSidebarListItem: React.FC<Props> = observer((props) => {
|
|||||||
<Tooltip tooltipContent={`${project.name}`} position="right" className="ml-2" disabled={!isCollapsed}>
|
<Tooltip tooltipContent={`${project.name}`} position="right" className="ml-2" disabled={!isCollapsed}>
|
||||||
<Disclosure.Button
|
<Disclosure.Button
|
||||||
as="div"
|
as="div"
|
||||||
className={`flex flex-grow cursor-pointer select-none items-center truncate text-left text-sm font-medium ${isCollapsed ? "justify-center" : `justify-between`
|
className={`flex flex-grow cursor-pointer select-none items-center truncate text-left text-sm font-medium ${
|
||||||
}`}
|
isCollapsed ? "justify-center" : `justify-between`
|
||||||
|
}`}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={`flex w-full flex-grow items-center gap-x-2 truncate ${isCollapsed ? "justify-center" : ""
|
className={`flex w-full flex-grow items-center gap-x-2 truncate ${
|
||||||
}`}
|
isCollapsed ? "justify-center" : ""
|
||||||
|
}`}
|
||||||
>
|
>
|
||||||
{project.emoji ? (
|
{project.emoji ? (
|
||||||
<span className="grid h-7 w-7 flex-shrink-0 place-items-center rounded uppercase">
|
<span className="grid h-7 w-7 flex-shrink-0 place-items-center rounded uppercase">
|
||||||
@ -197,8 +200,9 @@ export const ProjectSidebarListItem: React.FC<Props> = observer((props) => {
|
|||||||
</div>
|
</div>
|
||||||
{!isCollapsed && (
|
{!isCollapsed && (
|
||||||
<ChevronDown
|
<ChevronDown
|
||||||
className={`hidden h-4 w-4 flex-shrink-0 ${open ? "rotate-180" : ""} ${isMenuActive ? "!block" : ""
|
className={`hidden h-4 w-4 flex-shrink-0 ${open ? "rotate-180" : ""} ${
|
||||||
} mb-0.5 text-custom-sidebar-text-400 duration-300 group-hover:!block`}
|
isMenuActive ? "!block" : ""
|
||||||
|
} mb-0.5 text-custom-sidebar-text-400 duration-300 group-hover:!block`}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</Disclosure.Button>
|
</Disclosure.Button>
|
||||||
@ -322,10 +326,11 @@ export const ProjectSidebarListItem: React.FC<Props> = observer((props) => {
|
|||||||
disabled={!isCollapsed}
|
disabled={!isCollapsed}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={`group flex items-center gap-2.5 rounded-md px-2 py-1.5 text-xs font-medium outline-none ${router.asPath.includes(item.href)
|
className={`group flex items-center gap-2.5 rounded-md px-2 py-1.5 text-xs font-medium outline-none ${
|
||||||
? "bg-custom-primary-100/10 text-custom-primary-100"
|
router.asPath.includes(item.href)
|
||||||
: "text-custom-sidebar-text-300 hover:bg-custom-sidebar-background-80 focus:bg-custom-sidebar-background-80"
|
? "bg-custom-primary-100/10 text-custom-primary-100"
|
||||||
} ${isCollapsed ? "justify-center" : ""}`}
|
: "text-custom-sidebar-text-300 hover:bg-custom-sidebar-background-80 focus:bg-custom-sidebar-background-80"
|
||||||
|
} ${isCollapsed ? "justify-center" : ""}`}
|
||||||
>
|
>
|
||||||
<item.Icon className="h-4 w-4 stroke-[1.5]" />
|
<item.Icon className="h-4 w-4 stroke-[1.5]" />
|
||||||
{!isCollapsed && item.name}
|
{!isCollapsed && item.name}
|
||||||
|
@ -5,7 +5,7 @@ import { Disclosure, Transition } from "@headlessui/react";
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { ChevronDown, ChevronRight, Plus } from "lucide-react";
|
import { ChevronDown, ChevronRight, Plus } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useProject, useUser } from "hooks/store";
|
import { useApplication, useEventTracker, useProject, useUser } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// components
|
// components
|
||||||
import { CreateProjectModal, ProjectSidebarListItem } from "components/project";
|
import { CreateProjectModal, ProjectSidebarListItem } from "components/project";
|
||||||
@ -25,8 +25,8 @@ export const ProjectSidebarList: FC = observer(() => {
|
|||||||
const {
|
const {
|
||||||
theme: { sidebarCollapsed },
|
theme: { sidebarCollapsed },
|
||||||
commandPalette: { toggleCreateProjectModal },
|
commandPalette: { toggleCreateProjectModal },
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
} = useApplication();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
const {
|
const {
|
||||||
membership: { currentWorkspaceRole },
|
membership: { currentWorkspaceRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
@ -217,6 +217,7 @@ export const ProjectSidebarList: FC = observer(() => {
|
|||||||
<button
|
<button
|
||||||
className="opacity-0 group-hover:opacity-100"
|
className="opacity-0 group-hover:opacity-100"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
setTrackElement("Sidebar");
|
||||||
setIsFavoriteProjectCreate(false);
|
setIsFavoriteProjectCreate(false);
|
||||||
setIsProjectModalOpen(true);
|
setIsProjectModalOpen(true);
|
||||||
}}
|
}}
|
||||||
@ -267,7 +268,7 @@ export const ProjectSidebarList: FC = observer(() => {
|
|||||||
type="button"
|
type="button"
|
||||||
className="flex w-full items-center gap-2 px-3 text-sm text-custom-sidebar-text-200"
|
className="flex w-full items-center gap-2 px-3 text-sm text-custom-sidebar-text-200"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setTrackElement("APP_SIDEBAR");
|
setTrackElement("Sidebar");
|
||||||
toggleCreateProjectModal(true);
|
toggleCreateProjectModal(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -5,7 +5,7 @@ import { TwitterPicker } from "react-color";
|
|||||||
import { Popover, Transition } from "@headlessui/react";
|
import { Popover, Transition } from "@headlessui/react";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useProjectState } from "hooks/store";
|
import { useEventTracker, useProjectState } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// ui
|
// ui
|
||||||
import { Button, CustomSelect, Input, Tooltip } from "@plane/ui";
|
import { Button, CustomSelect, Input, Tooltip } from "@plane/ui";
|
||||||
@ -36,9 +36,7 @@ export const CreateUpdateStateInline: React.FC<Props> = observer((props) => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { workspaceSlug, projectId } = router.query;
|
const { workspaceSlug, projectId } = router.query;
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { captureEvent, setTrackElement } = useEventTracker();
|
||||||
eventTracker: { postHogEventTracker, setTrackElement },
|
|
||||||
} = useApplication();
|
|
||||||
const { createState, updateState } = useProjectState();
|
const { createState, updateState } = useProjectState();
|
||||||
// toast alert
|
// toast alert
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
@ -88,7 +86,7 @@ export const CreateUpdateStateInline: React.FC<Props> = observer((props) => {
|
|||||||
title: "Success!",
|
title: "Success!",
|
||||||
message: "State created successfully.",
|
message: "State created successfully.",
|
||||||
});
|
});
|
||||||
postHogEventTracker("STATE_CREATE", {
|
captureEvent("State created", {
|
||||||
...res,
|
...res,
|
||||||
state: "SUCCESS",
|
state: "SUCCESS",
|
||||||
});
|
});
|
||||||
@ -106,7 +104,7 @@ export const CreateUpdateStateInline: React.FC<Props> = observer((props) => {
|
|||||||
title: "Error!",
|
title: "Error!",
|
||||||
message: "State could not be created. Please try again.",
|
message: "State could not be created. Please try again.",
|
||||||
});
|
});
|
||||||
postHogEventTracker("STATE_CREATE", {
|
captureEvent("State created", {
|
||||||
state: "FAILED",
|
state: "FAILED",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -118,7 +116,7 @@ export const CreateUpdateStateInline: React.FC<Props> = observer((props) => {
|
|||||||
await updateState(workspaceSlug.toString(), projectId.toString(), data.id, formData)
|
await updateState(workspaceSlug.toString(), projectId.toString(), data.id, formData)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
handleClose();
|
handleClose();
|
||||||
postHogEventTracker("STATE_UPDATE", {
|
captureEvent("State updated", {
|
||||||
...res,
|
...res,
|
||||||
state: "SUCCESS",
|
state: "SUCCESS",
|
||||||
});
|
});
|
||||||
@ -141,7 +139,7 @@ export const CreateUpdateStateInline: React.FC<Props> = observer((props) => {
|
|||||||
title: "Error!",
|
title: "Error!",
|
||||||
message: "State could not be updated. Please try again.",
|
message: "State could not be updated. Please try again.",
|
||||||
});
|
});
|
||||||
postHogEventTracker("STATE_UPDATE", {
|
captureEvent("State updated", {
|
||||||
state: "FAILED",
|
state: "FAILED",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -4,7 +4,7 @@ import { Dialog, Transition } from "@headlessui/react";
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { AlertTriangle } from "lucide-react";
|
import { AlertTriangle } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useProjectState } from "hooks/store";
|
import { useEventTracker, useProjectState } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// ui
|
// ui
|
||||||
import { Button } from "@plane/ui";
|
import { Button } from "@plane/ui";
|
||||||
@ -25,9 +25,7 @@ export const DeleteStateModal: React.FC<Props> = observer((props) => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { workspaceSlug } = router.query;
|
const { workspaceSlug } = router.query;
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { captureEvent } = useEventTracker();
|
||||||
eventTracker: { postHogEventTracker },
|
|
||||||
} = useApplication();
|
|
||||||
const { deleteState } = useProjectState();
|
const { deleteState } = useProjectState();
|
||||||
// toast alert
|
// toast alert
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
@ -44,7 +42,7 @@ export const DeleteStateModal: React.FC<Props> = observer((props) => {
|
|||||||
|
|
||||||
await deleteState(workspaceSlug.toString(), data.project_id, data.id)
|
await deleteState(workspaceSlug.toString(), data.project_id, data.id)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
postHogEventTracker("STATE_DELETE", {
|
captureEvent("State deleted", {
|
||||||
state: "SUCCESS",
|
state: "SUCCESS",
|
||||||
});
|
});
|
||||||
handleClose();
|
handleClose();
|
||||||
@ -63,7 +61,7 @@ export const DeleteStateModal: React.FC<Props> = observer((props) => {
|
|||||||
title: "Error!",
|
title: "Error!",
|
||||||
message: "State could not be deleted. Please try again.",
|
message: "State could not be deleted. Please try again.",
|
||||||
});
|
});
|
||||||
postHogEventTracker("STATE_DELETE", {
|
captureEvent("State deleted", {
|
||||||
state: "FAILED",
|
state: "FAILED",
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
@ -2,7 +2,7 @@ import { useState } from "react";
|
|||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useProjectState } from "hooks/store";
|
import { useEventTracker, useProjectState } from "hooks/store";
|
||||||
// ui
|
// ui
|
||||||
import { Tooltip, StateGroupIcon } from "@plane/ui";
|
import { Tooltip, StateGroupIcon } from "@plane/ui";
|
||||||
// icons
|
// icons
|
||||||
@ -28,9 +28,7 @@ export const StatesListItem: React.FC<Props> = observer((props) => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { workspaceSlug, projectId } = router.query;
|
const { workspaceSlug, projectId } = router.query;
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { setTrackElement } = useEventTracker();
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
|
||||||
const { markStateAsDefault, moveStatePosition } = useProjectState();
|
const { markStateAsDefault, moveStatePosition } = useProjectState();
|
||||||
// derived values
|
// derived values
|
||||||
const groupStates = statesList.filter((s) => s.group === state.group);
|
const groupStates = statesList.filter((s) => s.group === state.group);
|
||||||
|
@ -3,7 +3,7 @@ import { useRouter } from "next/router";
|
|||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useProjectState } from "hooks/store";
|
import { useEventTracker, useProjectState } from "hooks/store";
|
||||||
// components
|
// components
|
||||||
import { CreateUpdateStateInline, DeleteStateModal, StateGroup, StatesListItem } from "components/states";
|
import { CreateUpdateStateInline, DeleteStateModal, StateGroup, StatesListItem } from "components/states";
|
||||||
// ui
|
// ui
|
||||||
@ -21,9 +21,7 @@ export const ProjectSettingStateList: React.FC = observer(() => {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { workspaceSlug, projectId } = router.query;
|
const { workspaceSlug, projectId } = router.query;
|
||||||
// store
|
// store
|
||||||
const {
|
const { setTrackElement } = useEventTracker();
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
|
||||||
const { groupedProjectStates, projectStates, fetchProjectStates } = useProjectState();
|
const { groupedProjectStates, projectStates, fetchProjectStates } = useProjectState();
|
||||||
// state
|
// state
|
||||||
const [activeGroup, setActiveGroup] = useState<StateGroup>(null);
|
const [activeGroup, setActiveGroup] = useState<StateGroup>(null);
|
||||||
|
@ -5,7 +5,7 @@ import { Controller, useForm } from "react-hook-form";
|
|||||||
// services
|
// services
|
||||||
import { WorkspaceService } from "services/workspace.service";
|
import { WorkspaceService } from "services/workspace.service";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useWorkspace } from "hooks/store";
|
import { useEventTracker, useWorkspace } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// ui
|
// ui
|
||||||
import { Button, CustomSelect, Input } from "@plane/ui";
|
import { Button, CustomSelect, Input } from "@plane/ui";
|
||||||
@ -48,9 +48,7 @@ export const CreateWorkspaceForm: FC<Props> = observer((props) => {
|
|||||||
// router
|
// router
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { captureEvent } = useEventTracker();
|
||||||
eventTracker: { postHogEventTracker },
|
|
||||||
} = useApplication();
|
|
||||||
const { createWorkspace } = useWorkspace();
|
const { createWorkspace } = useWorkspace();
|
||||||
// toast alert
|
// toast alert
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
@ -72,7 +70,7 @@ export const CreateWorkspaceForm: FC<Props> = observer((props) => {
|
|||||||
|
|
||||||
await createWorkspace(formData)
|
await createWorkspace(formData)
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
postHogEventTracker("WORKSPACE_CREATED", {
|
captureEvent("Workspace created", {
|
||||||
...res,
|
...res,
|
||||||
state: "SUCCESS",
|
state: "SUCCESS",
|
||||||
});
|
});
|
||||||
@ -90,7 +88,7 @@ export const CreateWorkspaceForm: FC<Props> = observer((props) => {
|
|||||||
title: "Error!",
|
title: "Error!",
|
||||||
message: "Workspace could not be created. Please try again.",
|
message: "Workspace could not be created. Please try again.",
|
||||||
});
|
});
|
||||||
postHogEventTracker("WORKSPACE_CREATED", {
|
captureEvent("Workspace created", {
|
||||||
state: "FAILED",
|
state: "FAILED",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -102,7 +100,7 @@ export const CreateWorkspaceForm: FC<Props> = observer((props) => {
|
|||||||
title: "Error!",
|
title: "Error!",
|
||||||
message: "Some error occurred while creating workspace. Please try again.",
|
message: "Some error occurred while creating workspace. Please try again.",
|
||||||
});
|
});
|
||||||
postHogEventTracker("WORKSPACE_CREATED", {
|
captureEvent("Workspace created", {
|
||||||
state: "FAILED",
|
state: "FAILED",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -5,7 +5,7 @@ import { Controller, useForm } from "react-hook-form";
|
|||||||
import { Dialog, Transition } from "@headlessui/react";
|
import { Dialog, Transition } from "@headlessui/react";
|
||||||
import { AlertTriangle } from "lucide-react";
|
import { AlertTriangle } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useWorkspace } from "hooks/store";
|
import { useEventTracker, useWorkspace } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// ui
|
// ui
|
||||||
import { Button, Input } from "@plane/ui";
|
import { Button, Input } from "@plane/ui";
|
||||||
@ -28,9 +28,7 @@ export const DeleteWorkspaceModal: React.FC<Props> = observer((props) => {
|
|||||||
// router
|
// router
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { captureEvent } = useEventTracker();
|
||||||
eventTracker: { postHogEventTracker },
|
|
||||||
} = useApplication();
|
|
||||||
const { deleteWorkspace } = useWorkspace();
|
const { deleteWorkspace } = useWorkspace();
|
||||||
// toast alert
|
// toast alert
|
||||||
const { setToastAlert } = useToast();
|
const { setToastAlert } = useToast();
|
||||||
@ -61,7 +59,7 @@ export const DeleteWorkspaceModal: React.FC<Props> = observer((props) => {
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
handleClose();
|
handleClose();
|
||||||
router.push("/");
|
router.push("/");
|
||||||
postHogEventTracker("WORKSPACE_DELETED", {
|
captureEvent("Workspace deleted", {
|
||||||
res,
|
res,
|
||||||
state: "SUCCESS",
|
state: "SUCCESS",
|
||||||
});
|
});
|
||||||
@ -77,7 +75,7 @@ export const DeleteWorkspaceModal: React.FC<Props> = observer((props) => {
|
|||||||
title: "Error!",
|
title: "Error!",
|
||||||
message: "Something went wrong. Please try again later.",
|
message: "Something went wrong. Please try again later.",
|
||||||
});
|
});
|
||||||
postHogEventTracker("WORKSPACE_DELETED", {
|
captureEvent("Workspace deleted", {
|
||||||
state: "FAILED",
|
state: "FAILED",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -6,7 +6,7 @@ import { ChevronDown, ChevronUp, Pencil } from "lucide-react";
|
|||||||
// services
|
// services
|
||||||
import { FileService } from "services/file.service";
|
import { FileService } from "services/file.service";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useUser, useWorkspace } from "hooks/store";
|
import { useEventTracker, useUser, useWorkspace } from "hooks/store";
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// components
|
// components
|
||||||
import { DeleteWorkspaceModal } from "components/workspace";
|
import { DeleteWorkspaceModal } from "components/workspace";
|
||||||
@ -37,9 +37,7 @@ export const WorkspaceDetails: FC = observer(() => {
|
|||||||
const [isImageRemoving, setIsImageRemoving] = useState(false);
|
const [isImageRemoving, setIsImageRemoving] = useState(false);
|
||||||
const [isImageUploadModalOpen, setIsImageUploadModalOpen] = useState(false);
|
const [isImageUploadModalOpen, setIsImageUploadModalOpen] = useState(false);
|
||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const { captureEvent } = useEventTracker();
|
||||||
eventTracker: { postHogEventTracker },
|
|
||||||
} = useApplication();
|
|
||||||
const {
|
const {
|
||||||
membership: { currentWorkspaceRole },
|
membership: { currentWorkspaceRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
@ -70,7 +68,7 @@ export const WorkspaceDetails: FC = observer(() => {
|
|||||||
|
|
||||||
await updateWorkspace(currentWorkspace.slug, payload)
|
await updateWorkspace(currentWorkspace.slug, payload)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
postHogEventTracker("WORKSPACE_UPDATED", {
|
captureEvent("Workspace updated", {
|
||||||
...res,
|
...res,
|
||||||
state: "SUCCESS",
|
state: "SUCCESS",
|
||||||
});
|
});
|
||||||
@ -81,7 +79,7 @@ export const WorkspaceDetails: FC = observer(() => {
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
postHogEventTracker("WORKSPACE_UPDATED", {
|
captureEvent("Workspace updated", {
|
||||||
state: "FAILED",
|
state: "FAILED",
|
||||||
});
|
});
|
||||||
console.error(err);
|
console.error(err);
|
||||||
|
@ -8,7 +8,7 @@ import { mutate } from "swr";
|
|||||||
import { Check, ChevronDown, CircleUserRound, LogOut, Mails, PlusSquare, Settings, UserCircle2 } from "lucide-react";
|
import { Check, ChevronDown, CircleUserRound, LogOut, Mails, PlusSquare, Settings, UserCircle2 } from "lucide-react";
|
||||||
import { usePopper } from "react-popper";
|
import { usePopper } from "react-popper";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useUser, useWorkspace } from "hooks/store";
|
import { useApplication, useEventTracker, useUser, useWorkspace } from "hooks/store";
|
||||||
// hooks
|
// hooks
|
||||||
import useToast from "hooks/use-toast";
|
import useToast from "hooks/use-toast";
|
||||||
// ui
|
// ui
|
||||||
@ -55,8 +55,8 @@ export const WorkspaceSidebarDropdown = observer(() => {
|
|||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const {
|
||||||
theme: { sidebarCollapsed, toggleSidebar },
|
theme: { sidebarCollapsed, toggleSidebar },
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
} = useApplication();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
const { currentUser, updateCurrentUser, isUserInstanceAdmin, signOut } = useUser();
|
const { currentUser, updateCurrentUser, isUserInstanceAdmin, signOut } = useUser();
|
||||||
const { currentWorkspace: activeWorkspace, workspaces } = useWorkspace();
|
const { currentWorkspace: activeWorkspace, workspaces } = useWorkspace();
|
||||||
// hooks
|
// hooks
|
||||||
@ -110,13 +110,15 @@ export const WorkspaceSidebarDropdown = observer(() => {
|
|||||||
<>
|
<>
|
||||||
<Menu.Button className="group/menu-button h-full w-full truncate rounded-md text-sm font-medium text-custom-sidebar-text-200 hover:bg-custom-sidebar-background-80 focus:outline-none">
|
<Menu.Button className="group/menu-button h-full w-full truncate rounded-md text-sm font-medium text-custom-sidebar-text-200 hover:bg-custom-sidebar-background-80 focus:outline-none">
|
||||||
<div
|
<div
|
||||||
className={`flex items-center gap-x-2 truncate rounded p-1 ${sidebarCollapsed ? "justify-center" : "justify-between"
|
className={`flex items-center gap-x-2 truncate rounded p-1 ${
|
||||||
}`}
|
sidebarCollapsed ? "justify-center" : "justify-between"
|
||||||
|
}`}
|
||||||
>
|
>
|
||||||
<div className="flex items-center gap-2 truncate">
|
<div className="flex items-center gap-2 truncate">
|
||||||
<div
|
<div
|
||||||
className={`relative grid h-6 w-6 flex-shrink-0 place-items-center uppercase ${!activeWorkspace?.logo && "rounded bg-custom-primary-500 text-white"
|
className={`relative grid h-6 w-6 flex-shrink-0 place-items-center uppercase ${
|
||||||
}`}
|
!activeWorkspace?.logo && "rounded bg-custom-primary-500 text-white"
|
||||||
|
}`}
|
||||||
>
|
>
|
||||||
{activeWorkspace?.logo && activeWorkspace.logo !== "" ? (
|
{activeWorkspace?.logo && activeWorkspace.logo !== "" ? (
|
||||||
<img
|
<img
|
||||||
@ -136,8 +138,9 @@ export const WorkspaceSidebarDropdown = observer(() => {
|
|||||||
</div>
|
</div>
|
||||||
{!sidebarCollapsed && (
|
{!sidebarCollapsed && (
|
||||||
<ChevronDown
|
<ChevronDown
|
||||||
className={`mx-1 hidden h-4 w-4 flex-shrink-0 group-hover/menu-button:block ${open ? "rotate-180" : ""
|
className={`mx-1 hidden h-4 w-4 flex-shrink-0 group-hover/menu-button:block ${
|
||||||
} text-custom-sidebar-text-400 duration-300`}
|
open ? "rotate-180" : ""
|
||||||
|
} text-custom-sidebar-text-400 duration-300`}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@ -176,8 +179,9 @@ export const WorkspaceSidebarDropdown = observer(() => {
|
|||||||
>
|
>
|
||||||
<div className="flex items-center justify-start gap-2.5 truncate">
|
<div className="flex items-center justify-start gap-2.5 truncate">
|
||||||
<span
|
<span
|
||||||
className={`relative flex h-6 w-6 flex-shrink-0 items-center justify-center p-2 text-xs uppercase ${!workspace?.logo && "rounded bg-custom-primary-500 text-white"
|
className={`relative flex h-6 w-6 flex-shrink-0 items-center justify-center p-2 text-xs uppercase ${
|
||||||
}`}
|
!workspace?.logo && "rounded bg-custom-primary-500 text-white"
|
||||||
|
}`}
|
||||||
>
|
>
|
||||||
{workspace?.logo && workspace.logo !== "" ? (
|
{workspace?.logo && workspace.logo !== "" ? (
|
||||||
<img
|
<img
|
||||||
@ -190,8 +194,9 @@ export const WorkspaceSidebarDropdown = observer(() => {
|
|||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
<h5
|
<h5
|
||||||
className={`truncate text-sm font-medium ${workspaceSlug === workspace.slug ? "" : "text-custom-text-200"
|
className={`truncate text-sm font-medium ${
|
||||||
}`}
|
workspaceSlug === workspace.slug ? "" : "text-custom-text-200"
|
||||||
|
}`}
|
||||||
>
|
>
|
||||||
{workspace.name}
|
{workspace.name}
|
||||||
</h5>
|
</h5>
|
||||||
@ -338,4 +343,4 @@ export const WorkspaceSidebarDropdown = observer(() => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -2,7 +2,7 @@ import { useRef, useState } from "react";
|
|||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
import { ChevronUp, PenSquare, Search } from "lucide-react";
|
import { ChevronUp, PenSquare, Search } from "lucide-react";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useUser } from "hooks/store";
|
import { useApplication, useEventTracker, useUser } from "hooks/store";
|
||||||
import useLocalStorage from "hooks/use-local-storage";
|
import useLocalStorage from "hooks/use-local-storage";
|
||||||
// components
|
// components
|
||||||
import { CreateUpdateDraftIssueModal } from "components/issues";
|
import { CreateUpdateDraftIssueModal } from "components/issues";
|
||||||
@ -14,11 +14,8 @@ export const WorkspaceSidebarQuickAction = observer(() => {
|
|||||||
// states
|
// states
|
||||||
const [isDraftIssueModalOpen, setIsDraftIssueModalOpen] = useState(false);
|
const [isDraftIssueModalOpen, setIsDraftIssueModalOpen] = useState(false);
|
||||||
|
|
||||||
const {
|
const { theme: themeStore, commandPalette: commandPaletteStore } = useApplication();
|
||||||
theme: themeStore,
|
const { setTrackElement } = useEventTracker();
|
||||||
commandPalette: commandPaletteStore,
|
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
|
||||||
const {
|
const {
|
||||||
membership: { currentWorkspaceRole },
|
membership: { currentWorkspaceRole },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
|
105
web/constants/event-tracker.ts
Normal file
105
web/constants/event-tracker.ts
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
export type IssueEventProps = {
|
||||||
|
eventName: string;
|
||||||
|
payload: any;
|
||||||
|
updates?: any;
|
||||||
|
group?: EventGroupProps;
|
||||||
|
path?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type EventProps = {
|
||||||
|
eventName: string;
|
||||||
|
payload: any;
|
||||||
|
group?: EventGroupProps;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type EventGroupProps = {
|
||||||
|
isGrouping?: boolean;
|
||||||
|
groupType?: string;
|
||||||
|
groupId?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getProjectEventPayload = (payload: any) => ({
|
||||||
|
workspace_id: payload.workspace_id,
|
||||||
|
project_id: payload.id,
|
||||||
|
identifier: payload.identifier,
|
||||||
|
created_at: payload.created_at,
|
||||||
|
updated_at: payload.updated_at,
|
||||||
|
state: payload.state,
|
||||||
|
element: payload.element,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const getCycleEventPayload = (payload: any) => ({
|
||||||
|
workspace_id: payload.workspace_id,
|
||||||
|
project_id: payload.id,
|
||||||
|
cycle_id: payload.id,
|
||||||
|
created_at: payload.created_at,
|
||||||
|
updated_at: payload.updated_at,
|
||||||
|
start_date: payload.start_date,
|
||||||
|
target_date: payload.target_date,
|
||||||
|
cycle_status: payload.status,
|
||||||
|
state: payload.state,
|
||||||
|
element: payload.element,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const getModuleEventPayload = (payload: any) => ({
|
||||||
|
workspace_id: payload.workspace_id,
|
||||||
|
project_id: payload.id,
|
||||||
|
module_id: payload.id,
|
||||||
|
created_at: payload.created_at,
|
||||||
|
updated_at: payload.updated_at,
|
||||||
|
start_date: payload.start_date,
|
||||||
|
target_date: payload.target_date,
|
||||||
|
module_status: payload.status,
|
||||||
|
state: payload.state,
|
||||||
|
element: payload.element,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const getIssueEventPayload = (props: IssueEventProps) => {
|
||||||
|
const { eventName, payload, updates, path } = props;
|
||||||
|
let eventPayload: any = {
|
||||||
|
issue_id: payload.id,
|
||||||
|
estimate_point: payload.estimate_point,
|
||||||
|
link_count: payload.link_count,
|
||||||
|
target_date: payload.target_date,
|
||||||
|
is_draft: payload.is_draft,
|
||||||
|
label_ids: payload.label_ids,
|
||||||
|
assignee_ids: payload.assignee_ids,
|
||||||
|
created_at: payload.created_at,
|
||||||
|
updated_at: payload.updated_at,
|
||||||
|
sequence_id: payload.sequence_id,
|
||||||
|
module_ids: payload.module_ids,
|
||||||
|
sub_issues_count: payload.sub_issues_count,
|
||||||
|
parent_id: payload.parent_id,
|
||||||
|
project_id: payload.project_id,
|
||||||
|
priority: payload.priority,
|
||||||
|
state_id: payload.state_id,
|
||||||
|
start_date: payload.start_date,
|
||||||
|
attachment_count: payload.attachment_count,
|
||||||
|
cycle_id: payload.cycle_id,
|
||||||
|
module_id: payload.module_id,
|
||||||
|
archived_at: payload.archived_at,
|
||||||
|
state: payload.state,
|
||||||
|
view_id: path?.includes("workspace-views") || path?.includes("views") ? path.split("/").pop() : "",
|
||||||
|
};
|
||||||
|
|
||||||
|
if (eventName === "Issue updated") {
|
||||||
|
eventPayload = {
|
||||||
|
...eventPayload,
|
||||||
|
...updates,
|
||||||
|
updated_from: props.path?.includes("workspace-views")
|
||||||
|
? "All views"
|
||||||
|
: props.path?.includes("cycles")
|
||||||
|
? "Cycle"
|
||||||
|
: props.path?.includes("modules")
|
||||||
|
? "Module"
|
||||||
|
: props.path?.includes("views")
|
||||||
|
? "Project view"
|
||||||
|
: props.path?.includes("inbox")
|
||||||
|
? "Inbox"
|
||||||
|
: props.path?.includes("draft")
|
||||||
|
? "Draft"
|
||||||
|
: "Project",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return eventPayload;
|
||||||
|
};
|
@ -26,7 +26,11 @@ export const SPREADSHEET_PROPERTY_DETAILS: {
|
|||||||
descendingOrderKey: TIssueOrderByOptions;
|
descendingOrderKey: TIssueOrderByOptions;
|
||||||
descendingOrderTitle: string;
|
descendingOrderTitle: string;
|
||||||
icon: FC<ISvgIcons>;
|
icon: FC<ISvgIcons>;
|
||||||
Column: React.FC<{ issue: TIssue; onChange: (issue: TIssue, data: Partial<TIssue>) => void; disabled: boolean }>;
|
Column: React.FC<{
|
||||||
|
issue: TIssue;
|
||||||
|
onChange: (issue: TIssue, data: Partial<TIssue>, updates: any) => void;
|
||||||
|
disabled: boolean;
|
||||||
|
}>;
|
||||||
};
|
};
|
||||||
} = {
|
} = {
|
||||||
assignee: {
|
assignee: {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
export * from "./use-application";
|
export * from "./use-application";
|
||||||
|
export * from "./use-event-tracker"
|
||||||
export * from "./use-calendar-view";
|
export * from "./use-calendar-view";
|
||||||
export * from "./use-cycle";
|
export * from "./use-cycle";
|
||||||
export * from "./use-dashboard";
|
export * from "./use-dashboard";
|
||||||
|
11
web/hooks/store/use-event-tracker.ts
Normal file
11
web/hooks/store/use-event-tracker.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { useContext } from "react";
|
||||||
|
// mobx store
|
||||||
|
import { StoreContext } from "contexts/store-context";
|
||||||
|
// types
|
||||||
|
import { IEventTrackerStore } from "store/event-tracker.store";
|
||||||
|
|
||||||
|
export const useEventTracker = (): IEventTrackerStore => {
|
||||||
|
const context = useContext(StoreContext);
|
||||||
|
if (context === undefined) throw new Error("useEventTracker must be used within StoreProvider");
|
||||||
|
return context.eventTracker;
|
||||||
|
};
|
@ -12,7 +12,7 @@ import { ProjectSidebarList } from "components/project";
|
|||||||
import { useApplication } from "hooks/store";
|
import { useApplication } from "hooks/store";
|
||||||
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
||||||
|
|
||||||
export interface IAppSidebar { }
|
export interface IAppSidebar {}
|
||||||
|
|
||||||
export const AppSidebar: FC<IAppSidebar> = observer(() => {
|
export const AppSidebar: FC<IAppSidebar> = observer(() => {
|
||||||
// store hooks
|
// store hooks
|
||||||
@ -34,24 +34,23 @@ export const AppSidebar: FC<IAppSidebar> = observer(() => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
handleResize();
|
handleResize();
|
||||||
window.addEventListener('resize', handleResize);
|
window.addEventListener("resize", handleResize);
|
||||||
return () => {
|
return () => {
|
||||||
window.removeEventListener('resize', handleResize);
|
window.removeEventListener("resize", handleResize);
|
||||||
};
|
};
|
||||||
}, [themStore]);
|
}, [themStore]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`inset-y-0 z-30 flex h-full flex-shrink-0 flex-grow-0 flex-col border-r border-custom-sidebar-border-200 bg-custom-sidebar-background-100 duration-300
|
className={`inset-y-0 z-20 flex h-full flex-shrink-0 flex-grow-0 flex-col border-r border-custom-sidebar-border-200 bg-custom-sidebar-background-100 duration-300
|
||||||
fixed md:relative
|
fixed md:relative
|
||||||
${themStore.sidebarCollapsed ? "-ml-[280px]" : ""}
|
${themStore.sidebarCollapsed ? "-ml-[280px]" : ""}
|
||||||
sm:${themStore.sidebarCollapsed ? "-ml-[280px]" : ""}
|
sm:${themStore.sidebarCollapsed ? "-ml-[280px]" : ""}
|
||||||
md:ml-0 ${themStore.sidebarCollapsed ? 'w-[80px]' : 'w-[280px]'}
|
md:ml-0 ${themStore.sidebarCollapsed ? "w-[80px]" : "w-[280px]"}
|
||||||
lg:ml-0 ${themStore.sidebarCollapsed ? 'w-[80px]' : 'w-[280px]'}
|
lg:ml-0 ${themStore.sidebarCollapsed ? "w-[80px]" : "w-[280px]"}
|
||||||
`} >
|
`}
|
||||||
<div
|
>
|
||||||
ref={ref}
|
<div ref={ref} className="flex h-full w-full flex-1 flex-col">
|
||||||
className="flex h-full w-full flex-1 flex-col">
|
|
||||||
<WorkspaceSidebarDropdown />
|
<WorkspaceSidebarDropdown />
|
||||||
<WorkspaceSidebarQuickAction />
|
<WorkspaceSidebarQuickAction />
|
||||||
<WorkspaceSidebarMenu />
|
<WorkspaceSidebarMenu />
|
||||||
@ -61,6 +60,3 @@ export const AppSidebar: FC<IAppSidebar> = observer(() => {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ import useSWR from "swr";
|
|||||||
// hooks
|
// hooks
|
||||||
import {
|
import {
|
||||||
useApplication,
|
useApplication,
|
||||||
|
useEventTracker,
|
||||||
useCycle,
|
useCycle,
|
||||||
useEstimate,
|
useEstimate,
|
||||||
useLabel,
|
useLabel,
|
||||||
@ -34,6 +35,7 @@ export const ProjectAuthWrapper: FC<IProjectAuthWrapper> = observer((props) => {
|
|||||||
const {
|
const {
|
||||||
commandPalette: { toggleCreateProjectModal },
|
commandPalette: { toggleCreateProjectModal },
|
||||||
} = useApplication();
|
} = useApplication();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
const {
|
const {
|
||||||
membership: { fetchUserProjectInfo, projectMemberInfo, hasPermissionToProject },
|
membership: { fetchUserProjectInfo, projectMemberInfo, hasPermissionToProject },
|
||||||
} = useUser();
|
} = useUser();
|
||||||
@ -135,7 +137,10 @@ export const ProjectAuthWrapper: FC<IProjectAuthWrapper> = observer((props) => {
|
|||||||
image={emptyProject}
|
image={emptyProject}
|
||||||
primaryButton={{
|
primaryButton={{
|
||||||
text: "Create Project",
|
text: "Create Project",
|
||||||
onClick: () => toggleCreateProjectModal(true),
|
onClick: () => {
|
||||||
|
setTrackElement("Projects page empty state");
|
||||||
|
toggleCreateProjectModal(true);
|
||||||
|
},
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -17,7 +17,7 @@ import { SWRConfig } from "swr";
|
|||||||
import { SWR_CONFIG } from "constants/swr-config";
|
import { SWR_CONFIG } from "constants/swr-config";
|
||||||
// dynamic imports
|
// dynamic imports
|
||||||
const StoreWrapper = dynamic(() => import("lib/wrappers/store-wrapper"), { ssr: false });
|
const StoreWrapper = dynamic(() => import("lib/wrappers/store-wrapper"), { ssr: false });
|
||||||
const PosthogWrapper = dynamic(() => import("lib/wrappers/posthog-wrapper"), { ssr: false });
|
const PostHogProvider = dynamic(() => import("lib/posthog-provider"), { ssr: false });
|
||||||
const CrispWrapper = dynamic(() => import("lib/wrappers/crisp-wrapper"), { ssr: false });
|
const CrispWrapper = dynamic(() => import("lib/wrappers/crisp-wrapper"), { ssr: false });
|
||||||
|
|
||||||
// nprogress
|
// nprogress
|
||||||
@ -47,7 +47,7 @@ export const AppProvider: FC<IAppProvider> = observer((props) => {
|
|||||||
<InstanceLayout>
|
<InstanceLayout>
|
||||||
<StoreWrapper>
|
<StoreWrapper>
|
||||||
<CrispWrapper user={currentUser}>
|
<CrispWrapper user={currentUser}>
|
||||||
<PosthogWrapper
|
<PostHogProvider
|
||||||
user={currentUser}
|
user={currentUser}
|
||||||
workspaceRole={currentWorkspaceRole}
|
workspaceRole={currentWorkspaceRole}
|
||||||
projectRole={currentProjectRole}
|
projectRole={currentProjectRole}
|
||||||
@ -55,7 +55,7 @@ export const AppProvider: FC<IAppProvider> = observer((props) => {
|
|||||||
posthogHost={envConfig?.posthog_host || null}
|
posthogHost={envConfig?.posthog_host || null}
|
||||||
>
|
>
|
||||||
<SWRConfig value={SWR_CONFIG}>{children}</SWRConfig>
|
<SWRConfig value={SWR_CONFIG}>{children}</SWRConfig>
|
||||||
</PosthogWrapper>
|
</PostHogProvider>
|
||||||
</CrispWrapper>
|
</CrispWrapper>
|
||||||
</StoreWrapper>
|
</StoreWrapper>
|
||||||
</InstanceLayout>
|
</InstanceLayout>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { FC, ReactNode, useEffect } from "react";
|
import { FC, ReactNode, useEffect } from "react";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import posthog from "posthog-js";
|
import posthog from "posthog-js";
|
||||||
import { PostHogProvider } from "posthog-js/react";
|
import { PostHogProvider as PHProvider } from "posthog-js/react";
|
||||||
// mobx store provider
|
// mobx store provider
|
||||||
import { IUser } from "@plane/types";
|
import { IUser } from "@plane/types";
|
||||||
// helpers
|
// helpers
|
||||||
@ -16,7 +16,7 @@ export interface IPosthogWrapper {
|
|||||||
posthogHost: string | null;
|
posthogHost: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const PosthogWrapper: FC<IPosthogWrapper> = (props) => {
|
const PostHogProvider: FC<IPosthogWrapper> = (props) => {
|
||||||
const { children, user, workspaceRole, projectRole, posthogAPIKey, posthogHost } = props;
|
const { children, user, workspaceRole, projectRole, posthogAPIKey, posthogHost } = props;
|
||||||
// router
|
// router
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@ -39,10 +39,6 @@ const PosthogWrapper: FC<IPosthogWrapper> = (props) => {
|
|||||||
if (posthogAPIKey && posthogHost) {
|
if (posthogAPIKey && posthogHost) {
|
||||||
posthog.init(posthogAPIKey, {
|
posthog.init(posthogAPIKey, {
|
||||||
api_host: posthogHost || "https://app.posthog.com",
|
api_host: posthogHost || "https://app.posthog.com",
|
||||||
// Enable debug mode in development
|
|
||||||
// loaded: (posthog) => {
|
|
||||||
// if (process.env.NODE_ENV === "development") posthog.debug();
|
|
||||||
// },
|
|
||||||
autocapture: false,
|
autocapture: false,
|
||||||
capture_pageview: false, // Disable automatic pageview capture, as we capture manually
|
capture_pageview: false, // Disable automatic pageview capture, as we capture manually
|
||||||
});
|
});
|
||||||
@ -63,9 +59,9 @@ const PosthogWrapper: FC<IPosthogWrapper> = (props) => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
if (posthogAPIKey) {
|
if (posthogAPIKey) {
|
||||||
return <PostHogProvider client={posthog}>{children}</PostHogProvider>;
|
return <PHProvider client={posthog}>{children}</PHProvider>;
|
||||||
}
|
}
|
||||||
return <>{children}</>;
|
return <>{children}</>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default PosthogWrapper;
|
export default PostHogProvider;
|
@ -1,16 +0,0 @@
|
|||||||
import Router from "next/router";
|
|
||||||
import type { NextPageContext } from "next";
|
|
||||||
|
|
||||||
const redirect = (context: NextPageContext, target: any) => {
|
|
||||||
if (context.res) {
|
|
||||||
// server
|
|
||||||
// 303: "See other"
|
|
||||||
context.res.writeHead(301, { Location: target });
|
|
||||||
context.res.end();
|
|
||||||
} else {
|
|
||||||
// In the browser, we just pretend like this never even happened ;)
|
|
||||||
Router.push(target);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export default redirect;
|
|
@ -3,7 +3,7 @@ import { observer } from "mobx-react-lite";
|
|||||||
import { Tab } from "@headlessui/react";
|
import { Tab } from "@headlessui/react";
|
||||||
import { useTheme } from "next-themes";
|
import { useTheme } from "next-themes";
|
||||||
// hooks
|
// hooks
|
||||||
import { useApplication, useProject, useUser } from "hooks/store";
|
import { useApplication, useEventTracker, useProject, useUser } from "hooks/store";
|
||||||
// layouts
|
// layouts
|
||||||
import { AppLayout } from "layouts/app-layout";
|
import { AppLayout } from "layouts/app-layout";
|
||||||
// components
|
// components
|
||||||
@ -22,8 +22,8 @@ const AnalyticsPage: NextPageWithLayout = observer(() => {
|
|||||||
// store hooks
|
// store hooks
|
||||||
const {
|
const {
|
||||||
commandPalette: { toggleCreateProjectModal },
|
commandPalette: { toggleCreateProjectModal },
|
||||||
eventTracker: { setTrackElement },
|
|
||||||
} = useApplication();
|
} = useApplication();
|
||||||
|
const { setTrackElement } = useEventTracker();
|
||||||
const {
|
const {
|
||||||
membership: { currentWorkspaceRole },
|
membership: { currentWorkspaceRole },
|
||||||
currentUser,
|
currentUser,
|
||||||
@ -72,7 +72,7 @@ const AnalyticsPage: NextPageWithLayout = observer(() => {
|
|||||||
primaryButton={{
|
primaryButton={{
|
||||||
text: "Create Cycles and Modules first",
|
text: "Create Cycles and Modules first",
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
setTrackElement("ANALYTICS_EMPTY_STATE");
|
setTrackElement("Analytics empty state");
|
||||||
toggleCreateProjectModal(true);
|
toggleCreateProjectModal(true);
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user