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 '../lib/tickets.hl'import { siteName } from '../project.hl'import { userOfSession } from '../lib/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) => {p = []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) {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) {u = userOfSession(session)if (u == null) { return { error = 'log in first' } }b = inboxRows(u)return { pending = b.pending review = b.review me = u.id }}
Branches
Latest commits
- 48c1ba79tickets: md-paste-files gate with the file manager casesmre
- f04afc43tickets: MdEditor from components 59704ce (a file manager copy still attaches, pipe rows, tickets#49)mre
- 06599fa0tickets: MdEditor from components b0f1ec2 (a clipboard with text always pastes the text, tickets#49); real Ctrl+V gatemre
- 2e1b116ftickets: re-vendor Hybriel master acaceaf3 (framework ec8d6c1d): plugins/web patch queue while a page is built, anonymous session cookies refresh; gate waits for the comment editors to draw (W174) and clicks the form editor when it stands still; security gate: main's code runs on its own binary, lazy-session cookie checksmre
- 361bc0fetickets: re-vendor Hybriel 7a684920 (WIP, not deployed); on Error exits 1 at startup; migrate passes its log by reference; gate checks follow lazy sessions and the 413 refusalmre
- 8a69999cident#28: /login/callback never signs out the session it finds; a valid code puts the user on the same sessionmre
- 337e9b21tickets#37: a comment's files are open to everyone who can read the commentmre
- 1800600ftickets: write the standby service out in full so the boot gate can read the main servicemre
- 8179d287tickets: standby service on its port plus 10 and a deploy that hands over through it without a gapmre
- 0398145ctickets: the table grid rule is marked functional for check-thememre
- 40fddc20tickets takes components e54f83a: tables get thin grey lines from the theme, desktop toolbar stays one row with the Table button, F4 check counts 11 buttonsmre
- c1b77d61tickets#35: text typed before the editor is built is taken in once by the build (the input handler no longer writes it to the field first, which doubled the first letters); the gate failure shows the surfacemre
- 32bf1873tickets#35: the gate types right after the load with the CPU slowed, no waitingmre
- 64ea9ca2tickets#35: text typed into the reply editor before the page has finished starting is kept; the gate types right after loadmre
- ccd3a327tickets: the security gate expects frame-src to be exactly the ident address (the sign-in frame), still no wildcard or selfmre
- 4348dbabident#31: the selector's sign-in returns to the page the user started on (return attribute = the login callback with next), gate checkmre
- 66ef3005Merge branch 'iw-ident-widget'mre
- bc0ad663tickets: a gap between your name and Log out in the phone header (they touched); gate checks itmre
- 2f818d46UX2: report, LOG line, e2e fixes, gate pause after loadmre
- af3ef7c4gate: the legacy state line says progressmre