Skip to content

Commit 9ae1ce0

Browse files
chore: helper function added and code refactor (#6419)
1 parent 00cc338 commit 9ae1ce0

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
"use client";
2+
3+
import React, { FC } from "react";
4+
5+
type Props = {
6+
issueId: string;
7+
};
8+
9+
export const IssueStats: FC<Props> = (props) => {
10+
const { issueId } = props;
11+
return <></>;
12+
};

web/core/components/issues/issue-layouts/list/block.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { TSelectionHelper } from "@/hooks/use-multiple-select";
2222
import { usePlatformOS } from "@/hooks/use-platform-os";
2323
// plane web components
2424
import { IssueIdentifier } from "@/plane-web/components/issues";
25+
import { IssueStats } from "@/plane-web/components/issues/issue-layouts/issue-stats";
2526
// types
2627
import { TRenderQuickActions } from "./list-view-types";
2728

@@ -276,6 +277,7 @@ export const IssueBlock = observer((props: IssueBlockProps) => {
276277
<div className="flex flex-shrink-0 items-center gap-2">
277278
{!issue?.tempId ? (
278279
<>
280+
{isEpic && <IssueStats issueId={issue.id} />}
279281
<IssueProperties
280282
className={`relative flex flex-wrap ${isSidebarCollapsed ? "md:flex-grow md:flex-shrink-0" : "lg:flex-grow lg:flex-shrink-0"} items-center gap-2 whitespace-nowrap`}
281283
issue={issue}

web/helpers/common.helper.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ export const debounce = (func: any, wait: number, immediate: boolean = false) =>
3939
export const cn = (...inputs: ClassValue[]) => twMerge(clsx(inputs));
4040

4141
export const convertRemToPixel = (rem: number): number => rem * 0.9 * 16;
42+
43+
export const getProgress = (completed: number | undefined, total: number | undefined) =>
44+
total && total > 0 ? Math.round(((completed ?? 0) / total) * 100) : 0;

0 commit comments

Comments
 (0)