From dcc28a180c79749c7420cb699c33c9cd240bda32 Mon Sep 17 00:00:00 2001 From: gurusainath Date: Tue, 20 Feb 2024 16:48:45 +0530 Subject: [PATCH] fix: updated the tooltip and ui for cycle select --- web/components/dropdowns/cycle.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/web/components/dropdowns/cycle.tsx b/web/components/dropdowns/cycle.tsx index 5086d2d26..ddcabb3c9 100644 --- a/web/components/dropdowns/cycle.tsx +++ b/web/components/dropdowns/cycle.tsx @@ -10,11 +10,12 @@ import useOutsideClickDetector from "hooks/use-outside-click-detector"; // components import { DropdownButton } from "./buttons"; // icons -import { ContrastIcon } from "@plane/ui"; +import { ContrastIcon, CycleGroupIcon } from "@plane/ui"; // helpers import { cn } from "helpers/common.helper"; // types import { TDropdownProps } from "./types"; +import { TCycleGroups } from "@plane/types"; // constants import { BUTTON_VARIANTS_WITH_TEXT } from "./constants"; @@ -82,17 +83,22 @@ export const CycleDropdown: React.FC = observer((props) => { router: { workspaceSlug }, } = useApplication(); const { getProjectCycleIds, fetchAllCycles, getCycleById } = useCycle(); - const cycleIds = getProjectCycleIds(projectId); + + const cycleIds = (getProjectCycleIds(projectId) ?? [])?.filter((cycleId) => { + const cycleDetails = getCycleById(cycleId); + return cycleDetails?.status.toLowerCase() != "completed" ? true : false; + }); const options: DropdownOptions = cycleIds?.map((cycleId) => { const cycleDetails = getCycleById(cycleId); + const cycleStatus = cycleDetails?.status ? (cycleDetails.status.toLocaleLowerCase() as TCycleGroups) : "draft"; return { value: cycleId, query: `${cycleDetails?.name}`, content: (
- + {cycleDetails?.name}
),