Guests list: invited guest reads 'invited' (awaiting setup), not active

Prefer the portal's derived state on the guest row: 'invited' (pale-blue
pill, awaiting-setup tooltip) while the Cloudron invite is un-accepted;
ledger status stays the fallback for older payloads. Display only.
This commit is contained in:
Inferencebot committed 2026-11-08 20:40:26 +00:00
1 parent 0487b382cd
commit b23cc67128
1 file changed
+11 -3
+11 -3
View File
@@ -373,6 +373,7 @@ PAGE_HTML = """<!DOCTYPE html>
.pill.org { background: #e7edf5; color: #4a6a8a; } .pill.org { background: #e7edf5; color: #4a6a8a; }
.pill.grace { background: #fdf3e3; color: #a97a2a; } .pill.grace { background: #fdf3e3; color: #a97a2a; }
.pill.guest { background: #efe7f2; color: #7a5a92; } .pill.guest { background: #efe7f2; color: #7a5a92; }
.pill.invited { background: #e7edf5; color: #4a6a8a; }
/* Standard guest-invite form (shared with the member dashboard): ONE field, /* Standard guest-invite form (shared with the member dashboard): ONE field,
plain labels, fits a narrow frame. */ plain labels, fits a narrow frame. */
.guest-invite-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; margin-top: 20px; } .guest-invite-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; margin-top: 20px; }
@@ -1346,9 +1347,16 @@ function renderMembers() {
const emailLine = g.username ? '<div style="color:var(--muted);font-size:11px">' + esc(g.email) + '</div>' : ''; const emailLine = g.username ? '<div style="color:var(--muted);font-size:11px">' + esc(g.email) + '</div>' : '';
const credits = Number(g.credits_remaining ?? g.credit_balance ?? 0); const credits = Number(g.credits_remaining ?? g.credit_balance ?? 0);
const exp = g.guest_expires_at ? String(g.guest_expires_at).slice(0, 10) : '—'; const exp = g.guest_expires_at ? String(g.guest_expires_at).slice(0, 10) : '—';
const st = String(g.guest_status || (g.active ? 'active' : 'inactive')); // The portal derives the display state: 'invited' while the guest has
const stClass = st === 'active' ? 'active' : (st === 'converted' ? 'org' : 'inactive'); // not accepted their setup invite (provisioned but cannot log in yet —
const stTitle = { active: 'Guest access live', converted: 'Guest became a member', expired: 'Time box elapsed', depleted: 'Credits spent' }[st] || ''; // never 'active' before that), else the ledger status.
const st = g.state === 'invited' ? 'invited'
: String(g.guest_status || (g.active ? 'active' : 'inactive'));
const stClass = { invited: 'invited', active: 'active', converted: 'org' }[st] || 'inactive';
const stTitle = {
invited: 'Invited — awaiting setup (the guest has not accepted their invite yet)',
active: 'Guest access live', converted: 'Guest became a member',
expired: 'Time box elapsed', depleted: 'Credits spent' }[st] || '';
return '<tr>' + return '<tr>' +
'<td><strong>' + esc(top) + '</strong>' + emailLine + '</td>' + '<td><strong>' + esc(top) + '</strong>' + emailLine + '</td>' +
'<td>' + esc(g.guest_inviter || '—') + '</td>' + '<td>' + esc(g.guest_inviter || '—') + '</td>' +