From 98974fdc50ecc28b1c2ce32533d43e3a6f804a17 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Tue, 7 Nov 2023 15:14:47 +0530 Subject: [PATCH] fix: cycle and module bug fixes and improvement (#2691) * fix: cycle and module card issue count fix * fix: cycle and module list progress icon fix * fix: module card progress fix * style: cycle & module empty date label updated * fix: build error --- space/constants/data.ts | 22 ++++++++-------- web/components/cycles/cycles-board-card.tsx | 17 +++++++------ web/components/cycles/cycles-list-item.tsx | 8 +++--- web/components/modules/module-card-item.tsx | 28 +++++++++++++-------- web/components/modules/module-list-item.tsx | 10 +++++--- 5 files changed, 50 insertions(+), 35 deletions(-) diff --git a/space/constants/data.ts b/space/constants/data.ts index 29d411342..909b74c12 100644 --- a/space/constants/data.ts +++ b/space/constants/data.ts @@ -10,12 +10,12 @@ import { } from "types/issue"; // icons import { - BacklogStateIcon, - UnstartedStateIcon, - StartedStateIcon, - CompletedStateIcon, - CancelledStateIcon, -} from "components/icons"; + BacklogGroupIcon, + CancelledGroupIcon, + CompletedGroupIcon, + StartedGroupIcon, + UnstartedGroupIcon, +} from "@plane/ui"; // all issue views export const issueViews: any = { @@ -92,35 +92,35 @@ export const issueGroups: IIssueGroup[] = [ title: "Backlog", color: "#d9d9d9", className: `text-[#d9d9d9] bg-[#d9d9d9]/10`, - icon: BacklogStateIcon, + icon: BacklogGroupIcon, }, { key: "unstarted", title: "Unstarted", color: "#3f76ff", className: `text-[#3f76ff] bg-[#3f76ff]/10`, - icon: UnstartedStateIcon, + icon: UnstartedGroupIcon, }, { key: "started", title: "Started", color: "#f59e0b", className: `text-[#f59e0b] bg-[#f59e0b]/10`, - icon: StartedStateIcon, + icon: StartedGroupIcon, }, { key: "completed", title: "Completed", color: "#16a34a", className: `text-[#16a34a] bg-[#16a34a]/10`, - icon: CompletedStateIcon, + icon: CompletedGroupIcon, }, { key: "cancelled", title: "Cancelled", color: "#dc2626", className: `text-[#dc2626] bg-[#dc2626]/10`, - icon: CancelledStateIcon, + icon: CancelledGroupIcon, }, ]; diff --git a/web/components/cycles/cycles-board-card.tsx b/web/components/cycles/cycles-board-card.tsx index b480680a6..89e1bef89 100644 --- a/web/components/cycles/cycles-board-card.tsx +++ b/web/components/cycles/cycles-board-card.tsx @@ -44,6 +44,7 @@ export const CyclesBoardCard: FC = (props) => { const isCompleted = cycleStatus === "completed"; const endDate = new Date(cycle.end_date ?? ""); const startDate = new Date(cycle.start_date ?? ""); + const isDateValid = cycle.start_date || cycle.end_date; const router = useRouter(); @@ -64,9 +65,7 @@ export const CyclesBoardCard: FC = (props) => { ? cycleTotalIssues === 0 ? "0 Issue" : cycleTotalIssues === cycle.completed_issues - ? cycleTotalIssues > 1 - ? `${cycleTotalIssues} Issues` - : `${cycleTotalIssues} Issue` + ? `${cycleTotalIssues} Issue${cycleTotalIssues > 1 ? "s" : ""}` : `${cycle.completed_issues}/${cycleTotalIssues} Issues` : "0 Issue"; @@ -225,10 +224,14 @@ export const CyclesBoardCard: FC = (props) => {
- - {areYearsEqual ? renderShortDate(startDate, "_ _") : renderShortMonthDate(startDate, "_ _")} -{" "} - {areYearsEqual ? renderShortDate(endDate, "_ _") : renderShortMonthDate(endDate, "_ _")} - + {isDateValid ? ( + + {areYearsEqual ? renderShortDate(startDate, "_ _") : renderShortMonthDate(startDate, "_ _")} -{" "} + {areYearsEqual ? renderShortDate(endDate, "_ _") : renderShortMonthDate(endDate, "_ _")} + + ) : ( + No due date + )}
{cycle.is_favorite ? (