feat: snel-toevoegen-knop onder elke groep in Gebruikers (v0.4.05-beta)
All checks were successful
dev - build & deploy naar test / build-and-deploy (push) Successful in 34s
All checks were successful
dev - build & deploy naar test / build-and-deploy (push) Successful in 34s
Net als bij systeemmanagers (vorige commit) krijgt nu elke groep in de Gebruikers-tab (schoolbeheerder, groepsleiding, en elke klas incl. "geen klas") direct een eigen "+ ..."-knop eronder om iemand toe te voegen zonder naar een ander tabblad te hoeven. Bij een klas staat die klas al vast ingevuld (presetClassId, bestond al als parameter maar werd nog nergens gebruikt). Een groep blijft zichtbaar zolang er iets aan toegevoegd kan worden, ook als hij nu leeg is (bv. een gloednieuwe klas zonder leerlingen) - anders was er nergens een knop om de eerste aan toe te voegen. Geverifieerd in een echte headless Chromium (gemockte /api/** responses): groepen en knoppen verschijnen zoals verwacht, en de klas-select bij een klasgroep staat al goed vooringesteld.
This commit is contained in:
parent
c6638d63f1
commit
e5890280cc
3 changed files with 16 additions and 7 deletions
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
|||
0.4.04-beta
|
||||
0.4.05-beta
|
||||
|
|
|
|||
|
|
@ -1359,21 +1359,30 @@
|
|||
const loose = USERS.filter(u=>["teacher","admin","pupil"].includes(u.role) && u.schoolId==null);
|
||||
if(loose.length) group("gnoschool", T("amNoSchoolGroup"), loose);
|
||||
}else{
|
||||
/* één school gekozen: groepeer op rol, leerlingen per klas */
|
||||
/* één school gekozen: groepeer op rol, leerlingen per klas - elke groep
|
||||
krijgt direct een "snel toevoegen"-formulier eronder (net als bij
|
||||
systeemmanagers), zodat een nieuwe schoolbeheerder/leerkracht/
|
||||
leerling niet via een ander tabblad hoeft. Een groep zonder leden
|
||||
blijft zichtbaar zolang er wél iets aan toegevoegd kan worden -
|
||||
anders is een lege klas nergens te vinden om iemand aan toe te voegen. */
|
||||
[["admin", T("roleAdmin")], ["teacher", T("roleTeacher")]].forEach(([role, label])=>{
|
||||
const us = USERS.filter(u=>u.role===role);
|
||||
if(us.length) group("role:"+role, label, us, true);
|
||||
if(us.length || creatableRoles().includes(role)) group("role:"+role, label, us, true);
|
||||
if(creatableRoles().includes(role)) list.appendChild(addForm(role));
|
||||
});
|
||||
const pupils = USERS.filter(u=>u.role==="pupil");
|
||||
if(currentUser.role==="teacher"){
|
||||
if(pupils.length) group("pupils", T("amPupils"), pupils, true);
|
||||
if(pupils.length || creatableRoles().includes("pupil")) group("pupils", T("amPupils"), pupils, true);
|
||||
if(creatableRoles().includes("pupil")) list.appendChild(addForm("pupil"));
|
||||
}else{
|
||||
CLASSES.forEach(c=>{
|
||||
const us = pupils.filter(u=>u.classId===c.id);
|
||||
if(us.length) group("class:"+c.id, c.name, us, true);
|
||||
if(us.length || creatableRoles().includes("pupil")) group("class:"+c.id, c.name, us, true);
|
||||
if(creatableRoles().includes("pupil")) list.appendChild(addForm("pupil", c.id));
|
||||
});
|
||||
const noClass = pupils.filter(u=>!u.classId);
|
||||
if(noClass.length) group("class:none", T("amNoClass"), noClass, true);
|
||||
if(noClass.length || creatableRoles().includes("pupil")) group("class:none", T("amNoClass"), noClass, true);
|
||||
if(creatableRoles().includes("pupil")) list.appendChild(addForm("pupil"));
|
||||
}
|
||||
const parents = USERS.filter(u=>u.role==="parent");
|
||||
if(parents.length) group("parents", T("amParents"), parents);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"use strict";
|
||||
/* version — shown until /api/version resolves (or if the fetch fails, e.g. offline).
|
||||
Kept in sync by hand with the VERSION file at the repo root on every release. */
|
||||
const VERSION = "0.4.04-beta";
|
||||
const VERSION = "0.4.05-beta";
|
||||
(function(){
|
||||
const tag = document.getElementById("verTag");
|
||||
tag.textContent = "v"+VERSION;
|
||||
|
|
|
|||
Loading…
Reference in a new issue