AVP-87 Multiple Class updated not showing for multiple students in parent portal

This commit is contained in:
root
2026-03-29 14:03:50 -04:00
parent 58445b2a48
commit b2026812d5
3 changed files with 174 additions and 90 deletions
+25 -3
View File
@@ -250,6 +250,30 @@
modalInstance.show();
};
const renderNameCell = (user) => {
const td = document.createElement('td');
const fullName = `${user?.firstname ?? ''} ${user?.lastname ?? ''}`.trim();
const label = fullName !== '' ? fullName : '—';
const roleList = Array.isArray(user?.roles)
? user.roles.map((role) => (role || '').toString().toLowerCase())
: [];
const isParent = roleList.includes('parent');
const uid = Number(user?.id || 0);
if (isParent && uid > 0) {
const link = document.createElement('a');
link.href = '#';
link.className = 'text-decoration-none';
link.setAttribute('data-family-guardian-id', String(uid));
link.textContent = label;
td.appendChild(link);
return td;
}
td.textContent = label;
return td;
};
const renderTable = () => {
if (!tableBody) return;
@@ -280,9 +304,7 @@
accountCell.textContent = user.account_id ?? '';
row.appendChild(accountCell);
const nameCell = document.createElement('td');
nameCell.textContent = `${user.firstname ?? ''} ${user.lastname ?? ''}`.trim();
row.appendChild(nameCell);
row.appendChild(renderNameCell(user));
const emailCell = document.createElement('td');
emailCell.textContent = user.email ?? '';