gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit7c8e6d837c8e6d83Limit edited state note fix to Markdown renderingmre7c8e6d83/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

  • 7c8e6d83Limit edited state note fix to Markdown renderingmre
  • 36984386Preserve state transitions when their notes are editedmre
  • d75cb946Log E30 startmre
  • 0bf3fefaMission 030: edited state note labelmre
  • 691565c6Log neutral-ticket rule checkmre
  • bc3bdecerecords: day38b live, #94 purgedmre
  • f6c5aa0dMerge main (records)mre
  • e23d42acconnect gate: wait for hydration before clicking Disconnectmre
  • a5d45d00records: D38 cause, GOmre
  • 19eeb938records: D38 gates, two day38b failuresmre
  • f8e42a85Re-vendor tickets to Hybriel set day38b (1e554d7)mre
  • 51645016Merge purge-94 (#94, identity rule)mre
  • 94d6ca2arecords: D38 startedmre
  • 9df09aacmission 029: day38b re-vendor + deploymre
  • d2834f65records: #94 backup planmre
  • 4467d8cbrecords: #94 purge readymre
  • aa2d124eREADME: the #94 purge gatemre
  • e843ff7cOne-time purge of miserit-anthar#94 (#94, identity rule): idempotent step in lib/migrate.hl, fixture gate tests/purge94.mjsmre
  • 506a4efdmission 028: #94, identity rulemre
  • 78c7f48eRefine mpackdb holdmre