From b4099d507e9eff6071f1f200ddca00ddb53dd021 Mon Sep 17 00:00:00 2001 From: alma Date: Thu, 15 Jan 2026 23:09:53 +0100 Subject: [PATCH] widget leantime refactor --- app/api/twenty-crm/tasks/route.ts | 2 +- components/flow.tsx | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/api/twenty-crm/tasks/route.ts b/app/api/twenty-crm/tasks/route.ts index 796306b..f4ff3ec 100644 --- a/app/api/twenty-crm/tasks/route.ts +++ b/app/api/twenty-crm/tasks/route.ts @@ -319,7 +319,7 @@ export async function GET(request: NextRequest) { headline: task.title, description: (task as any)._bodyText || null, // Use extracted body text dateToFinish: task.dueAt || null, - projectName: 'Twenty CRM', + projectName: 'Médiation', projectId: 0, status: task.status === 'Done' ? 5 : 1, // 5 = Done, 1 = New (or other status) editorId: task.assigneeId || null, diff --git a/components/flow.tsx b/components/flow.tsx index 605927e..9e58b1b 100644 --- a/components/flow.tsx +++ b/components/flow.tsx @@ -154,6 +154,11 @@ export function Duties() { const todayDay = now.getDate(); const filteredTasks = allTasks.filter((task: Task) => { + // Exclude tasks with status Done (5) + if (task.status === 5) { + return false; + } + const dueDate = getValidDate(task); if (!dueDate) { return false; // Exclude tasks without a due date @@ -165,7 +170,7 @@ export function Duties() { const taskMonth = taskDueDate.getMonth(); const taskDay = taskDueDate.getDate(); - // Keep tasks with due date <= today (overdue or due today) + // Keep tasks with due date <= today (overdue or due today, not future) const isOverdueOrDueToday = taskYear < todayYear || (taskYear === todayYear && taskMonth < todayMonth) || (taskYear === todayYear && taskMonth === todayMonth && taskDay <= todayDay); @@ -339,7 +344,7 @@ export function Duties() { {task.projectName} {(task as any).source === 'twenty-crm' && ( - (Twenty CRM) + (Médiation) )}