From 80198f5fdabb40511459371c16f4bb67f1573d39 Mon Sep 17 00:00:00 2001 From: Akshita Goyal <36129505+gakshita@users.noreply.github.com> Date: Tue, 4 Mar 2025 18:32:02 +0530 Subject: [PATCH] [WEB-3477] fix: mutation issue on moving work items for a manually ended cycle (#6696) --- web/core/store/cycle.store.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/core/store/cycle.store.ts b/web/core/store/cycle.store.ts index 4e56e56c11..89221ee7cc 100644 --- a/web/core/store/cycle.store.ts +++ b/web/core/store/cycle.store.ts @@ -179,7 +179,9 @@ export class CycleStore implements ICycleStore { const endDate = getDate(c.end_date); const hasEndDatePassed = endDate && isPast(endDate); const isEndDateToday = endDate && isToday(endDate); - return c.project_id === projectId && hasEndDatePassed && !isEndDateToday && !c?.archived_at; + return ( + c.project_id === projectId && ((hasEndDatePassed && !isEndDateToday) || c.status?.toLowerCase() === "completed") + ); }); completedCycles = sortBy(completedCycles, [(c) => c.sort_order]); const completedCycleIds = completedCycles.map((c) => c.id); @@ -195,7 +197,9 @@ export class CycleStore implements ICycleStore { let incompleteCycles = Object.values(this.cycleMap ?? {}).filter((c) => { const endDate = getDate(c.end_date); const hasEndDatePassed = endDate && isPast(endDate); - return c.project_id === projectId && !hasEndDatePassed && !c?.archived_at; + return ( + c.project_id === projectId && !hasEndDatePassed && !c?.archived_at && c.status?.toLowerCase() !== "completed" + ); }); incompleteCycles = sortBy(incompleteCycles, [(c) => c.sort_order]); const incompleteCycleIds = incompleteCycles.map((c) => c.id);