gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit16c0d3b516c0d3b5tickets: 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)mre16c0d3b5/components/inbox.hl

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

Branches

Latest commits

  • 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
  • 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