Skip to content
This repository has been archived by the owner on Nov 27, 2020. It is now read-only.

The repeater! #132

Merged
merged 54 commits into from
Dec 30, 2019
Merged

The repeater! #132

merged 54 commits into from
Dec 30, 2019

Commits on Dec 6, 2019

  1. enable extended body parsing for nested data

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    964fedc View commit details
    Browse the repository at this point in the history
  2. BREAKING: deprecate getViewData() in favour of loadSession

    === why? ===
    
    For the repeater (and other context-sensitive rendering), we will need
    to access and mutate view data through `res.locals`. This means that all
    our data needs to be available there. So, instead of passing in data to
    `res.render(...)`, we consistently use a middleware that loads data into
    `res.locals`. This results in easier-to-follow code, and it is clearer
    that the choice of what data to load comes from the schema. For locals
    that don't appear in the schema, implementers can use
    `loadKeys(...keys)` or `loadFullSession` to get data from the session,
    or implement a custom middleware that adds data to `res.locals`.
    
    For the vast majority of cases, rendering should be done with the
    middleware `route.render()`.
    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    dd08cff View commit details
    Browse the repository at this point in the history
  3. add context middleware primitives for data

    `enterContext` and `exitContext` allow us to dynamically traverse nested
    data in the session. Using these, we can change the "context" from which
    we get data and errors, and automatically generate `name` attributes
    appropriate for the nested data.
    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    5518e9e View commit details
    Browse the repository at this point in the history
  4. update all the control macros to use getData(...) etc

    this way, the data, error, and name will all be relative to the context.
    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    8fb11a5 View commit details
    Browse the repository at this point in the history
  5. use loadFullSession in the confirmation page

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    0acf3d7 View commit details
    Browse the repository at this point in the history
  6. remove the data.* scope in the confirmation page

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    0c28f0d View commit details
    Browse the repository at this point in the history
  7. use the new style controls in the personal route

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    f6f346d View commit details
    Browse the repository at this point in the history
  8. use the new style for the start page

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    a20138d View commit details
    Browse the repository at this point in the history
  9. warn when referencing a non-existent route

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    846c5b4 View commit details
    Browse the repository at this point in the history
  10. add the repeater!

    this uses `enterContext` and `exitContext` to iterate over the existing
    data and render the contents statically multiple times on the backend.
    the frontend will then manage the buttons and re-ordering, in such a way
    that the data will be posted properly to the server.
    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    26675e6 View commit details
    Browse the repository at this point in the history
  11. add a sample route 'addresses' that uses the repeater

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    23fdf75 View commit details
    Browse the repository at this point in the history
  12. locale changes

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    e19d623 View commit details
    Browse the repository at this point in the history
  13. add a spec for the context helpers

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    eaf000c View commit details
    Browse the repository at this point in the history
  14. properly implement isFirstError(relname)

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    5b18e1a View commit details
    Browse the repository at this point in the history
  15. properly use the errorState session key

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    38ae1f2 View commit details
    Browse the repository at this point in the history
  16. expand the contextHelpers spec

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    c8ceada View commit details
    Browse the repository at this point in the history
  17. clear the error state on any successful form submission

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    e47fdef View commit details
    Browse the repository at this point in the history
  18. behave better when req.body has falsey values

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    95a0a1e View commit details
    Browse the repository at this point in the history
  19. comment

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    0d2bce9 View commit details
    Browse the repository at this point in the history
  20. rm a test for an interface that doesn't exist anymore

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    36eca23 View commit details
    Browse the repository at this point in the history
  21. rm a console.log

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    25332ad View commit details
    Browse the repository at this point in the history
  22. properly propagate the errors from the session

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    03e9e8d View commit details
    Browse the repository at this point in the history
  23. remove validateRouteData

    we will want something similar to this, but the current implementation
    is not workable.
    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    654f851 View commit details
    Browse the repository at this point in the history
  24. rm data.helpers.spec.js

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    73c13f5 View commit details
    Browse the repository at this point in the history
  25. add in mockSession, a new way to mock the session

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    b73a639 View commit details
    Browse the repository at this point in the history
  26. protect against cases in tests where there is no session

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    9c5bf35 View commit details
    Browse the repository at this point in the history
  27. use console.warn for warnings

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    361d4e5 View commit details
    Browse the repository at this point in the history
  28. rely on res.locals.firstError in isFirstError

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    aeefec0 View commit details
    Browse the repository at this point in the history
  29. lint

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    e44a04f View commit details
    Browse the repository at this point in the history
  30. add a test for route.render()

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    2a2143a View commit details
    Browse the repository at this point in the history
  31. add a test for pad

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    0992bfe View commit details
    Browse the repository at this point in the history
  32. rm useless conditional

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    2e900ad View commit details
    Browse the repository at this point in the history
  33. use default arguments for pad

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    22ed9d7 View commit details
    Browse the repository at this point in the history
  34. fix the error list links

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    5367470 View commit details
    Browse the repository at this point in the history
  35. better autofocus behaviour

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    da957c0 View commit details
    Browse the repository at this point in the history
  36. add unique identifiers and styling to repeaters

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    2497783 View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    5106865 View commit details
    Browse the repository at this point in the history
  38. standardize on client.js for client javascript

    and have it automatically loaded if the file exists
    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    9578768 View commit details
    Browse the repository at this point in the history
  39. update repeater.js to es6 style

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    1585efa View commit details
    Browse the repository at this point in the history
  40. delete an overly-brittle test

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    6143c05 View commit details
    Browse the repository at this point in the history
  41. better keyboard navigation behaviour

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    771cdc5 View commit details
    Browse the repository at this point in the history
  42. move polyfill scripts to assets/js/

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    3abc290 View commit details
    Browse the repository at this point in the history
  43. move the only remaining nunjucks script to googleAnalytics.njk

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    daae75f View commit details
    Browse the repository at this point in the history
  44. add assets/js/ to the default module path for client js

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    88a4d27 View commit details
    Browse the repository at this point in the history
  45. add translations for the addresses page and fix confirmation

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    a28a606 View commit details
    Browse the repository at this point in the history
  46. remove the push hooks - we will rely on CI

    http://jneen.net/ committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    10c35e5 View commit details
    Browse the repository at this point in the history

Commits on Dec 9, 2019

  1. disable import-checking in eslint

    bad imports should be caught immediately in testing anyways
    http://jneen.net/ committed Dec 9, 2019
    Configuration menu
    Copy the full SHA
    9892891 View commit details
    Browse the repository at this point in the history
  2. use modern variable scoping in repeater.js

    http://jneen.net/ committed Dec 9, 2019
    Configuration menu
    Copy the full SHA
    f8c323e View commit details
    Browse the repository at this point in the history
  3. use template strings in repeater.js

    http://jneen.net/ committed Dec 9, 2019
    Configuration menu
    Copy the full SHA
    8f1de10 View commit details
    Browse the repository at this point in the history
  4. rename a confusingly-named helper function

    http://jneen.net/ committed Dec 9, 2019
    Configuration menu
    Copy the full SHA
    8eb5f9e View commit details
    Browse the repository at this point in the history
  5. properly set up the webpack import resolver for eslint

    http://jneen.net/ committed Dec 9, 2019
    Configuration menu
    Copy the full SHA
    b5a609a View commit details
    Browse the repository at this point in the history
  6. suppress the lgtm bot warning for document.write

    http://jneen.net/ committed Dec 9, 2019
    Configuration menu
    Copy the full SHA
    62b898a View commit details
    Browse the repository at this point in the history
  7. fix and simplify the logic of details-polyfill-detect

    http://jneen.net/ committed Dec 9, 2019
    Configuration menu
    Copy the full SHA
    ef0f025 View commit details
    Browse the repository at this point in the history
  8. use <button>s for the add / remove buttons

    http://jneen.net/ committed Dec 9, 2019
    Configuration menu
    Copy the full SHA
    76e9d42 View commit details
    Browse the repository at this point in the history