gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit0814ce6b0814ce6bTickets conductor: brief 025 tickets#36 style formmre0814ce6b/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

  • 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
  • f767b24dtickets: 111 needless let became plain declarations (3 in ticket.hl, ticket_list.hl, comments.hl and 108 never-reassigned, not captured loop-body ones); the 212 really reassigned lets stay (tickets#44)mre
  • 16c0d3b5tickets: the modal window is phone first: the full-screen sheet is the base rule, the centred window sits in the min-width 60rem block (tickets#39)mre
  • 090ee809tickets: every component's styles in its own nested Style {} block; styles.hl keeps only the theme inherit, the accent and the site-wide rules (tickets#36)mre
  • d395763ftickets: ident-access gate ports 8769/8768 (8797 is taken on loreana)mre
  • afb9a403tickets: an ident access key (Authorization: Bearer idt_…) works in the API (ident#27 app side): lib/ident-access.hl copied from components, read keys GET only, ident down 503; gate tests/ident-access-tickets.mjsmre
  • 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