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:
Julien Froidefond
2025-09-14 23:06:50 +02:00
parent 2df64262ab
commit e6d24f2693
14 changed files with 189 additions and 105 deletions

View File

@@ -189,12 +189,13 @@ export class TasksService {
* Récupère les statistiques des tâches
*/
async getTaskStats() {
const [total, completed, inProgress, todo, cancelled] = await Promise.all([
const [total, completed, inProgress, todo, cancelled, freeze] = await Promise.all([
prisma.task.count(),
prisma.task.count({ where: { status: 'done' } }),
prisma.task.count({ where: { status: 'in_progress' } }),
prisma.task.count({ where: { status: 'todo' } }),
prisma.task.count({ where: { status: 'cancelled' } })
prisma.task.count({ where: { status: 'cancelled' } }),
prisma.task.count({ where: { status: 'freeze' } })
]);
return {
@@ -203,6 +204,7 @@ export class TasksService {
inProgress,
todo,
cancelled,
freeze,
completionRate: total > 0 ? Math.round((completed / total) * 100) : 0
};
}