gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit41da352541da3525Tickets conductor: flake cause, T36 deploy stepmre41da3525/components/inbox.hl

3.3 KB

  1. // components/inbox.hl — `/inbox` (ticket #20): the tickets ASSIGNED TO YOU, in two lists: pending and
  2. // review, across all projects. Personal: needs a login. Live: a ticket assigned to you, or moving into
  3. // or out of those states, appears / disappears without a reload.
  4. parent './main.hl'
  5. import { inboxRows } from '../lib/tickets.hl'
  6. import { siteName } from '../project.hl'
  7. import { userOfSession } from '../lib/users.hl'
  8. import { hintLook, subjectLook, ticketsLook } from '../lib/looks.hl'
  9. session = null
  10. myId = userOfSession(session) != null ? userOfSession(session).id : ''
  11. loggedIn = myId != ''
  12. loggedOut = myId == ''
  13. box = inboxRows(userOfSession(session))
  14. pending = box.pending
  15. review = box.review
  16. noPending = pending.length == 0
  17. noReview = review.length == 0
  18. __title = siteName + ' | inbox'
  19. Style {
  20. pHint = hintLook + { }
  21. olTickets = ticketsLook + { }
  22. aSubject = subjectLook + { }
  23. '#reviewbox' { display = 'grid' gap = '.5rem'
  24. h2 { margin = '0' fontSize = '1.1rem' }
  25. }
  26. '#pendingbox' { display = 'grid' gap = '.5rem'
  27. h2 { margin = '0' fontSize = '1.1rem' }
  28. }
  29. }
  30. View {
  31. ticketBoard {
  32. h1 { id = "heading" "Inbox" }
  33. if (loggedOut) { p { id = "loginhint" Style.pHint "Log in with ident (top right) to see the tickets assigned to you." } }
  34. if (loggedIn) {
  35. section { id = "reviewbox"
  36. h2 { "Review" }
  37. if (noReview) { p { id = "reviewempty" class = "empty" "Nothing is waiting for your review." } }
  38. ol { id = "review" Style.olTickets
  39. for (row of review) {
  40. li {
  41. ticketState { class = row.stateSlug row.state }
  42. a { Style.aSubject href = row.href ticketRef { row.ref } row.subject }
  43. ticketMeta {
  44. a { href = row.projectHref row.projectTitle }
  45. time { row.updated }
  46. }
  47. }
  48. }
  49. }
  50. }
  51. section { id = "pendingbox"
  52. h2 { "Pending" }
  53. if (noPending) { p { id = "pendingempty" class = "empty" "Nothing is pending for you." } }
  54. ol { id = "pending" Style.olTickets
  55. for (row of pending) {
  56. li {
  57. ticketState { class = row.stateSlug row.state }
  58. a { Style.aSubject href = row.href ticketRef { row.ref } row.subject }
  59. ticketMeta {
  60. a { href = row.projectHref row.projectTitle }
  61. time { row.updated }
  62. }
  63. }
  64. }
  65. }
  66. }
  67. }
  68. }
  69. }
  70. // a row goes to the top of its list if it is assigned to me and in that state, and out of both otherwise
  71. place = (row) => {
  72. p = []
  73. r = []
  74. if (row.assigneeId == myId && row.state == 'pending') { p.push(row) }
  75. if (row.assigneeId == myId && row.state == 'review') { r.push(row) }
  76. for (x of pending) { if (x.id != row.id) { p.push(x) } }
  77. for (x of review) { if (x.id != row.id) { r.push(x) } }
  78. pending = p
  79. review = r
  80. noPending = p.length == 0
  81. noReview = r.length == 0
  82. }
  83. on client ticketCreated(row) { place(row) }
  84. on client ticketEvent(ticketId, ev, row) { place(row) }
  85. on client signedIn(tag, info) {
  86. b = emit server myInbox()
  87. if (b != null && b.pending != null) {
  88. pending = b.pending
  89. review = b.review
  90. noPending = b.pending.length == 0
  91. noReview = b.review.length == 0
  92. myId = b.me
  93. loggedIn = true
  94. loggedOut = false
  95. }
  96. }
  97. on client signedOut(tag) {
  98. myId = ''
  99. loggedIn = false
  100. loggedOut = true
  101. }
  102. on server myInbox(session) {
  103. u = userOfSession(session)
  104. if (u == null) { return { error = 'log in first' } }
  105. b = inboxRows(u)
  106. return { pending = b.pending review = b.review me = u.id }
  107. }

Branches

Latest commits

  • 41da3525Tickets conductor: flake cause, T36 deploy stepmre
  • 64c477e6Tickets conductor: deploy waits for Arachnemre
  • 467d7286Tickets conductor: T36 done, deploy questionmre
  • 8542fc8aTickets conductor: T36 proof reviewedmre
  • 2a5b8b91Tickets conductor: T36 cap stop, resumed for proofmre
  • 6a82097fTickets conductor: Arachne W228 on day35 flakemre
  • 0ee5a6f2Tickets conductor: T36 resumedmre
  • 9149c165Tickets conductor: T36 diagnosismre
  • 91713313Tickets conductor: T36 report 1mre
  • 756315d2Tickets conductor: T36 startedmre
  • 0814ce6bTickets conductor: brief 025 tickets#36 style formmre
  • 1b6916c4Tickets conductor: Atlas handover tickets#36mre
  • aab95226Tickets conductor: worldapi-conductor paths, deploy blocker = read-only diskmre
  • 6372b06dTickets conductor: worker port slotmre
  • 836af31cTickets conductor: token pathsmre
  • b03f11b6Tickets conductor: CONDUCTOR.md (project part), short STATUS.md, old STATUS to archive/2026-10-31mre
  • a4123831tickets#42: the /connect and /login/callback error pages are app pages: the function routes redirect to /connect/failed/<code> and /login/failed/<code> (components/problem.hl, sentences in lib/problems.hl), htmlPage and its hand-written stylesheet are gone; gate tests/error-pages.mjsmre
  • cefc7b4atickets: a startup error prints its message before exit 1 (hybriel#247)mre
  • 99bd6570tickets: lib/migrate.hl writes no table of another topic any more: projects.hl rewriteSlug / addProjectNamed / hasMembers, tickets.hl moveToProject / ticketRecords / ticketRecordsOf, events.hl renameStates / eventRecords / eventRecordsOf; the migration calls them (tickets#47)mre
  • b57161e3tickets: the markup names its own rules (Style.pMessage, Style.olTickets, ...) instead of hand-written class strings that copy a stylesheet rule; the shared bodies sit in lib/looks.hl (tickets#38)mre