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:
1 parent
0487b382cd
commit
b23cc67128
1 file changed
+11
-3
+11
-3
@@ -373,6 +373,7 @@ PAGE_HTML = """<!DOCTYPE html>
|
||||
.pill.org { background: #e7edf5; color: #4a6a8a; }
|
||||
.pill.grace { background: #fdf3e3; color: #a97a2a; }
|
||||
.pill.guest { background: #efe7f2; color: #7a5a92; }
|
||||
.pill.invited { background: #e7edf5; color: #4a6a8a; }
|
||||
/* Standard guest-invite form (shared with the member dashboard): ONE field,
|
||||
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; }
|
||||
@@ -1346,9 +1347,16 @@ function renderMembers() {
|
||||
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 exp = g.guest_expires_at ? String(g.guest_expires_at).slice(0, 10) : '—';
|
||||
const st = String(g.guest_status || (g.active ? 'active' : 'inactive'));
|
||||
const stClass = st === 'active' ? 'active' : (st === 'converted' ? 'org' : 'inactive');
|
||||
const stTitle = { active: 'Guest access live', converted: 'Guest became a member', expired: 'Time box elapsed', depleted: 'Credits spent' }[st] || '';
|
||||
// The portal derives the display state: 'invited' while the guest has
|
||||
// not accepted their setup invite (provisioned but cannot log in yet —
|
||||
// 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>' +
|
||||
'<td><strong>' + esc(top) + '</strong>' + emailLine + '</td>' +
|
||||
'<td>' + esc(g.guest_inviter || '—') + '</td>' +
|
||||
|
||||
Reference in new issue
Block a user