Gift trail: invited guest reads 'Invited — awaiting setup', not active
The portal's trail now carries a derived state per guest entry — 'invited' while the Cloudron invite is un-accepted (the guest cannot log in yet) — rendered as a pale-blue pill; the ledger status stays the fallback for older payloads. Display only.
This commit is contained in:
1 parent
1e9d212bd0
commit
e5162afa05
1 file changed
+6
-1
+6
-1
@@ -647,6 +647,7 @@ PAGE_HTML = """<!DOCTYPE html>
|
||||
.gpill.ok { background: #eaf3ea; color: #2f5c30; }
|
||||
.gpill.done { background: #f1e8da; color: #a97a4a; }
|
||||
.gpill.bad { background: #f6e9e5; color: var(--danger); }
|
||||
.gpill.invited { background: #e7edf5; color: #4a6a8a; }
|
||||
|
||||
footer {
|
||||
border-top: 1px solid var(--border);
|
||||
@@ -954,6 +955,7 @@ function renderGuestEnded(g) {
|
||||
|
||||
const GUEST_STATUS_LABELS = {
|
||||
rejected: ['not approved', 'bad'],
|
||||
invited: ['Invited — awaiting setup', 'invited'],
|
||||
active: ['active guest', 'ok'],
|
||||
converted: ['became a member', 'done'],
|
||||
expired: ['ended — time ran out', 'done'],
|
||||
@@ -1012,10 +1014,13 @@ function renderGuests(d) {
|
||||
$('guest-trail').innerHTML = trail.map(t => {
|
||||
const who = t.name ? escapeHtml(t.name) + ' · ' + escapeHtml(t.recipient) : escapeHtml(t.recipient);
|
||||
const when = t.decided_at ? 'Decided ' + fmtDay(t.decided_at) : 'Sent ' + fmtDay(t.created_at);
|
||||
// `state` carries the portal's derived display state — 'invited' while the
|
||||
// guest has not accepted their setup invite (never 'active' before that).
|
||||
// Older payloads carry status only; fall back to it.
|
||||
return '<div class="guest-row">' +
|
||||
'<div><div class="guest-who">' + who + '</div>' +
|
||||
'<div class="guest-meta">' + when + '</div></div>' +
|
||||
guestStatusPill(t.status, t.kind) +
|
||||
guestStatusPill(t.state || t.status, t.kind) +
|
||||
'</div>';
|
||||
}).join('');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user