diff --git a/svar-gantt-app/data.db b/svar-gantt-app/data.db
index 652f098..57014f2 100644
Binary files a/svar-gantt-app/data.db and b/svar-gantt-app/data.db differ
diff --git a/svar-gantt-app/scripts/init-db.js b/svar-gantt-app/scripts/init-db.js
index 77cc968..bf6785d 100644
--- a/svar-gantt-app/scripts/init-db.js
+++ b/svar-gantt-app/scripts/init-db.js
@@ -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 (
diff --git a/svar-gantt-app/src/routes/api/tasks/+server.ts b/svar-gantt-app/src/routes/api/tasks/+server.ts
index 835ac34..62b5425 100644
--- a/svar-gantt-app/src/routes/api/tasks/+server.ts
+++ b/svar-gantt-app/src/routes/api/tasks/+server.ts
@@ -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);
}
});
diff --git a/svar-gantt-app/src/routes/gantt/+page.svelte b/svar-gantt-app/src/routes/gantt/+page.svelte
index fc46815..6135ccb 100644
--- a/svar-gantt-app/src/routes/gantt/+page.svelte
+++ b/svar-gantt-app/src/routes/gantt/+page.svelte
@@ -4,40 +4,52 @@
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) {
- const { tasks: loadedTasks, links: loadedLinks } = await res.json();
+ const res = await fetch('/api/tasks');
+ if (res.ok) {
+ const { tasks: loadedTasks, links: loadedLinks } = await res.json();
- tasks = loadedTasks.map(task => {
- const start = new Date(task.start);
- const duration = task.duration || task.estimation || 1;
+ tasks = loadedTasks.map(task => {
+ const start = new Date(task.start);
+ const duration = task.duration || task.estimation || 1;
- const end = new Date(start);
- end.setDate(start.getDate() + duration);
-
- return {
- ...task,
- start: start.toISOString().slice(0, 10),
- end: end.toISOString().slice(0, 10),
- duration
- };
- });
-
- links = loadedLinks;
- } else {
- console.error('Erreur de chargement des données depuis la base.');
- }
-});
+ const end = new Date(start);
+ end.setDate(start.getDate() + duration);
+ return {
+ ...task,
+ start: start.toISOString().slice(0, 10),
+ end: end.toISOString().slice(0, 10),
+ duration: duration
+ };
+ });
+ links = loadedLinks;
+ } else {
+ console.error('Erreur de chargement des données depuis la base.');
+ }
+ });