tickets
All repositories: gitoria
3.0 KB
// components/inbox.hl — `/inbox` (ticket #20): the tickets ASSIGNED TO YOU, in two lists: pending and// review, across all projects. Personal: needs a login. Live: a ticket assigned to you, or moving into// or out of those states, appears / disappears without a reload.parent './main.hl'import { inboxRows } from '../store.hl'import { siteName } from '../project.hl'import { userOfSession } from '../users.hl'session = nullmyId = userOfSession(session) != null ? userOfSession(session).id : ''loggedIn = myId != ''loggedOut = myId == ''box = inboxRows(userOfSession(session))pending = box.pendingreview = box.reviewnoPending = pending.length == 0noReview = review.length == 0__title = siteName + ' | inbox'View {ticketBoard {h1 { id = "heading" "Inbox" }if (loggedOut) { p { id = "loginhint" class = "hint" "Log in with ident (top right) to see the tickets assigned to you." } }if (loggedIn) {section { id = "reviewbox"h2 { "Review" }if (noReview) { p { id = "reviewempty" class = "empty" "Nothing is waiting for your review." } }ol { id = "review" class = "tickets"for (row of review) {li {ticketState { class = row.stateSlug row.state }a { class = "subject" href = row.href ticketRef { row.ref } row.subject }ticketMeta {a { href = row.projectHref row.projectTitle }time { row.updated }}}}}}section { id = "pendingbox"h2 { "Pending" }if (noPending) { p { id = "pendingempty" class = "empty" "Nothing is pending for you." } }ol { id = "pending" class = "tickets"for (row of pending) {li {ticketState { class = row.stateSlug row.state }a { class = "subject" href = row.href ticketRef { row.ref } row.subject }ticketMeta {a { href = row.projectHref row.projectTitle }time { row.updated }}}}}}}}}// a row goes to the top of its list if it is assigned to me and in that state, and out of both otherwiseplace = (row) => {let p = []let r = []if (row.assigneeId == myId && row.state == 'pending') { p.push(row) }if (row.assigneeId == myId && row.state == 'review') { r.push(row) }for (x of pending) { if (x.id != row.id) { p.push(x) } }for (x of review) { if (x.id != row.id) { r.push(x) } }pending = preview = rnoPending = p.length == 0noReview = r.length == 0}on client ticketCreated(row) { place(row) }on client ticketEvent(ticketId, ev, row) { place(row) }on client signedIn(tag, info) {let b = emit server myInbox()if (b != null && b.pending != null) {pending = b.pendingreview = b.reviewnoPending = b.pending.length == 0noReview = b.review.length == 0myId = b.meloggedIn = trueloggedOut = false}}on client signedOut(tag) {myId = ''loggedIn = falseloggedOut = true}on server myInbox(session) {let u = userOfSession(session)if (u == null) { return { error = 'log in first' } }let b = inboxRows(u)return { pending = b.pending review = b.review me = u.id }}
Branches
- mainmain branch
Latest commits
- 2ab91ee9tickets: gate checks rows appear once (session sync); re-vendor to ff51cf46 stopped on hybriel#122, stays 837fe120mre
- e01c2b1dtickets#24: installable app (manifest, service worker, offline list), own icon; gate waits for the hello's pongmre
- 752fbb7fdeploy.sh: back up live storage/.sessions/.env before every deploy (newest 5 kept)mre
- 38bdd5e4deploy.sh: never send .git or .gitignore to Byrodinmre
- f12fa1bcState of 2026-09-27, before the move to gitoriamre