From bb76f7b7485d49a568aa3ed62839d28f13f6d29b Mon Sep 17 00:00:00 2001 From: Vamsi krishna Date: Fri, 10 Jan 2025 20:19:37 +0530 Subject: [PATCH] chore: added current cycle to cycle dropdown --- web/core/components/dropdowns/cycle/cycle-options.tsx | 4 +++- web/core/components/dropdowns/cycle/index.tsx | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/web/core/components/dropdowns/cycle/cycle-options.tsx b/web/core/components/dropdowns/cycle/cycle-options.tsx index cd4f4d997da..e720fb78c9f 100644 --- a/web/core/components/dropdowns/cycle/cycle-options.tsx +++ b/web/core/components/dropdowns/cycle/cycle-options.tsx @@ -31,10 +31,11 @@ type CycleOptionsProps = { placement: Placement | undefined; isOpen: boolean; canRemoveCycle: boolean; + currentCycleId?: string; }; export const CycleOptions: FC = observer((props) => { - const { projectId, isOpen, referenceElement, placement, canRemoveCycle } = props; + const { projectId, isOpen, referenceElement, placement, canRemoveCycle, currentCycleId } = props; //state hooks const [query, setQuery] = useState(""); const [popperElement, setPopperElement] = useState(null); @@ -68,6 +69,7 @@ export const CycleOptions: FC = observer((props) => { const cycleIds = (getProjectCycleIds(projectId) ?? [])?.filter((cycleId) => { const cycleDetails = getCycleById(cycleId); + if (currentCycleId && currentCycleId === cycleId) return false; return cycleDetails?.status ? (cycleDetails?.status.toLowerCase() != "completed" ? true : false) : true; }); diff --git a/web/core/components/dropdowns/cycle/index.tsx b/web/core/components/dropdowns/cycle/index.tsx index 9eb20ba2d94..98124a0a19d 100644 --- a/web/core/components/dropdowns/cycle/index.tsx +++ b/web/core/components/dropdowns/cycle/index.tsx @@ -26,6 +26,7 @@ type Props = TDropdownProps & { value: string | null; canRemoveCycle?: boolean; renderByDefault?: boolean; + currentCycleId?: string; }; export const CycleDropdown: React.FC = observer((props) => { @@ -49,6 +50,7 @@ export const CycleDropdown: React.FC = observer((props) => { value, canRemoveCycle = true, renderByDefault = true, + currentCycleId, } = props; // states @@ -145,6 +147,7 @@ export const CycleDropdown: React.FC = observer((props) => { placement={placement} referenceElement={referenceElement} canRemoveCycle={canRemoveCycle} + currentCycleId={currentCycleId} /> )}