qa: Improve work assignation
Some checks are pending
continuous-integration/drone/push Build is running

This commit is contained in:
nemunaire 2025-01-14 10:42:11 +01:00
commit e71dc24a27
2 changed files with 88 additions and 24 deletions

View file

@ -22,10 +22,12 @@
goto("teams/" + id)
}
let start = 0;
let turns = 3;
let team_prefix = "";
let team_assistants = "";
let assignForm = {
start: 0,
turns: 3,
team_prefix: "",
team_assistants: "",
}
let assignInProgress = false;
async function assignExercices() {
@ -33,12 +35,7 @@
const res = await fetch(`api/qa_assign_work`, {
method: 'POST',
headers: {'Accept': 'application/json'},
body: JSON.stringify({
start,
turns,
team_prefix,
team_assistants,
}),
body: JSON.stringify(assignForm),
})
if (res.status == 200) {
teams.refresh();
@ -111,23 +108,26 @@
<form on:submit|preventDefault={assignExercices}>
<FormGroup>
<Label for="ae-start">Compteur de départ</Label>
<Input type="number" id="ae-start" bind:value={start} />
<Input type="number" id="ae-start" bind:value={assignForm.start} />
<p class="form-text">
Incrémenter de 1 pour chaque nouveau challenge blanc, cela décale l'attribution des exercices.
</p>
</FormGroup>
<FormGroup>
<Label for="ae-turns">Nombre d'itérations</Label>
<Input type="number" id="ae-turns" bind:value={turns} />
<Input type="number" id="ae-turns" bind:value={assignForm.turns} />
</FormGroup>
<FormGroup>
<Label for="ae-prefix">Préfixe des noms d'équipes</Label>
<Input id="ae-prefix" bind:value={team_prefix} placeholder="FIC Groupe" />
<Input id="ae-prefix" bind:value={assignForm.team_prefix} placeholder="FIC Groupe" />
</FormGroup>
<FormGroup>
<Label for="ae-assistants">Nom de l'équipe assistants</Label>
<Input id="ae-assistants" bind:value={team_assistants} placeholder="Assistants" />
<Input id="ae-assistants" bind:value={assignForm.team_assistants} placeholder="Assistants" />
</FormGroup>
<Input class="mb-3" type="switch" label="Ne pas répartir les exercices indépendants" bind:checked={assignForm.without_standalone_exercices} />
<Input class="mb-3" type="switch" label="Ne pas répartir les scénarios" bind:checked={assignForm.without_themes} />
<Input class="mb-3" type="switch" label="Répartir tous les exercices existant sans considération des scénarios dans lesquels ils se trouvent" bind:checked={assignForm.only_exercices} />
<Button
type="submit"
disabled={assignInProgress}