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

Use React for rendering Letter of Complaint in production. #1536

Merged
merged 12 commits into from
Jun 11, 2020

Conversation

toolness
Copy link
Collaborator

@toolness toolness commented Jun 10, 2020

This builds on #1535 to actually render the LOC's HTML via React instead of Django.

It also introduces a few breaking changes:

  • /loc/letter.(pdf|html) now only renders the "live preview" version of the letter; it will never render the user's finished letter of complaint (the one stored in LetterRequest.html_content).

  • /loc/finished-letter.pdf now only renders the user's finished LOC, and will 404 if the user doesn't have one.

  • /loc/admin/:user_id/letter.pdf now only renders the user's finished LOC. (I was going to rename it to finished-letter.pdf for consistent naming but this would require a big airtable re-sync... anyways, we can always change it later.

  • The "email your letter" form now only sends finished LOCs, and will not send in-progress ones (a "You have not completed a Letter of Complaint!" error will be displayed).

  • Going forward, LetterRequest.html_content will now contain the full HTML document of the sent PDF, not just what's inside the <body> (this brings it in-line with the NoRent letter). However, legacy HTML content will be detected and wrapped in a full HTML document if needed. (At some point we may want to migrate all the legacy versions to the new format, as it will simplify our code and also make those letters more resilient to styling changes.)

To do

  • Fix broken tests.
  • Add any new tests as needed.
  • Remove unused code.

@toolness toolness marked this pull request as ready for review June 11, 2020 12:04
@toolness toolness merged commit b1c50bc into master Jun 11, 2020
@toolness toolness deleted the use-react-for-loc-pdf branch June 11, 2020 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant