From e07ffc3a46dfefde3afb8d46179e24ab9099f526 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Wed, 29 Mar 2023 11:52:39 +0530 Subject: [PATCH] fix: module sidebar link section relocation (#569) --- .../core/sidebar/sidebar-progress-stats.tsx | 58 ++----------------- apps/app/components/modules/sidebar.tsx | 30 ++++++++-- 2 files changed, 31 insertions(+), 57 deletions(-) diff --git a/apps/app/components/core/sidebar/sidebar-progress-stats.tsx b/apps/app/components/core/sidebar/sidebar-progress-stats.tsx index 6e06a2f11..fe4b2b832 100644 --- a/apps/app/components/core/sidebar/sidebar-progress-stats.tsx +++ b/apps/app/components/core/sidebar/sidebar-progress-stats.tsx @@ -13,12 +13,11 @@ import projectService from "services/project.service"; // hooks import useLocalStorage from "hooks/use-local-storage"; // components -import { LinksList, SingleProgressStats } from "components/core"; +import { SingleProgressStats } from "components/core"; // ui import { Avatar } from "components/ui"; // icons import User from "public/user.png"; -import { PlusIcon } from "@heroicons/react/24/outline"; // types import { IIssue, IIssueLabels, IModule, UserAuth } from "types"; // fetch-keys @@ -28,8 +27,6 @@ type Props = { groupedIssues: any; issues: IIssue[]; module?: IModule; - setModuleLinkModal?: any; - handleDeleteLink?: any; userAuth?: UserAuth; }; @@ -47,8 +44,6 @@ export const SidebarProgressStats: React.FC = ({ groupedIssues, issues, module, - setModuleLinkModal, - handleDeleteLink, userAuth, }) => { const router = useRouter(); @@ -72,14 +67,12 @@ export const SidebarProgressStats: React.FC = ({ const currentValue = (tab: string | null) => { switch (tab) { - case "Links": - return 0; case "Assignees": - return 1; + return 0; case "Labels": - return 2; + return 1; case "States": - return 3; + return 2; default: return 3; @@ -91,12 +84,10 @@ export const SidebarProgressStats: React.FC = ({ onChange={(i) => { switch (i) { case 0: - return setTab("Links"); - case 1: return setTab("Assignees"); - case 2: + case 1: return setTab("Labels"); - case 3: + case 2: return setTab("States"); default: @@ -109,20 +100,6 @@ export const SidebarProgressStats: React.FC = ({ className={`flex w-full items-center justify-between rounded-md bg-gray-100 px-1 py-1.5 ${module ? "text-xs" : "text-sm"} `} > - {module ? ( - - `w-full rounded px-3 py-1 text-gray-900 ${ - selected ? " bg-theme text-white" : " hover:bg-hover-gray" - }` - } - > - Links - - ) : ( - "" - )} - `w-full rounded px-3 py-1 text-gray-900 ${ @@ -152,29 +129,6 @@ export const SidebarProgressStats: React.FC = ({ - {module ? ( - - -
- {userAuth && module.link_module && module.link_module.length > 0 ? ( - - ) : null} -
-
- ) : ( - "" - )} - {members?.map((member, index) => { const totalArray = issues?.filter((i) => i.assignees?.includes(member.member.id)); diff --git a/apps/app/components/modules/sidebar.tsx b/apps/app/components/modules/sidebar.tsx index 7f360a419..839030740 100644 --- a/apps/app/components/modules/sidebar.tsx +++ b/apps/app/components/modules/sidebar.tsx @@ -14,6 +14,7 @@ import { ChevronDownIcon, DocumentDuplicateIcon, DocumentIcon, + PlusIcon, TrashIcon, } from "@heroicons/react/24/outline"; @@ -24,7 +25,7 @@ import modulesService from "services/modules.service"; // hooks import useToast from "hooks/use-toast"; // components -import { LinkModal, SidebarProgressStats } from "components/core"; +import { LinkModal, LinksList, SidebarProgressStats } from "components/core"; import { DeleteModuleModal, SidebarLeadSelect, SidebarMembersSelect } from "components/modules"; import ProgressChart from "components/core/sidebar/progress-chart"; import { CustomMenu, CustomSelect, Loader, ProgressBar } from "components/ui"; @@ -414,7 +415,7 @@ export const ModuleDetailsSidebar: React.FC = ({ {isStartValid && isEndValid ? ( - +