diff --git a/web/core/components/cycles/active-cycle/progress.tsx b/web/core/components/cycles/active-cycle/progress.tsx index 4f876b106e6..815aeedfbb7 100644 --- a/web/core/components/cycles/active-cycle/progress.tsx +++ b/web/core/components/cycles/active-cycle/progress.tsx @@ -9,7 +9,7 @@ import { LinearProgressIndicator, Loader } from "@plane/ui"; // components import { EmptyState } from "@/components/empty-state"; // constants -import { CYCLE_STATE_GROUPS_DETAILS } from "@/constants/cycle"; +import { PROGRESS_STATE_GROUPS_DETAILS } from "@/constants/common"; import { EmptyStateType } from "@/constants/empty-state"; export type ActiveCycleProgressProps = { @@ -21,7 +21,7 @@ export type ActiveCycleProgressProps = { export const ActiveCycleProgress: FC = (props) => { const { workspaceSlug, projectId, cycle } = props; - const progressIndicatorData = CYCLE_STATE_GROUPS_DETAILS.map((group, index) => ({ + const progressIndicatorData = PROGRESS_STATE_GROUPS_DETAILS.map((group, index) => ({ id: index, name: group.title, value: cycle && cycle.total_issues > 0 ? (cycle[group.key as keyof ICycle] as number) : 0, @@ -67,7 +67,7 @@ export const ActiveCycleProgress: FC = (props) => { {group} diff --git a/web/core/components/modules/module-card-item.tsx b/web/core/components/modules/module-card-item.tsx index d8518f21a68..5bae53d76a0 100644 --- a/web/core/components/modules/module-card-item.tsx +++ b/web/core/components/modules/module-card-item.tsx @@ -6,11 +6,13 @@ import Link from "next/link"; import { useParams, usePathname, useSearchParams } from "next/navigation"; import { CalendarCheck2, CalendarClock, Info, MoveRight, SquareUser } from "lucide-react"; // ui -import { FavoriteStar, LayersIcon, Tooltip, setPromiseToast } from "@plane/ui"; +import { IModule } from "@plane/types"; +import { FavoriteStar, LayersIcon, LinearProgressIndicator, Tooltip, setPromiseToast } from "@plane/ui"; // components import { ButtonAvatars } from "@/components/dropdowns/member/avatar"; import { ModuleQuickActions } from "@/components/modules"; // constants +import { PROGRESS_STATE_GROUPS_DETAILS } from "@/constants/common"; import { MODULE_FAVORITED, MODULE_UNFAVORITED } from "@/constants/event-tracker"; import { MODULE_STATUS } from "@/constants/module"; import { EUserProjectRoles } from "@/constants/project"; @@ -145,8 +147,6 @@ export const ModuleCardItem: React.FC = observer((props) => { ? moduleDetails?.completed_estimate_points || 0 : moduleDetails.completed_issues; - const completionPercentage = (moduleCompletedIssues / moduleTotalIssues) * 100; - const endDate = getDate(moduleDetails.target_date); const startDate = getDate(moduleDetails.start_date); @@ -166,6 +166,13 @@ export const ModuleCardItem: React.FC = observer((props) => { const moduleLeadDetails = moduleDetails.lead_id ? getUserDetails(moduleDetails.lead_id) : undefined; + const progressIndicatorData = PROGRESS_STATE_GROUPS_DETAILS.map((group, index) => ({ + id: index, + name: group.title, + value: moduleTotalIssues > 0 ? (moduleDetails[group.key as keyof IModule] as number) : 0, + color: group.color, + })); + return (
@@ -210,29 +217,7 @@ export const ModuleCardItem: React.FC = observer((props) => { )}
- - -
-
-
-
-
- - +
{isDateValid ? (
diff --git a/web/core/constants/common.ts b/web/core/constants/common.ts index 0c1431740d4..dccb5166da7 100644 --- a/web/core/constants/common.ts +++ b/web/core/constants/common.ts @@ -5,3 +5,26 @@ export const MARKETING_PRICING_PAGE_LINK = "https://plane.so/pricing"; export const MARKETING_CONTACT_US_PAGE_LINK = "https://plane.so/contact"; export const MARKETING_PLANE_ONE_PAGE_LINK = "https://plane.so/one"; + +export const PROGRESS_STATE_GROUPS_DETAILS = [ + { + key: "completed_issues", + title: "Completed", + color: "#16A34A", + }, + { + key: "started_issues", + title: "Started", + color: "#F59E0B", + }, + { + key: "unstarted_issues", + title: "Unstarted", + color: "#3A3A3A", + }, + { + key: "backlog_issues", + title: "Backlog", + color: "#A3A3A3", + }, +]; diff --git a/web/core/constants/cycle.ts b/web/core/constants/cycle.ts index 5c6b48327c6..8ea15c5bc17 100644 --- a/web/core/constants/cycle.ts +++ b/web/core/constants/cycle.ts @@ -91,29 +91,6 @@ export const CYCLE_STATUS: { }, ]; -export const CYCLE_STATE_GROUPS_DETAILS = [ - { - key: "completed_issues", - title: "Completed", - color: "#16A34A", - }, - { - key: "started_issues", - title: "Started", - color: "#F59E0B", - }, - { - key: "unstarted_issues", - title: "Unstarted", - color: "#3A3A3A", - }, - { - key: "backlog_issues", - title: "Backlog", - color: "#A3A3A3", - }, -]; - export const WORKSPACE_ACTIVE_CYCLES_DETAILS = [ { title: "10,000-feet view of all active cycles.",