fix: lint

This commit is contained in:
Julien Froidefond
2025-09-16 22:13:28 +02:00
parent 122a47f232
commit 4f137455f4
19 changed files with 290 additions and 105 deletions

View File

@@ -15,34 +15,33 @@ interface SwimlanesboardProps {
onUpdateStatus?: (taskId: string, newStatus: TaskStatus) => Promise<void>;
compactView?: boolean;
visibleStatuses?: TaskStatus[];
loading?: boolean;
loading: boolean;
}
export function SwimlanesBoard({
tasks,
export function SwimlanesBoard({
tasks,
onCreateTask,
onDeleteTask,
onEditTask,
onUpdateTitle,
onUpdateStatus,
onDeleteTask,
onEditTask,
onUpdateTitle,
onUpdateStatus,
compactView = false,
visibleStatuses,
loading = false
}: SwimlanesboardProps) {
const { tags: availableTags } = useTasksContext();
// Grouper les tâches par tags et créer les données de swimlanes
const swimlanesData = useMemo((): SwimlaneData[] => {
const grouped: { [tagName: string]: Task[] } = {};
// Ajouter une catégorie pour les tâches sans tags
grouped['Sans tag'] = [];
tasks.forEach(task => {
tasks.forEach((task) => {
if (!task.tags || task.tags.length === 0) {
grouped['Sans tag'].push(task);
} else {
task.tags.forEach(tagName => {
task.tags.forEach((tagName) => {
if (!grouped[tagName]) {
grouped[tagName] = [];
}
@@ -50,7 +49,7 @@ export function SwimlanesBoard({
});
}
});
// Convertir en format SwimlaneData et trier
return Object.entries(grouped)
.sort(([a, tasksA], [b, tasksB]) => {
@@ -64,7 +63,7 @@ export function SwimlanesBoard({
// Obtenir la couleur du tag
const getTagColor = (name: string) => {
if (name === 'Sans tag') return '#64748b'; // slate-500
const tag = availableTags.find(t => t.name === name);
const tag = availableTags.find((t) => t.name === name);
return tag?.color || '#64748b';
};
@@ -73,10 +72,13 @@ export function SwimlanesBoard({
label: tagName,
color: getTagColor(tagName),
tasks: tagTasks,
context: tagName !== 'Sans tag' ? {
type: 'tag' as const,
value: tagName
} : undefined
context:
tagName !== 'Sans tag'
? {
type: 'tag' as const,
value: tagName,
}
: undefined,
};
});
}, [tasks, availableTags]);
@@ -94,4 +96,4 @@ export function SwimlanesBoard({
visibleStatuses={visibleStatuses}
/>
);
}
}