Skip to content
This repository was archived by the owner on Jul 6, 2026. It is now read-only.

Add API Terms of Service page - #2735

Merged
MaxGhenis merged 5 commits into
masterfrom
feature/api-tos-page
Aug 16, 2025
Merged

MaxGhenis merged 5 commits into
masterfrom
feature/api-tos-page

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Summary

  • Adds a comprehensive API Terms of Service page based on the content from the Google Doc
  • Makes the terms jurisdiction-aware (adapts governing law based on US/UK)
  • Accessible at /{countryId}/api/terms (e.g., /us/api/terms, /uk/api/terms)

Changes

  • Created ApiTermsOfService.jsx component with the full legal terms
  • Set up routing as a subpage under /api
  • Added link from the API documentation page
  • Adapted governing law section to use appropriate jurisdiction based on country

Testing

  • Page compiles and renders successfully
  • All linting errors fixed
  • Follows existing patterns from Terms & Conditions and Privacy pages

Fixes #2734

- Create ApiTermsOfService component with legal terms from Google Doc
- Add routing as subpage under /api/terms
- Link from API documentation page
- Adapt governing law based on country (UK vs US jurisdiction)
- Fixes #2734
Copilot AI review requested due to automatic review settings August 15, 2025 10:10
@vercel

vercel Bot commented Aug 15, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
policyengine-app ✅ Ready Preview Comment Aug 15, 2025 1:30pm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a comprehensive API Terms of Service page to the PolicyEngine application, making legal terms available for API users. The implementation follows existing patterns from other legal pages and includes jurisdiction-aware content that adapts based on the user's country.

  • Creates a new dedicated page for API Terms of Service accessible via /{countryId}/api/terms
  • Implements jurisdiction-aware governing law that adapts based on country (US/UK)
  • Adds a link from the API documentation page to the new terms page

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/pages/learn/ApiTermsOfService.jsx New component containing comprehensive API terms with jurisdiction-aware content
src/pages/learn/APIGeneralContent.jsx Adds link to Terms of Service from API documentation page
src/PolicyEngine.jsx Sets up nested routing structure for API pages with terms as subpage

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/pages/learn/ApiTermsOfService.jsx Outdated
Comment thread src/pages/learn/ApiTermsOfService.jsx Outdated
- Change default jurisdiction from District of Columbia to United States
- Add dedicated getCourtLocation function for cleaner logic
- Make jurisdiction handling more extensible for future countries
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

- Create api-terms.md with the full terms content
- Update component to render markdown with react-markdown
- Use placeholders for jurisdiction-specific content
- Much cleaner and more maintainable than HTML
- Component focuses on fetching and processing the markdown
- All content lives in api-terms.md file
- No more duplicate content to maintain
- Remove separate api-terms.md file (CRA doesn't support importing .md files)
- Embed content as template string in the component
- Still renders as markdown with ReactMarkdown
- Fixes build failure
@MaxGhenis
MaxGhenis merged commit ff0c5a2 into master Aug 16, 2025
4 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in policyengine-app Aug 16, 2025
@MaxGhenis
MaxGhenis deleted the feature/api-tos-page branch August 16, 2025 10:24

This branch was successfully deployed

1 active deployment
Preview — 65930d32 Deployed Aug 15, 2025 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add page with API TOS

2 participants