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

docs: how to update terms.md #4220

Merged
merged 4 commits into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions docs/update-terms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# How to update Terms & Conditions

To update the terms and conditions, follow these steps:

1. Export the terms and conditions from Google Docs as a Markdown file.
2. Replace the content of the src/markdown/terms/terms.md file with the exported content.
3. Update the frontmatter of the file with the new version number and date.

That’s it!

The updated terms and conditions will be displayed in the app with the correct version number and date. A popup banner
will automatically appear for users who haven’t accepted the new terms.

## How does this work?

We rely on the version number from the frontmatter. When the Redux store is rehydrated, we check the version stored in
the store against the version in the frontmatter. If they differ, we reset the accepted terms, forcing the user to
accept the new version.

The Markdown file is automatically converted to HTML and displayed in the app. Note that because the Markdown was
generated
from Google Docs, we require the remark-heading-id plugin. Additionally, since Google Docs uses {# ...} syntax, it will
fail in an MDX file.

For Cypress, we follow a similar process. We read the version from the frontmatter and pass it as an environment
variable.

For Jest tests, we mock the file and read the version from the mock.
Loading