diff --git a/packages/types/src/home.d.ts b/packages/types/src/home.d.ts index 56089bf46e3..f34c15380c3 100644 --- a/packages/types/src/home.d.ts +++ b/packages/types/src/home.d.ts @@ -35,6 +35,7 @@ export type TIssueEntityData = { sequence_id: number; project_id: string; project_identifier: string; + is_epic: boolean; }; export type TActivityEntityData = { diff --git a/web/ce/components/home/index.ts b/web/ce/components/home/index.ts new file mode 100644 index 00000000000..d64a7a983d5 --- /dev/null +++ b/web/ce/components/home/index.ts @@ -0,0 +1 @@ +export * from "./peek-overviews"; diff --git a/web/ce/components/home/peek-overviews.tsx b/web/ce/components/home/peek-overviews.tsx new file mode 100644 index 00000000000..a321f4a9b00 --- /dev/null +++ b/web/ce/components/home/peek-overviews.tsx @@ -0,0 +1,9 @@ +"use client"; + +import { IssuePeekOverview } from "@/components/issues"; + +export const HomePeekOverviewsRoot = () => ( + <> + + +); diff --git a/web/core/components/home/root.tsx b/web/core/components/home/root.tsx index f137db95707..b4e75ce95bc 100644 --- a/web/core/components/home/root.tsx +++ b/web/core/components/home/root.tsx @@ -12,7 +12,7 @@ import { cn } from "@/helpers/common.helper"; import { useUserProfile, useEventTracker, useUser } from "@/hooks/store"; import { useHome } from "@/hooks/store/use-home"; import useSize from "@/hooks/use-window-size"; -import { IssuePeekOverview } from "../issues"; +import { HomePeekOverviewsRoot } from "@/plane-web/components/home"; import { DashboardWidgets } from "./home-dashboard-widgets"; import { UserGreetingsView } from "./user-greetings"; @@ -57,7 +57,7 @@ export const WorkspaceHomeView = observer(() => { )} <> - + = 768, diff --git a/web/core/components/home/widgets/recents/issue.tsx b/web/core/components/home/widgets/recents/issue.tsx index 5c16457b391..63bd732b3d8 100644 --- a/web/core/components/home/widgets/recents/issue.tsx +++ b/web/core/components/home/widgets/recents/issue.tsx @@ -1,3 +1,6 @@ +import { observer } from "mobx-react"; +// plane constants +import { EIssueServiceType } from "@plane/constants"; // plane types import { TActivityEntityData, TIssueEntityData } from "@plane/types"; // plane ui @@ -18,11 +21,12 @@ type BlockProps = { ref: React.RefObject; workspaceSlug: string; }; -export const RecentIssue = (props: BlockProps) => { +export const RecentIssue = observer((props: BlockProps) => { const { activity, ref, workspaceSlug } = props; // hooks const { getStateById } = useProjectState(); const { setPeekIssue } = useIssueDetail(); + const { setPeekIssue: setPeekEpic } = useIssueDetail(EIssueServiceType.EPICS); const { getProjectIdentifierById } = useProject(); // derived values const issueDetails: TIssueEntityData = activity.entity_data as TIssueEntityData; @@ -38,8 +42,21 @@ export const RecentIssue = (props: BlockProps) => { issueId: issueDetails?.id, projectIdentifier, sequenceId: issueDetails?.sequence_id, + isEpic: issueDetails?.is_epic, }); + const handlePeekOverview = (e: React.MouseEvent) => { + e.preventDefault(); + e.stopPropagation(); + const peekDetails = { + workspaceSlug, + projectId: issueDetails?.project_id, + issueId: activity.entity_data.id, + }; + if (issueDetails?.is_epic) setPeekEpic(peekDetails); + else setPeekIssue(peekDetails); + }; + return ( { disableLink={false} className="bg-transparent my-auto !px-2 border-none py-3" itemClassName="my-auto" - onItemClick={(e) => { - e.preventDefault(); - e.stopPropagation(); - setPeekIssue({ workspaceSlug, projectId: issueDetails?.project_id, issueId: activity.entity_data.id }); - }} + onItemClick={handlePeekOverview} preventDefaultNProgress /> ); -}; +}); diff --git a/web/ee/components/home/index.ts b/web/ee/components/home/index.ts new file mode 100644 index 00000000000..b9ddf37161c --- /dev/null +++ b/web/ee/components/home/index.ts @@ -0,0 +1 @@ +export * from "ce/components/home";