From 9ae1ce0a9a9ae7c0099f4d18fa39e984b8e7d89a Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Fri, 17 Jan 2025 15:41:34 +0530 Subject: [PATCH] chore: helper function added and code refactor (#6419) --- .../components/issues/issue-layouts/issue-stats.tsx | 12 ++++++++++++ .../components/issues/issue-layouts/list/block.tsx | 2 ++ web/helpers/common.helper.ts | 3 +++ 3 files changed, 17 insertions(+) create mode 100644 web/ce/components/issues/issue-layouts/issue-stats.tsx diff --git a/web/ce/components/issues/issue-layouts/issue-stats.tsx b/web/ce/components/issues/issue-layouts/issue-stats.tsx new file mode 100644 index 00000000000..3e842c92d56 --- /dev/null +++ b/web/ce/components/issues/issue-layouts/issue-stats.tsx @@ -0,0 +1,12 @@ +"use client"; + +import React, { FC } from "react"; + +type Props = { + issueId: string; +}; + +export const IssueStats: FC = (props) => { + const { issueId } = props; + return <>; +}; diff --git a/web/core/components/issues/issue-layouts/list/block.tsx b/web/core/components/issues/issue-layouts/list/block.tsx index 6b938bc160b..b8cb421fd8b 100644 --- a/web/core/components/issues/issue-layouts/list/block.tsx +++ b/web/core/components/issues/issue-layouts/list/block.tsx @@ -22,6 +22,7 @@ import { TSelectionHelper } from "@/hooks/use-multiple-select"; import { usePlatformOS } from "@/hooks/use-platform-os"; // plane web components import { IssueIdentifier } from "@/plane-web/components/issues"; +import { IssueStats } from "@/plane-web/components/issues/issue-layouts/issue-stats"; // types import { TRenderQuickActions } from "./list-view-types"; @@ -276,6 +277,7 @@ export const IssueBlock = observer((props: IssueBlockProps) => {
{!issue?.tempId ? ( <> + {isEpic && } export const cn = (...inputs: ClassValue[]) => twMerge(clsx(inputs)); export const convertRemToPixel = (rem: number): number => rem * 0.9 * 16; + +export const getProgress = (completed: number | undefined, total: number | undefined) => + total && total > 0 ? Math.round(((completed ?? 0) / total) * 100) : 0;