Fixed bug for refectch activities and create activity on the currently filtered user. (#1493)
* Fixed bug for refectch activities and create activity on the currently filtered user. * Refactor optimistif effect --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -83,7 +83,10 @@ export function TaskGroups({ entity, showAddButton }: OwnProps) {
|
||||
title="New task"
|
||||
variant={'secondary'}
|
||||
onClick={() =>
|
||||
openCreateActivity(ActivityType.Task, entity ? [entity] : undefined)
|
||||
openCreateActivity({
|
||||
type: ActivityType.Task,
|
||||
targetableEntities: entity ? [entity] : undefined,
|
||||
})
|
||||
}
|
||||
/>
|
||||
</StyledTaskGroupEmptyContainer>
|
||||
@ -95,21 +98,27 @@ export function TaskGroups({ entity, showAddButton }: OwnProps) {
|
||||
{activeTabId === 'done' ? (
|
||||
<TaskList
|
||||
tasks={completedTasks ?? []}
|
||||
button={showAddButton && <AddTaskButton entity={entity} />}
|
||||
button={
|
||||
showAddButton && <AddTaskButton activityTargetEntity={entity} />
|
||||
}
|
||||
/>
|
||||
) : (
|
||||
<>
|
||||
<TaskList
|
||||
title="Today"
|
||||
tasks={todayOrPreviousTasks ?? []}
|
||||
button={showAddButton && <AddTaskButton entity={entity} />}
|
||||
button={
|
||||
showAddButton && <AddTaskButton activityTargetEntity={entity} />
|
||||
}
|
||||
/>
|
||||
<TaskList
|
||||
title="Upcoming"
|
||||
tasks={upcomingTasks ?? []}
|
||||
button={
|
||||
showAddButton &&
|
||||
!todayOrPreviousTasks?.length && <AddTaskButton entity={entity} />
|
||||
!todayOrPreviousTasks?.length && (
|
||||
<AddTaskButton activityTargetEntity={entity} />
|
||||
)
|
||||
}
|
||||
/>
|
||||
<TaskList
|
||||
@ -118,7 +127,9 @@ export function TaskGroups({ entity, showAddButton }: OwnProps) {
|
||||
button={
|
||||
showAddButton &&
|
||||
!todayOrPreviousTasks?.length &&
|
||||
!upcomingTasks?.length && <AddTaskButton entity={entity} />
|
||||
!upcomingTasks?.length && (
|
||||
<AddTaskButton activityTargetEntity={entity} />
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user