gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitfd6ca1e6fd6ca1e6Tickets conductor: brief 027 waker design, push-test projectmrefd6ca1e6/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

  • fd6ca1e6Tickets conductor: brief 027 waker design, push-test projectmre
  • e448e656Tickets conductor: STATUS #51mre
  • 1c10857bTickets conductor: P51 eval, brief 027mre
  • e725969dTickets conductor: #51 directionmre
  • 1b5c63ddTickets conductor: P51 startedmre
  • 9f13fbdaTickets conductor: brief 026 prioritymre
  • acc477d9Tickets conductor: brief 026 + Vinzenz recommendationsmre
  • 9233a734Tickets conductor: brief 026 completemre
  • 5da589fdTickets conductor: brief 026 + Gitoria's answermre
  • a3cd5329Tickets conductor: tickets#51 opened, brief 026 draftmre
  • 6f6e5797Tickets conductor: STATUS wordingmre
  • 957de51fTickets conductor: T36 live, #36 review, #50 donemre
  • bc2fde32Merge branch 'main' into t36-stylemre
  • b7ca093atests: wait for the new row and normalize editor marker spacesmre
  • 41da3525Tickets conductor: flake cause, T36 deploy stepmre
  • 64c477e6Tickets conductor: deploy waits for Arachnemre
  • 467d7286Tickets conductor: T36 done, deploy questionmre
  • fed5ca81ticket_list: remove repeated selected-state coloursmre
  • 8542fc8aTickets conductor: T36 proof reviewedmre
  • 35980936inbox: preserve desktop columns after list styles were scopedmre