chore: update cycle and module stats logic (#1323)

* refactor: cycles stats

* chore: show assignee avatar in stats

* chore: cycles and modules sidebar stats refactor

* fix: build errors
This commit is contained in:
Aaryan Khandelwal 2023-06-20 16:32:02 +05:30 committed by GitHub
parent d7097330ef
commit cf8c902473
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 297 additions and 401 deletions

View file

@ -32,7 +32,7 @@ import { ListBulletIcon, PlusIcon, Squares2X2Icon } from "@heroicons/react/24/ou
import { SelectCycleType } from "types";
import type { NextPage } from "next";
// fetch-keys
import { CURRENT_CYCLE_LIST, PROJECT_DETAILS } from "constants/fetch-keys";
import { PROJECT_DETAILS } from "constants/fetch-keys";
const tabsList = ["All", "Active", "Upcoming", "Completed", "Drafts"];
@ -72,14 +72,6 @@ const ProjectCycles: NextPage = () => {
: null
);
const { data: currentCycle } = useSWR(
workspaceSlug && projectId ? CURRENT_CYCLE_LIST(projectId as string) : null,
workspaceSlug && projectId
? () =>
cycleService.getCyclesWithParams(workspaceSlug as string, projectId as string, "current")
: null
);
useEffect(() => {
if (createUpdateCycleModal) return;
const timer = setTimeout(() => {
@ -201,15 +193,7 @@ const ProjectCycles: NextPage = () => {
</Tab.Panel>
{cyclesView !== "gantt_chart" && (
<Tab.Panel as="div" className="mt-7 space-y-5 h-full overflow-y-auto">
{currentCycle?.[0] ? (
<ActiveCycleDetails cycle={currentCycle?.[0]} />
) : (
<div className="flex w-full items-center justify-start rounded-[10px] bg-brand-surface-2 px-6 py-4">
<h3 className="text-base font-medium text-brand-base ">
No active cycle is present.
</h3>
</div>
)}
<ActiveCycleDetails />
</Tab.Panel>
)}
<Tab.Panel as="div" className="h-full overflow-y-auto">

View file

@ -5,13 +5,7 @@ import { useRouter } from "next/router";
import useSWR, { mutate } from "swr";
// icons
import {
ArrowLeftIcon,
ListBulletIcon,
PlusIcon,
RectangleGroupIcon,
RectangleStackIcon,
} from "@heroicons/react/24/outline";
import { ArrowLeftIcon, RectangleGroupIcon } from "@heroicons/react/24/outline";
// services
import modulesService from "services/modules.service";
import issuesService from "services/issues.service";
@ -191,7 +185,6 @@ const SingleModule: React.FC = () => {
</div>
<ModuleDetailsSidebar
issues={moduleIssues ?? []}
module={moduleDetails}
isOpen={moduleSidebar}
moduleIssues={moduleIssues}