qa: Managers can view team and manage theirs todo list
This commit is contained in:
parent
b94beb363b
commit
cd64fc90bf
13 changed files with 526 additions and 24 deletions
|
|
@ -9,11 +9,12 @@
|
|||
import { getExerciceQA } from '$lib/qa';
|
||||
import { exercicesIdx } from '$lib/stores/exercices';
|
||||
import { themesIdx } from '$lib/stores/themes';
|
||||
import { todos } from '$lib/stores/todo';
|
||||
|
||||
export { className as class };
|
||||
let className = '';
|
||||
|
||||
export let team = null;
|
||||
|
||||
function show(id) {
|
||||
goto("exercices/" + id)
|
||||
}
|
||||
|
|
@ -23,7 +24,7 @@
|
|||
setInterval(() => my_exercicesP = update_exercices(), 62000);
|
||||
|
||||
async function update_exercices() {
|
||||
const view = await getQAView();
|
||||
const view = await getQAView(team);
|
||||
my_exercices = [];
|
||||
|
||||
for (const v of view) {
|
||||
|
|
@ -50,7 +51,13 @@
|
|||
>
|
||||
↻
|
||||
</button>
|
||||
<h3>Vos étapes</h3>
|
||||
<h3>
|
||||
{#if team}
|
||||
Étapes de l'équipe
|
||||
{:else}
|
||||
Vos étapes
|
||||
{/if}
|
||||
</h3>
|
||||
{#await my_exercicesP}
|
||||
<div class="text-center">
|
||||
<Spinner size="lg" />
|
||||
|
|
|
|||
|
|
@ -13,10 +13,15 @@
|
|||
export { className as class };
|
||||
let className = '';
|
||||
|
||||
let exo_doneP = getExerciceTested();
|
||||
export let team = null;
|
||||
|
||||
let teamtodos = todos;
|
||||
$: teamtodos = team ? team.todos : todos;
|
||||
|
||||
let exo_doneP = getExerciceTested(team);
|
||||
let tododone = { };
|
||||
|
||||
getQAWork().then((queries) => {
|
||||
getQAWork(team).then((queries) => {
|
||||
for (const q of queries) {
|
||||
tododone[q.id_exercice] = q;
|
||||
}
|
||||
|
|
@ -30,12 +35,12 @@
|
|||
<div class={className}>
|
||||
<button
|
||||
class="btn btn-dark float-end"
|
||||
on:click|preventDefault={() => { todos.refresh(); exo_doneP = getExerciceTested(); }}
|
||||
on:click|preventDefault={() => { todos.refresh(); exo_doneP = getExerciceTested(team); }}
|
||||
>
|
||||
↻
|
||||
</button>
|
||||
<h3>Étapes à tester et valider</h3>
|
||||
{#await todos.refresh()}
|
||||
{#await teamtodos.refresh()}
|
||||
<div class="text-center">
|
||||
<Spinner size="lg" />
|
||||
</div>
|
||||
|
|
@ -54,7 +59,7 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each $todos as todo (todo.id)}
|
||||
{#each $teamtodos as todo (todo.id)}
|
||||
<tr
|
||||
style:cursor="pointer"
|
||||
class:text-light={!tododone[todo.id_exercice] && !exo_done[todo.id_exercice]}
|
||||
|
|
|
|||
Reference in a new issue