-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug-orders.js
More file actions
41 lines (34 loc) · 1.25 KB
/
Copy pathdebug-orders.js
File metadata and controls
41 lines (34 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Debug script to check task orders
// Run this in browser console: copy and paste
console.log('=== TASK ORDERS DEBUG ===');
// Get tasks from localStorage
const tasks = JSON.parse(localStorage.getItem('tasks') || '[]');
// Group by status
const grouped = {
TODO: [],
IN_PROGRESS: [],
DONE: []
};
tasks.forEach(task => {
if (task.status === 'TODO') grouped.TODO.push(task);
else if (task.status === 'IN_PROGRESS') grouped.IN_PROGRESS.push(task);
else if (task.status === 'DONE') grouped.DONE.push(task);
});
// Display orders for each column
Object.keys(grouped).forEach(status => {
console.log(`\n${status} Column:`);
const columnTasks = grouped[status].sort((a, b) => (a.order || 0) - (b.order || 0));
columnTasks.forEach((task, index) => {
console.log(` ${index + 1}. "${task.title.substring(0, 30)}..." - order: ${task.order}`);
});
console.log(` Total: ${columnTasks.length} tasks`);
});
// Check for duplicate orders
Object.keys(grouped).forEach(status => {
const orders = grouped[status].map(t => t.order);
const duplicates = orders.filter((item, index) => orders.indexOf(item) !== index);
if (duplicates.length > 0) {
console.warn(`⚠️ ${status} has duplicate orders:`, duplicates);
}
});
console.log('\n=== END DEBUG ===');