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

Convert what happens next content to markdown #378

Merged
merged 2 commits into from
Dec 5, 2023

Conversation

DavidBiddle
Copy link
Contributor

@DavidBiddle DavidBiddle commented Dec 1, 2023

What problem does this pull request solve?

Trello card: https://trello.com/c/AbPj2LRr/1191-allow-markdown-on-confirmation-page-what-happens-next-content

Adds a rake task which takes the content of the what_happens_next_text field, converts it to markdown using the ReverseMarkdown gem, then saves this markdown in the to the what_happens_next_markdown field that we added in #371. It also adds this markdown to the made live form.

Doing this as a rake task means we're not stuck with a migration that's dependent on a specific gem, and we've previously said we'd consider reserving migrations for schema changes. The downside is we'll have to run the task manually in each environment.

To do in other PRs:

  • cleanup: delete the old field and all the logic related to it which we no longer need

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Has all relevant documentation been updated?

@DavidBiddle DavidBiddle force-pushed the convert-whn-to-markdown branch from 64d4a9b to 0006406 Compare December 4, 2023 13:43
@DavidBiddle DavidBiddle changed the title Convert whn to markdown Convert what happens next content to markdown Dec 4, 2023
Adds the ReverseMarkdown gem to the app, so that we can automatically
convert the what_happens_next_text content into markdown.
@DavidBiddle DavidBiddle force-pushed the convert-whn-to-markdown branch 2 times, most recently from 8021f17 to 253fe03 Compare December 5, 2023 10:58
@DavidBiddle DavidBiddle marked this pull request as ready for review December 5, 2023 11:05
Adds a rake task which uses the ReverseMarkdown gem to convert each form
and made_live_form's what_happens_next_text content to markdown, and
save this markdown to the what_happens_next_markdown field. Also adds a
task to clear the content in the what_happens_next_markdown field in
case we need to revert the change.
@DavidBiddle DavidBiddle force-pushed the convert-whn-to-markdown branch from 275e750 to f532286 Compare December 5, 2023 14:58
Copy link

sonarqubecloud bot commented Dec 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@aliuk2012 aliuk2012 left a comment

Choose a reason for hiding this comment

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

Nice work, I like the specs created for the rake task

@DavidBiddle DavidBiddle added this pull request to the merge queue Dec 5, 2023
Merged via the queue into main with commit e275349 Dec 5, 2023
4 checks passed
@DavidBiddle DavidBiddle deleted the convert-whn-to-markdown branch December 5, 2023 15:05
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.

2 participants