diff --git a/apps/web/lib/components/Kanban.tsx b/apps/web/lib/components/Kanban.tsx index cd36fea9c..14255bc60 100644 --- a/apps/web/lib/components/Kanban.tsx +++ b/apps/web/lib/components/Kanban.tsx @@ -67,6 +67,8 @@ function InnerItemList({ items, title }: { title: string; items: ITeamTask[]; dr {(dragProvided: DraggableProvided, dragSnapshot: DraggableStateSnapshot) => ( ); } - +type ItemProps = { + item: ITeamTask; + isDragging: boolean; + isGroupedOver: boolean; + provided: DraggableProvided; + style: any; + isClone: boolean; + index: number; +}; /** * card that represent each task * @param props * @returns */ -export default function Item(props: any) { - const { item, isDragging, isGroupedOver, provided, style, isClone, index } = props; +export default function Item(props: ItemProps) { + const { item, isDragging, provided, style, index } = props; const { hours, minutes, seconds } = useTimerView(); + const { activeTeam } = useOrganizationTeams(); + const { user } = useAuthenticateUser(); - const taskAssignee: ImageOverlapperProps[] = []; + const members = activeTeam?.members || []; + const currentUser = members.find((m) => m.employee.userId === user?.id); - item.members.map((member: any) => { - taskAssignee.push({ + const memberInfo = useTeamMemberCard(currentUser); + const taskEdition = useTMCardTaskEdit(memberInfo.memberTask); + const taskAssignee: ImageOverlapperProps[] = item.members.map((member: any) => { + return { id: member.user.id, url: member.user.imageUrl, alt: member.user.firstName - }); + }; }); + const { collaborativeSelect } = useCollaborative(memberInfo.memberUser); - // const handleTime = () => { - // if (item.status === TaskStatus.INPROGRESS) { - // startTimer(); - // } else { - // stopTimer(); - // } - // }; - - // useEffect(() => { - // handleTime(); - // }, [timerStatus?.running]); + const menu = <>{!collaborativeSelect && }; return ( -
-
-
- {item.tags && } - -
- - - #{item.number} - - {item.title} - - -
+
+
+ {} + {menu}
-
- - +
+
+ {!taskEdition.editMode ? ( + <> + + #{item.number} + + {item.title} + + + + ) : ( +
+ { + console.log(e); + }} + onEnterKey={() => { + taskEdition.setEditMode(false); + }} + /> +
+ )} +
-
-
- {item.status === TaskStatus.INPROGRESS ? ( -
- Live: -

- {pad(hours)}:{pad(minutes)}:{pad(seconds)}{' '} -

-
- ) : ( -
- Worked: -

- {pad(hours)}:{pad(minutes)}:{pad(seconds)}{' '} -

+
+ +
+
+
+ {item.status === TaskStatus.INPROGRESS ? ( +
+ Live: +

+ {pad(hours)}:{pad(minutes)}:{pad(seconds)}{' '} +

+
+ ) : ( +
+ Worked: +

+ {pad(hours)}:{pad(minutes)}:{pad(seconds)}{' '} +

+
+ )}
- )} - -
- {item.hasComment && ( -
-
+ + {item.issueType && ( +
+
+
+ )}
- )} -
+ + ); }