diff --git a/packages/twenty-front/src/modules/activities/tasks/components/ObjectTasks.tsx b/packages/twenty-front/src/modules/activities/tasks/components/ObjectTasks.tsx index a798a818d865..9e2dd7a4bc54 100644 --- a/packages/twenty-front/src/modules/activities/tasks/components/ObjectTasks.tsx +++ b/packages/twenty-front/src/modules/activities/tasks/components/ObjectTasks.tsx @@ -20,7 +20,7 @@ export const ObjectTasks = ({ return ( - + ); diff --git a/packages/twenty-front/src/modules/activities/tasks/components/TaskGroups.tsx b/packages/twenty-front/src/modules/activities/tasks/components/TaskGroups.tsx index a6e4999773bc..ae484382ffcc 100644 --- a/packages/twenty-front/src/modules/activities/tasks/components/TaskGroups.tsx +++ b/packages/twenty-front/src/modules/activities/tasks/components/TaskGroups.tsx @@ -32,13 +32,9 @@ const StyledContainer = styled.div` type TaskGroupsProps = { filterDropdownId?: string; targetableObjects?: ActivityTargetableObject[]; - showAddButton?: boolean; }; -export const TaskGroups = ({ - targetableObjects, - showAddButton, -}: TaskGroupsProps) => { +export const TaskGroups = ({ targetableObjects }: TaskGroupsProps) => { const { tasks, tasksLoading } = useTasks({ targetableObjects: targetableObjects ?? [], }); @@ -93,7 +89,11 @@ export const TaskGroups = ({ const sortedTasksByStatus = Object.entries( groupBy(tasks, ({ status }) => status), - ).toSorted(([statusA], [statusB]) => statusB.localeCompare(statusA)); + ).sort(([statusA], [statusB]) => statusB.localeCompare(statusA)); + + const hasTodoStatus = sortedTasksByStatus.some( + ([status]) => status === 'TODO', + ); return ( @@ -103,7 +103,7 @@ export const TaskGroups = ({ title={status} tasks={tasksByStatus} button={ - showAddButton && ( + (status === 'TODO' || !hasTodoStatus) && ( ) }