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

@@ -1,37 +1,38 @@
'use client';
import { TaskStatus } from '@/lib/types';
import { getAllStatuses } from '@/lib/status-config';
interface ColumnVisibilityToggleProps {
statuses: { id: TaskStatus; title: string; color: string }[];
hiddenStatuses: Set<TaskStatus>;
onToggleStatus: (status: TaskStatus) => void;
className?: string;
}
export function ColumnVisibilityToggle({
statuses,
hiddenStatuses,
onToggleStatus,
className = ""
}: ColumnVisibilityToggleProps) {
const statuses = getAllStatuses();
return (
<div className={`flex items-center gap-2 ${className}`}>
<span className="text-sm font-mono font-medium text-slate-400">
Colonnes :
</span>
{statuses.map(status => (
{statuses.map(statusConfig => (
<button
key={status.id}
onClick={() => onToggleStatus(status.id)}
key={statusConfig.key}
onClick={() => onToggleStatus(statusConfig.key)}
className={`px-3 py-1 rounded-lg text-xs font-mono font-medium transition-colors ${
hiddenStatuses.has(status.id)
hiddenStatuses.has(statusConfig.key)
? 'bg-slate-700/50 text-slate-500 hover:bg-slate-700'
: 'bg-blue-600/20 text-blue-300 border border-blue-500/30 hover:bg-blue-600/30'
}`}
title={hiddenStatuses.has(status.id) ? `Afficher ${status.title}` : `Masquer ${status.title}`}
title={hiddenStatuses.has(statusConfig.key) ? `Afficher ${statusConfig.label}` : `Masquer ${statusConfig.label}`}
>
{hiddenStatuses.has(status.id) ? '👁️‍🗨️' : '👁️'} {status.title}
{hiddenStatuses.has(statusConfig.key) ? '👁️‍🗨️' : '👁️'} {statusConfig.label}
</button>
))}
</div>