From c293b58a94c437fca9ba4e7f14db0b8a4b6434e2 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Wed, 18 Sep 2024 11:33:45 +0200 Subject: [PATCH] qa: Handle standalones exercices --- qa/ui/src/lib/stores/exercices.js | 1 + qa/ui/src/routes/teams/[tid]/+page.svelte | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/qa/ui/src/lib/stores/exercices.js b/qa/ui/src/lib/stores/exercices.js index 135d1277..910ec591 100644 --- a/qa/ui/src/lib/stores/exercices.js +++ b/qa/ui/src/lib/stores/exercices.js @@ -44,6 +44,7 @@ export const exercicesByTheme = derived( const exercices_idx = { }; for (const e of $exercices) { + if (!e.id_theme) e.id_theme = 0; if (!exercices_idx[e.id_theme]) { exercices_idx[e.id_theme] = [] } diff --git a/qa/ui/src/routes/teams/[tid]/+page.svelte b/qa/ui/src/routes/teams/[tid]/+page.svelte index 69ca3125..50f2c7cf 100644 --- a/qa/ui/src/routes/teams/[tid]/+page.svelte +++ b/qa/ui/src/routes/teams/[tid]/+page.svelte @@ -141,7 +141,7 @@ bind:value={newTodo} > {#each Object.keys($exercicesByTheme) as thid} - + {#each $exercicesByTheme[thid] as exercice (exercice.id)} {/each} @@ -171,7 +171,9 @@ bind:value={newThemeTodo} > {#each Object.keys($exercicesByTheme) as thid} - + {#if thid != "0"} + + {/if} {/each}