Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template (and forms) engine overhaul #443

Merged
merged 28 commits into from
Apr 13, 2024

Commits on Mar 29, 2024

  1. Refactor variable substitution

    Variable substitution is essentially the same as tag insertion, so the
    two features can share the same underlying implementation.
    martinhpedersen committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    1491072 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8002ec6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f62fdf0 View commit details
    Browse the repository at this point in the history
  4. Distinguish Template from Form

    (HTML) Forms is an extension of the Templates feature in RMS Express.
    Templates are the .txt files. Some templates support HTML forms,
    indicated by the Template Control Field `Form`.
    martinhpedersen committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    5b96698 View commit details
    Browse the repository at this point in the history
  5. Improve form variable prompting in CLI composer

    Forms-enabled templates is not written with a CLI user in mind. By
    echoing the template line before prompting for a <Var ...>, it will
    hopefully be possible to understand the meaning of the variable (by
    context).
    
    Also apply a hack to refresh the regular expressions used by
    varReplacer, to avoid prompting for the same variable multiple times.
    martinhpedersen committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    461b7a6 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    300a993 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    8c55e0a View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    99b1990 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    f565b4e View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    d2bdc6a View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    7ea6cd7 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    91505ba View commit details
    Browse the repository at this point in the history
  13. Add a couple of missing insertion Tags + docs

    <Day>, <UDay>, <GPSLatitude> and <GPSLongitude>
    martinhpedersen committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    90be40d View commit details
    Browse the repository at this point in the history
  14. Refactor XML marshalling and add tests

    Also fixed issue of inconsistent output due to unstable ordering of form
    variables.
    martinhpedersen committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    b4c6c2b View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    66c6dd7 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    6bcde3a View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    a911ce1 View commit details
    Browse the repository at this point in the history
  18. Ignore invalid file references

    This fixes an issue where, when searching for a html viewer, we ended up
    using a non-existent HTML file.
    martinhpedersen committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    d01879f View commit details
    Browse the repository at this point in the history
  19. Fallback to global file reference search

    Some templates references HTML Forms and reply templates located in
    adjecent folders, without specifying a relative path. Examples of this
    can be found in `MAPPING-GIS FORMS`.
    martinhpedersen committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    2df1a56 View commit details
    Browse the repository at this point in the history
  20. Resolve Form files by referencing the template

    By referencing the template instead of the "initial_uri" (Forms
    composer), the backend is able to more precisely identify the correct
    HTML file for any given template. It also makes handling of reply
    templates much easier.
    
    In addition to a less complex implementation, this simplifies the API as
    we no longer need to supply the frontend with URIs for all HTML
    variants. We also get increased performance because of the simplified
    file search, and by not having to parse reply templates upfront.
    
    This also opens up the possibility of serving a specialized HTML-based
    composer for text-only templates in the future, without having to change
    the existing frontend.
    martinhpedersen committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    fbfed32 View commit details
    Browse the repository at this point in the history
  21. Cleanup

    martinhpedersen committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    79b6cc0 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    9de98d3 View commit details
    Browse the repository at this point in the history
  23. Recompile web assets

    `./make,bash web` for 8fcca1c.
    martinhpedersen committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    60f1710 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    d62bb92 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    44a5e4b View commit details
    Browse the repository at this point in the history
  26. Remove trailing space in GPSValid insertion tag

    Winlink Express does include this, and neither should we.
    martinhpedersen committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    1c74d30 View commit details
    Browse the repository at this point in the history
  27. Trim whitespace from form vars in XML attachment

    I found this difference when comparing against Winlink Express's output
    using the same Form template. Winlink Express trims trailing whitespace
    before writing the form variables as XML.
    martinhpedersen committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    57f479d View commit details
    Browse the repository at this point in the history
  28. Fix formatting of dates in test

    Gofmt did not agree with my zero-padded numeric constants.
    martinhpedersen committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    6270fb8 View commit details
    Browse the repository at this point in the history