feat: extend task management with new statuses and centralized configuration
- Added `cancelled` and `freeze` statuses to `TasksResponse`, `HomePageClientProps`, and `useTasks` for comprehensive task tracking. - Updated task forms to dynamically load statuses using `getAllStatuses`, enhancing maintainability and reducing hardcoded values. - Refactored Kanban components to utilize centralized status configuration, improving consistency across the application. - Adjusted visibility toggle and swimlanes to reflect new status options, ensuring a seamless user experience.
This commit is contained in:
@@ -11,6 +11,8 @@ interface UseTasksState {
|
||||
completed: number;
|
||||
inProgress: number;
|
||||
todo: number;
|
||||
cancelled: number;
|
||||
freeze: number;
|
||||
completionRate: number;
|
||||
};
|
||||
loading: boolean;
|
||||
@@ -41,6 +43,8 @@ export function useTasks(
|
||||
completed: 0,
|
||||
inProgress: 0,
|
||||
todo: 0,
|
||||
cancelled: 0,
|
||||
freeze: 0,
|
||||
completionRate: 0
|
||||
},
|
||||
loading: false,
|
||||
@@ -147,6 +151,8 @@ export function useTasks(
|
||||
completed: updatedTasks.filter(t => t.status === 'done').length,
|
||||
inProgress: updatedTasks.filter(t => t.status === 'in_progress').length,
|
||||
todo: updatedTasks.filter(t => t.status === 'todo').length,
|
||||
cancelled: updatedTasks.filter(t => t.status === 'cancelled').length,
|
||||
freeze: updatedTasks.filter(t => t.status === 'freeze').length,
|
||||
completionRate: updatedTasks.length > 0
|
||||
? Math.round((updatedTasks.filter(t => t.status === 'done').length / updatedTasks.length) * 100)
|
||||
: 0
|
||||
@@ -188,6 +194,8 @@ export function useTasks(
|
||||
completed: currentTasks.filter(t => t.status === 'done').length,
|
||||
inProgress: currentTasks.filter(t => t.status === 'in_progress').length,
|
||||
todo: currentTasks.filter(t => t.status === 'todo').length,
|
||||
cancelled: currentTasks.filter(t => t.status === 'cancelled').length,
|
||||
freeze: currentTasks.filter(t => t.status === 'freeze').length,
|
||||
completionRate: currentTasks.length > 0
|
||||
? Math.round((currentTasks.filter(t => t.status === 'done').length / currentTasks.length) * 100)
|
||||
: 0
|
||||
|
||||
Reference in New Issue
Block a user