forked from github/plane
fix: workspace dropdown (#447)
* fix: workspace dropdown links * fix: module progress round off
This commit is contained in:
parent
c11bf7c7de
commit
4639ab3d9c
@ -57,6 +57,7 @@ export const SingleModuleCard: React.FC<Props> = ({ module, handleEditModule })
|
|||||||
const completedIssues = (moduleIssues ?? []).filter(
|
const completedIssues = (moduleIssues ?? []).filter(
|
||||||
(i) => i.state_detail.group === "completed" || i.state_detail.group === "cancelled"
|
(i) => i.state_detail.group === "completed" || i.state_detail.group === "cancelled"
|
||||||
).length;
|
).length;
|
||||||
|
const completionPercentage = (completedIssues / (moduleIssues ?? []).length) * 100;
|
||||||
|
|
||||||
const handleDeleteModule = () => {
|
const handleDeleteModule = () => {
|
||||||
if (!module) return;
|
if (!module) return;
|
||||||
@ -156,7 +157,7 @@ export const SingleModuleCard: React.FC<Props> = ({ module, handleEditModule })
|
|||||||
<div className="rounded-[10px] border bg-white text-xs">
|
<div className="rounded-[10px] border bg-white text-xs">
|
||||||
<div className="p-4">
|
<div className="p-4">
|
||||||
<div className="flex w-full flex-col gap-5">
|
<div className="flex w-full flex-col gap-5">
|
||||||
<div className="flex items-center justify-between gap-2">
|
<div className="flex items-start justify-between gap-2">
|
||||||
<Tooltip tooltipContent={module.name} position="top-left">
|
<Tooltip tooltipContent={module.name} position="top-left">
|
||||||
<Link href={`/${workspaceSlug}/projects/${module.project}/modules/${module.id}`}>
|
<Link href={`/${workspaceSlug}/projects/${module.project}/modules/${module.id}`}>
|
||||||
<a className="w-full">
|
<a className="w-full">
|
||||||
@ -260,9 +261,13 @@ export const SingleModuleCard: React.FC<Props> = ({ module, handleEditModule })
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-2 bg-gray-100 p-4">
|
<div className="flex gap-2 bg-gray-100 p-4">
|
||||||
Progress{" "}
|
<span>
|
||||||
<div className="bar relative h-1 w-full rounded bg-gray-300">
|
Progress
|
||||||
|
<br />
|
||||||
|
{isNaN(completionPercentage) ? 0 : completionPercentage.toFixed(2)}%
|
||||||
|
</span>
|
||||||
|
<div className="bar relative mt-1 h-1 w-full rounded bg-gray-300">
|
||||||
<div
|
<div
|
||||||
className="absolute top-0 left-0 h-1 rounded bg-green-500 duration-300"
|
className="absolute top-0 left-0 h-1 rounded bg-green-500 duration-300"
|
||||||
style={{ width: `${(completedIssues / (moduleIssues ?? []).length) * 100}%` }}
|
style={{ width: `${(completedIssues / (moduleIssues ?? []).length) * 100}%` }}
|
||||||
|
@ -209,7 +209,7 @@ export const WorkspaceSidebarDropdown = () => {
|
|||||||
className="flex w-full items-center justify-start rounded px-2 py-1 text-sm text-gray-600 hover:bg-gray-100"
|
className="flex w-full items-center justify-start rounded px-2 py-1 text-sm text-gray-600 hover:bg-gray-100"
|
||||||
>
|
>
|
||||||
<Link href={link.href}>
|
<Link href={link.href}>
|
||||||
<a>{link.name}</a>
|
<a className="w-full">{link.name}</a>
|
||||||
</Link>
|
</Link>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
))}
|
))}
|
||||||
|
Loading…
Reference in New Issue
Block a user