feat: enhance task forms and Kanban components with dynamic priority loading
- Updated `CreateTaskForm` and `EditTaskForm` to load priority options dynamically using `getAllPriorities`, improving maintainability. - Refactored `KanbanFilters` to utilize dynamic priority options, enhancing filter functionality. - Modified `QuickAddTask` and `TaskCard` to display priorities using centralized configuration, ensuring consistency across the application. - Introduced new utility functions in `status-config.ts` for managing priority configurations, streamlining the task management process.
This commit is contained in:
@@ -7,6 +7,7 @@ import { Badge } from '@/components/ui/Badge';
|
||||
import { TagDisplay } from '@/components/ui/TagDisplay';
|
||||
import { useTasksContext } from '@/contexts/TasksContext';
|
||||
import { useDraggable } from '@dnd-kit/core';
|
||||
import { getPriorityConfig } from '@/lib/status-config';
|
||||
|
||||
interface TaskCardProps {
|
||||
task: Task;
|
||||
@@ -159,11 +160,7 @@ export function TaskCard({ task, onDelete, onEdit, onUpdateTitle, compactView =
|
||||
)}
|
||||
|
||||
{/* Indicateur de priorité compact */}
|
||||
<div className={`w-1.5 h-1.5 rounded-full ${
|
||||
task.priority === 'high' ? 'bg-red-400' :
|
||||
task.priority === 'medium' ? 'bg-yellow-400' :
|
||||
'bg-slate-500'
|
||||
}`} />
|
||||
<div className={`w-1.5 h-1.5 rounded-full bg-${getPriorityConfig(task.priority).color}-400`} />
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
@@ -237,11 +234,7 @@ export function TaskCard({ task, onDelete, onEdit, onUpdateTitle, compactView =
|
||||
)}
|
||||
|
||||
{/* Indicateur de priorité tech */}
|
||||
<div className={`w-2 h-2 rounded-full animate-pulse ${
|
||||
task.priority === 'high' ? 'bg-red-400 shadow-red-400/50 shadow-sm' :
|
||||
task.priority === 'medium' ? 'bg-yellow-400 shadow-yellow-400/50 shadow-sm' :
|
||||
'bg-slate-500'
|
||||
}`} />
|
||||
<div className={`w-2 h-2 rounded-full animate-pulse bg-${getPriorityConfig(task.priority).color}-400 shadow-${getPriorityConfig(task.priority).color}-400/50 shadow-sm`} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user