gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit8542fc8a8542fc8aTickets conductor: T36 proof reviewedmre8542fc8a/lib/problems.hl

2.8 KB

  1. // lib/problems.hl — WHAT THE ERROR PAGES SAY (tickets#42). /connect and /login/callback are function routes: they decide, they do not draw.
  2. // A refusal redirects to a PAGE of the app (components/problem.hl: the same shell, header and theme) and names the reason by a SHORT CODE in the
  3. // path (`/login/failed/<code>`, `/connect/failed/<code>`); the sentence is chosen HERE from the code, so no text of the URL (or of ident, or of
  4. // the app asking to connect) is ever rendered: an unknown code gets the general sentence.
  5. // the sentence and the heading of a code: { title, text, back, backText }
  6. static problemOf = (code) => {
  7. let title = 'Something went wrong'
  8. let text = 'That did not work. Please try again.'
  9. let back = '/'
  10. let backText = 'back to the tickets'
  11. if (code == 'login-method') { title = 'Login failed' text = 'The login return only accepts a normal page visit.' }
  12. if (code == 'login-no-code') { title = 'Login failed' text = 'Ident sent no login code. Please sign in again.' }
  13. if (code == 'login-refused') { title = 'Login failed' text = 'Ident did not accept the login code. Please sign in again.' }
  14. if (code == 'login-no-answer') { title = 'Login failed' text = 'Ident did not answer. Please try again in a moment.' }
  15. if (code == 'login-not-set-up') { title = 'Login failed' text = 'Login is not set up on this server.' }
  16. if (code == 'login-no-user') { title = 'Login failed' text = 'Your user could not be stored. Please try again.' }
  17. if (code == 'login-invite') { title = 'Invite failed' text = 'The invite could not be used. It may be used up, or meant for a project that does not exist any more. Ask for a new one.' }
  18. if (code == 'connect-method') { title = 'Connect failed' text = 'The connection request only accepts a normal page visit.' }
  19. if (code == 'connect-refused') { title = 'Connect failed' text = 'The app sent a connection request that is not valid: its name or its return address was not accepted. Start again from the app.' }
  20. if (code == 'connect-busy') { title = 'Connect failed' text = 'Too many connection requests are waiting. Try again in a few minutes.' }
  21. if (code == 'connect-store') { title = 'Connect failed' text = 'The connection request could not be stored. Please try again.' }
  22. return { title = title text = text back = back backText = backText }
  23. }
  24. // the code an ident exchange error stands for (users.hl exchangeCode answers its reason as text)
  25. static loginCodeOf = (error) => {
  26. if (error == 'ident did not answer') { return 'login-no-answer' }
  27. if (error != null && error.indexOf('not set up') >= 0) { return 'login-not-set-up' }
  28. return 'login-refused'
  29. }
  30. // the code a refused connection request stands for (connections.hl createRequest)
  31. static connectCodeOf = (r) => {
  32. if (r.busy == true) { return 'connect-busy' }
  33. if (r.error != null && r.error.startsWith('could not store')) { return 'connect-store' }
  34. return 'connect-refused'
  35. }

Branches

Latest commits

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