Skip to content

Add markdown for exit pages #704

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

Merged
merged 4 commits into from
Mar 7, 2025
Merged

Add markdown for exit pages #704

merged 4 commits into from
Mar 7, 2025

Conversation

thomasiles
Copy link
Contributor

Add columns for storing the markdown content for exit pages to Condition

Trello card: https://trello.com/c/LYs67GUv/2150-add-somewhere-to-store-exit-page-guidance-in-our-database

This PR adds two columns to the Condition model for storing the heading and markdown content for exit pages.

Exit pages will be represented by a Condition with check_page_id, routing_page_id set and a string value, which could be "", for exit_page_markown.

The Condition validation which reports an error when the goto_page is nil has been changed to ignore exit pages.

It doesn't add any other validations we might need for exit pages. The guidance content stored in pages uses validations which might be useful such as checking the heading is set if the content is set and checks on content and length.

The branching example form in the seed has been extended to include an exit page.

We are keeping the admin and API database table definitions in sync to make migrating easier. Another PR will be raised against admin when this is approved to add the same fields to the conditions table.

Displaying exit pages to form fillers and allowing form creators to create and change exit pages and separate tickets.

Things to consider when reviewing

  • Does this sound like a good way to represent exit pages?
  • Does the design allow us creating/modifying exit pages?
  • Does it make anything about our current condition code harder?
  • Does it make it possible to display exit_pages to form fillers?

@thomasiles thomasiles force-pushed the add_markdown_for_exit_pages branch from 34334b4 to 8f41ed7 Compare March 7, 2025 09:44
@thomasiles thomasiles marked this pull request as ready for review March 7, 2025 09:47
@thomasiles thomasiles force-pushed the add_markdown_for_exit_pages branch 3 times, most recently from 2bc5aba to 16f8c6e Compare March 7, 2025 11:11
Copy link
Member

@lfdebrux lfdebrux left a comment

Choose a reason for hiding this comment

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

Looks good to me 🎉

To support exit pages with content provided by the form creator two new
columns are added to the Conditions table.
Conditions which contain exit pages shouldn't report an error that the
goto_page doesn't exist.

The goto_page will not be set for exit page conditions because they
don't redirect form fillers to other pages.

This commit stops the error being reported for exit_pages.
@thomasiles thomasiles force-pushed the add_markdown_for_exit_pages branch from 16f8c6e to d554d86 Compare March 7, 2025 14:19
Copy link

sonarqubecloud bot commented Mar 7, 2025

@thomasiles thomasiles merged commit f7fc5c0 into main Mar 7, 2025
4 checks passed
@thomasiles thomasiles deleted the add_markdown_for_exit_pages branch March 7, 2025 14:24
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