mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
ab6f1ef780
* chore: cycle endpoint changes * chore: completed cycle icon updated * chore: project cycle list revamp and code refactor * chore: cycle page improvement * chore: added created by in retrieve endopoint * fix: build error * chore: cycle list page disclosure button improvement --------- Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
77 lines
3.0 KiB
TypeScript
77 lines
3.0 KiB
TypeScript
import { FC } from "react";
|
|
import { observer } from "mobx-react-lite";
|
|
import { Disclosure } from "@headlessui/react";
|
|
// components
|
|
import { ListLayout } from "@/components/core/list";
|
|
import { ActiveCycleRoot, CycleListGroupHeader, CyclePeekOverview, CyclesListMap } from "@/components/cycles";
|
|
|
|
export interface ICyclesList {
|
|
completedCycleIds: string[];
|
|
upcomingCycleIds?: string[] | undefined;
|
|
cycleIds: string[];
|
|
workspaceSlug: string;
|
|
projectId: string;
|
|
isArchived?: boolean;
|
|
}
|
|
|
|
export const CyclesList: FC<ICyclesList> = observer((props) => {
|
|
const { completedCycleIds, upcomingCycleIds, cycleIds, workspaceSlug, projectId, isArchived = false } = props;
|
|
|
|
return (
|
|
<div className="flex h-full w-full justify-between ">
|
|
<ListLayout>
|
|
{isArchived ? (
|
|
<>
|
|
<CyclesListMap cycleIds={cycleIds} projectId={projectId} workspaceSlug={workspaceSlug} />
|
|
</>
|
|
) : (
|
|
<>
|
|
<ActiveCycleRoot workspaceSlug={workspaceSlug.toString()} projectId={projectId.toString()} />
|
|
|
|
{upcomingCycleIds && (
|
|
<Disclosure as="div" className="flex flex-shrink-0 flex-col" defaultOpen>
|
|
{({ open }) => (
|
|
<>
|
|
<Disclosure.Button className="sticky top-0 z-[2] w-full flex-shrink-0 border-b border-custom-border-200 bg-custom-background-90 px-7 py-1 cursor-pointer">
|
|
<CycleListGroupHeader
|
|
title="Upcoming cycle"
|
|
type="upcoming"
|
|
count={upcomingCycleIds.length}
|
|
showCount
|
|
isExpanded={open}
|
|
/>
|
|
</Disclosure.Button>
|
|
<Disclosure.Panel>
|
|
<CyclesListMap cycleIds={upcomingCycleIds} projectId={projectId} workspaceSlug={workspaceSlug} />
|
|
</Disclosure.Panel>
|
|
</>
|
|
)}
|
|
</Disclosure>
|
|
)}
|
|
|
|
<Disclosure as="div" className="flex flex-shrink-0 flex-col pb-7">
|
|
{({ open }) => (
|
|
<>
|
|
<Disclosure.Button className="sticky top-0 z-[2] w-full flex-shrink-0 border-b border-custom-border-200 bg-custom-background-90 px-7 py-1 cursor-pointer">
|
|
<CycleListGroupHeader
|
|
title="Completed cycle"
|
|
type="completed"
|
|
count={completedCycleIds.length}
|
|
showCount
|
|
isExpanded={open}
|
|
/>
|
|
</Disclosure.Button>
|
|
<Disclosure.Panel>
|
|
<CyclesListMap cycleIds={completedCycleIds} projectId={projectId} workspaceSlug={workspaceSlug} />
|
|
</Disclosure.Panel>
|
|
</>
|
|
)}
|
|
</Disclosure>
|
|
</>
|
|
)}
|
|
</ListLayout>
|
|
<CyclePeekOverview projectId={projectId} workspaceSlug={workspaceSlug} isArchived={isArchived} />
|
|
</div>
|
|
);
|
|
});
|