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

show errors if confirm not checked on review page #9697

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

Harriethw
Copy link
Contributor

@Harriethw Harriethw commented Dec 4, 2024

DO NOT MERGE: Unless between 11:30-14:00

Because this is not an active record error we have to have some custom behaviour here. Not sure if this is the best way!
Currently the review page is only shown for the create/new journey, so have checked we are on the 'new' step here.

mural

Screenshot 2024-12-04 at 12 04 11

code

Screenshot 2024-12-04 at 12 02 55


⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

Follow these steps if you are doing a Rails upgrade.

@Harriethw Harriethw requested a review from pezholio December 4, 2024 12:06
@Harriethw Harriethw force-pushed the content-modelling/719-with-checkbox-confirm-error branch from 0e1fceb to 5e69626 Compare December 4, 2024 12:06
@@ -61,6 +61,7 @@ def edit_draft

def review
@content_block_edition = ContentBlockManager::ContentBlock::Edition.find(params[:id])
@review_errors = [REVIEW_ERROR.new(attribute: "is_confirmed", full_message: "Confirm details are correct")]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this used anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah nope

def publish
if params[:step] == NEW_BLOCK_STEPS[:review] && params[:is_confirmed].blank?
raise StandardError
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to raise here? Could we not just have the code from line 132 and down inside the conditional, and then wrap the happy path in an else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true! I guess it doesn't have to be an error, have turned into an if statement

@Harriethw Harriethw force-pushed the content-modelling/719-with-checkbox-confirm-error branch 2 times, most recently from 5d30ead to 796bd53 Compare December 5, 2024 10:51
Because this is not an active record error we have
to have some custom behaviour here. Currently the
review page is only shown for the create/new
journey, so have checked we are on the 'new' step
here.
@Harriethw Harriethw force-pushed the content-modelling/719-with-checkbox-confirm-error branch from 796bd53 to 00c6b19 Compare December 5, 2024 11:25
@Harriethw Harriethw marked this pull request as ready for review December 5, 2024 11:25
@Harriethw Harriethw requested a review from pezholio December 5, 2024 11:25
assert_text "Email address scheduled to publish on #{@future_date.strftime('%e %B %Y%l:%M%P').strip}"
assert_text "Email address scheduled to publish on #{@future_date.strftime('%e %B %Y %l:%M%P')}"
Copy link
Contributor

Choose a reason for hiding this comment

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

I think let's just remove the date altogether here - it makes sense to not have our feature tests so specific

this was causing tests to be flakey because
sometimes it would format with the space padded
before time, sometimes without.

https://gds.slack.com/archives/C0776B04EJU/p1733396809325189
@Harriethw Harriethw force-pushed the content-modelling/719-with-checkbox-confirm-error branch from 00c6b19 to 1252dd2 Compare December 5, 2024 11:32
@Harriethw Harriethw enabled auto-merge December 5, 2024 11:33
@Harriethw Harriethw merged commit 98a0fa6 into main Dec 5, 2024
19 checks passed
@Harriethw Harriethw deleted the content-modelling/719-with-checkbox-confirm-error branch December 5, 2024 11:38
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