Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/types/src/home.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export type TIssueEntityData = {
sequence_id: number;
project_id: string;
project_identifier: string;
is_epic: boolean;
};

export type TActivityEntityData = {
Expand Down
1 change: 1 addition & 0 deletions web/ce/components/home/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./peek-overviews";
9 changes: 9 additions & 0 deletions web/ce/components/home/peek-overviews.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use client";

import { IssuePeekOverview } from "@/components/issues";

export const HomePeekOverviewsRoot = () => (
<>
<IssuePeekOverview />
</>
);
4 changes: 2 additions & 2 deletions web/core/components/home/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -57,7 +57,7 @@ export const WorkspaceHomeView = observer(() => {
</div>
)}
<>
<IssuePeekOverview />
<HomePeekOverviewsRoot />
<ContentWrapper
className={cn("gap-6 bg-custom-background-90/20", {
"vertical-scrollbar scrollbar-lg": windowWidth >= 768,
Expand Down
27 changes: 20 additions & 7 deletions web/core/components/home/widgets/recents/issue.tsx
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -18,11 +21,12 @@ type BlockProps = {
ref: React.RefObject<HTMLDivElement>;
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;
Expand All @@ -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<HTMLAnchorElement>) => {
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 (
<ListItem
key={activity.id}
Expand Down Expand Up @@ -109,12 +126,8 @@ export const RecentIssue = (props: BlockProps) => {
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
/>
);
};
});
1 change: 1 addition & 0 deletions web/ee/components/home/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "ce/components/home";