feat(custom-columns): enhance task management with custom column support

- Added custom column values to task responses in the API for better task management flexibility.
- Implemented custom column components in the frontend, including dropdowns and date pickers, to improve user interaction.
- Updated TaskListV2 and TaskRow components to handle custom columns, ensuring proper rendering and functionality.
- Introduced a new PeopleDropdown component for selecting team members in custom columns, enhancing usability.
- Enhanced styling for custom column components to support both light and dark modes, improving visual consistency.
This commit is contained in:
chamiakJ
2025-07-07 02:04:05 +05:30
parent c70f8e7b6d
commit 174c6bcedf
11 changed files with 1072 additions and 215 deletions

View File

@@ -737,6 +737,30 @@ export const useTaskSocketHandlers = () => {
[dispatch, taskGroups]
);
const handleCustomColumnUpdate = useCallback(
(data: { task_id: string; column_key: string; value: string }) => {
if (!data || !data.task_id || !data.column_key) return;
// Update the task-management slice for task-list-v2 components
const currentTask = store.getState().taskManagement.entities[data.task_id];
if (currentTask) {
const updatedCustomColumnValues = {
...currentTask.custom_column_values,
[data.column_key]: data.value,
};
const updatedTask: Task = {
...currentTask,
custom_column_values: updatedCustomColumnValues,
updated_at: new Date().toISOString(),
};
dispatch(updateTask(updatedTask));
}
},
[dispatch]
);
// Handler for TASK_ASSIGNEES_CHANGE (fallback event with limited data)
const handleTaskAssigneesChange = useCallback((data: { assigneeIds: string[] }) => {
if (!data || !data.assigneeIds) return;
@@ -776,6 +800,7 @@ export const useTaskSocketHandlers = () => {
},
{ event: SocketEvents.QUICK_TASK.toString(), handler: handleNewTaskReceived },
{ event: SocketEvents.TASK_PROGRESS_UPDATED.toString(), handler: handleTaskProgressUpdated },
{ event: SocketEvents.TASK_CUSTOM_COLUMN_UPDATE.toString(), handler: handleCustomColumnUpdate },
];
// Register all event listeners
@@ -806,5 +831,6 @@ export const useTaskSocketHandlers = () => {
handleTaskDescriptionChange,
handleNewTaskReceived,
handleTaskProgressUpdated,
handleCustomColumnUpdate,
]);
};