Enhance task status handling and progress visualization in Kanban board

- Introduced a mechanism to emit a socket event when a task's status changes during drag-and-drop operations.
- Updated TaskCard to consistently display the progress circle regardless of task completion state.
- Improved TaskProgressCircle to handle complete_ratio and progress more robustly, ensuring accurate visual representation.
This commit is contained in:
shancds
2025-07-15 14:13:37 +05:30
parent a1c0cef149
commit 83044077d3
3 changed files with 22 additions and 10 deletions

View File

@@ -70,7 +70,6 @@ const TaskCard: React.FC<TaskCardProps> = memo(({
const d = selectedDate || new Date();
return new Date(d.getFullYear(), d.getMonth(), 1);
});
const [showSubtasks, setShowSubtasks] = useState(false);
useEffect(() => {
setSelectedDate(task.end_date ? new Date(task.end_date) : null);
@@ -205,11 +204,9 @@ const TaskCard: React.FC<TaskCardProps> = memo(({
<>
<div className="enhanced-kanban-task-card" style={{ background, color, display: 'block', position: 'relative' }} >
{/* Progress circle at top right */}
{task.progress > 0 && (
<div style={{ position: 'absolute', top: 6, right: 6, zIndex: 2 }}>
<TaskProgressCircle task={task} size={20} />
</div>
)}
<div style={{ position: 'absolute', top: 6, right: 6, zIndex: 2 }}>
<TaskProgressCircle task={task} size={20} />
</div>
<div
draggable
onDragStart={e => onTaskDragStart(e, task.id!, groupId)}