Compare commits

..

1 Commits

Author SHA1 Message Date
95cc10a8de assign_dont_work 2025-07-14 19:10:55 +02:00
6 changed files with 77 additions and 41 deletions

Binary file not shown.

View File

@ -21,7 +21,8 @@ db.exec(`
progress INTEGER,
type TEXT,
parent INTEGER,
lazy BOOLEAN DEFAULT 0 -- ✅ Ajout ici
assignedTo TEXT,
lazy_loading BOOLEAN DEFAULT 0
);
CREATE TABLE links (

View File

@ -12,8 +12,30 @@ export async function POST({ request }) {
const { tasks, links } = await request.json();
const insertTask = db.prepare(`
INSERT INTO tasks (id, text, start, end, duration, progress, type, parent, lazy)
VALUES (@id, @text, @start, @end, @duration, @progress, @type, @parent, @lazy)
INSERT INTO tasks (
id,
text,
start,
end,
duration,
progress,
type,
parent,
assignedTo,
lazy_loading
)
VALUES (
@id,
@text,
@start,
@end,
@duration,
@progress,
@type,
@parent,
@assignedTo,
@lazy_loading
)
`);
const insertLink = db.prepare(`
@ -21,21 +43,20 @@ export async function POST({ request }) {
VALUES (@id, @source, @target, @type)
`);
const taskTx = db.transaction((all) => {
const taskTx = db.transaction(({ tasks, links }) => {
db.prepare('DELETE FROM tasks').run();
db.prepare('DELETE FROM links').run();
for (const task of all.tasks) {
for (const task of tasks) {
insertTask.run({
...task,
start: typeof task.start === 'object' ? new Date(task.start).toISOString() : task.start,
end: typeof task.end === 'object' ? new Date(task.end).toISOString() : task.end,
lazy: task.lazy ? 1 : 0, // ⚠️ SQLite ne supporte pas le type boolean natif
lazy_loading: task.lazy_loading ? 1 : 0
});
}
for (const link of all.links) {
for (const link of links) {
insertLink.run(link);
}
});

View File

@ -4,11 +4,25 @@
let tasks = [];
let links = [];
// 🗓️ Affichage : mois + jours
const scales = [
{ unit: 'month', step: 1, format: 'MMMM yyyy' },
{ unit: 'day', step: 1, format: 'd' }
];
// 📋 Options : colonnes personnalisées
const options = {
taskList: {
visible: true, // ✅ Important
columns: [
{ id: 'text', label: 'Nom', value: 'text', width: 200 },
{ id: 'assignedTo', label: 'Assignée à', value: 'assignedTo', width: 150 }
]
}
};
onMount(async () => {
const res = await fetch('/api/tasks');
if (res.ok) {
@ -25,7 +39,7 @@
...task,
start: start.toISOString().slice(0, 10),
end: end.toISOString().slice(0, 10),
duration
duration: duration
};
});
@ -33,11 +47,9 @@
} else {
console.error('Erreur de chargement des données depuis la base.');
}
});
});
</script>
<Willow>
<Gantt {tasks} {links} {scales} />
<Gantt {tasks} {links} {scales} {options} />
</Willow>

View File

@ -25,13 +25,14 @@
return {
id: index + 1,
text: entry['Nom Ticket'],
start: start.toISOString().split('T')[0], // ⬅️ Converti en string
end: end.toISOString().split('T')[0], // ⬅️ Converti en string
start: start.toISOString().split('T')[0],
end: end.toISOString().split('T')[0],
duration: Number(entry['Estimation (j)']) || 1,
progress: Number(entry['RAF']) || 0,
type: 'task',
parent: null,
lazy: false
assignedTo: entry['assignedTo'] || '', // ✅ Ajout ici
lazy_loading: false // ✅ Correspond à la colonne renommée
};
});
@ -53,6 +54,7 @@
}
</script>
<h2>Importer un fichier CSV</h2>
<input type="file" accept=".csv" on:change={handleFile} />

View File

@ -1,7 +1,7 @@
ID Ticket,Nom Ticket,Estimation (j),Sprint,Statut,RAF
T-001,Authentification,5,Sprint 1,Terminé,0
T-002,Page daccueil,3,Sprint 1,En cours,2
T-003,Système de recherche,4,Sprint 2,À faire,4
T-005,Sprint 3,3,Sprint 1,En cours,2
T-004,Configuration BO,4,Sprint 2,À faire,4
T-006,Endpoint à configurer sur api,1,Sprint 2,À faire,1
ID Ticket,Nom Ticket,Estimation (j),Sprint,Statut,RAF,assignedTo
T-001,Authentification,5,Sprint 1,Terminé,0,Simon BOYER
T-002,Page daccueil,3,Sprint 1,En cours,2,Simon BOYER
T-003,Système de recherche,4,Sprint 2,À faire,4,Fatima BROUM
T-005,Sprint 3,3,Sprint 1,En cours,2,Fatima BROUM
T-004,Configuration BO,4,Sprint 2,À faire,4,Fatima BROUM
T-006,Endpoint à configurer sur api,1,Sprint 2,À faire,1,Fatima BROUM
1 ID Ticket Nom Ticket Estimation (j) Sprint Statut RAF assignedTo
2 T-001 Authentification 5 Sprint 1 Terminé 0 Simon BOYER
3 T-002 Page d’accueil 3 Sprint 1 En cours 2 Simon BOYER
4 T-003 Système de recherche 4 Sprint 2 À faire 4 Fatima BROUM
5 T-005 Sprint 3 3 Sprint 1 En cours 2 Fatima BROUM
6 T-004 Configuration BO 4 Sprint 2 À faire 4 Fatima BROUM
7 T-006 Endpoint à configurer sur api 1 Sprint 2 À faire 1 Fatima BROUM