From e1bf31831798301f81c4cbb731d546574ba130a5 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Mon, 19 Feb 2024 21:07:43 +0530 Subject: [PATCH] chore : project inbox improvement (#3695) * chore: project inbox layout loader added * chore: project inbox layout loader added * chore: project inbox added in sidebar project items * chore: inbox loader improvement * chore: project inbox improvement --- web/components/headers/project-issues.tsx | 35 +++----- web/components/inbox/sidebar/root.tsx | 22 ++--- web/components/project/sidebar-list-item.tsx | 88 ++++++++++++++----- web/components/ui/loader/layouts/index.ts | 1 + .../project-inbox/inbox-layout-loader.tsx | 19 ++++ .../project-inbox/inbox-sidebar-loader.tsx | 24 +++++ .../ui/loader/layouts/project-inbox/index.ts | 2 + .../projects/[projectId]/inbox/index.tsx | 4 +- 8 files changed, 136 insertions(+), 59 deletions(-) create mode 100644 web/components/ui/loader/layouts/project-inbox/inbox-layout-loader.tsx create mode 100644 web/components/ui/loader/layouts/project-inbox/inbox-sidebar-loader.tsx create mode 100644 web/components/ui/loader/layouts/project-inbox/index.ts diff --git a/web/components/headers/project-issues.tsx b/web/components/headers/project-issues.tsx index 5c44a84d6..033196758 100644 --- a/web/components/headers/project-issues.tsx +++ b/web/components/headers/project-issues.tsx @@ -1,8 +1,7 @@ import { useCallback, useState } from "react"; -import Link from "next/link"; import { useRouter } from "next/router"; import { observer } from "mobx-react-lite"; -import { Briefcase, Circle, ExternalLink, Plus, Inbox } from "lucide-react"; +import { Briefcase, Circle, ExternalLink, Plus } from "lucide-react"; // hooks import { useApplication, @@ -11,7 +10,6 @@ import { useProject, useProjectState, useUser, - useInbox, useMember, } from "hooks/store"; // components @@ -54,7 +52,6 @@ export const ProjectIssuesHeader: React.FC = observer(() => { const { currentProjectDetails } = useProject(); const { projectStates } = useProjectState(); const { projectLabels } = useLabel(); - const { getInboxesByProjectId, getInboxById } = useInbox(); const activeLayout = issueFilters?.displayFilters?.layout; @@ -101,9 +98,6 @@ export const ProjectIssuesHeader: React.FC = observer(() => { [workspaceSlug, projectId, updateFilters] ); - const inboxesMap = currentProjectDetails?.inbox_view ? getInboxesByProjectId(currentProjectDetails.id) : undefined; - const inboxDetails = inboxesMap && inboxesMap.length > 0 ? getInboxById(inboxesMap[0]) : undefined; - const deployUrl = process.env.NEXT_PUBLIC_DEPLOY_URL; const canUserCreateIssue = currentProjectRole && [EUserProjectRoles.ADMIN, EUserProjectRoles.MEMBER].includes(currentProjectRole); @@ -154,7 +148,9 @@ export const ProjectIssuesHeader: React.FC = observer(() => { } />} + link={ + } /> + } /> @@ -201,24 +197,15 @@ export const ProjectIssuesHeader: React.FC = observer(() => { /> - {currentProjectDetails?.inbox_view && inboxDetails && ( - - - - - - - )} + {canUserCreateIssue && ( <> -