refactor(task-list): enhance styling and structure in TaskListV2 and TaskRow components

- Consolidated import statements for better readability.
- Improved layout and styling consistency by adding border styles to various elements in TaskRow and AddTaskRow components.
- Updated TaskListV2Table to enhance the rendering logic and maintainability.
- Adjusted custom column handling and task estimation display for improved user experience.
This commit is contained in:
chamikaJ
2025-07-09 14:58:54 +05:30
parent 9cc19460bd
commit 399a01904a
5 changed files with 396 additions and 300 deletions

View File

@@ -670,15 +670,32 @@ export const useTaskSocketHandlers = () => {
const handleEstimationChange = useCallback(
(task: { id: string; parent_task: string | null; estimation: number }) => {
if (!task) return;
(data: { id: string; parent_task: string | null; total_hours: number; total_minutes: number }) => {
if (!data) return;
// Update the old task slice (for backward compatibility)
const taskWithProgress = {
...task,
...data,
manual_progress: false,
} as IProjectTask;
dispatch(updateTaskEstimation({ task: taskWithProgress }));
// Update task-management slice for task-list-v2 components
const currentTask = store.getState().taskManagement.entities[data.id];
if (currentTask) {
const estimatedHours = (data.total_hours || 0) + (data.total_minutes || 0) / 60;
const updatedTask: Task = {
...currentTask,
timeTracking: {
...currentTask.timeTracking,
estimated: estimatedHours,
},
updatedAt: new Date().toISOString(),
updated_at: new Date().toISOString(),
};
dispatch(updateTask(updatedTask));
}
},
[dispatch]
);