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 declarative helper methods in all smart answers #4539

Merged
merged 5 commits into from
Jun 30, 2020

Conversation

kevindew
Copy link
Member

@kevindew kevindew commented May 21, 2020

This is built on #4527 and makes changes to all the smart answers.

It removes .govspeak from file extensions, it removes file extensions from partial calls and it renames the render_content_for methods to either text_for or govspeak_for methods.

This includes every smart answer except for the new one, employee risk assessment, since 1) I did this before that existed and 2) there are open PRs for this and it feels like it could change again since it's so new.

The easiest approach to review this is doing it commit by commit. Each commit is focused on one granular change so it should be pretty easy to scroll through a lot of changes looking for any signs of an anomaly.

Here's a few links to popular smart answer pages on preview (pulled out from athena) to make checking it's working easier:

@bevanloon bevanloon temporarily deployed to smart-answer-change-all-hzwhvh May 21, 2020 19:15 Inactive
@kevindew kevindew force-pushed the explanatory-helpers branch 3 times, most recently from 95a797b to 0215636 Compare May 29, 2020 09:28
@kevindew kevindew force-pushed the explanatory-helpers branch from 0215636 to 28fb339 Compare June 4, 2020 09:49
Base automatically changed from explanatory-helpers to master June 4, 2020 11:04
@kevindew kevindew force-pushed the change-all-the-smart-answers branch 2 times, most recently from 7973d62 to b10ee1a Compare June 22, 2020 09:17
@kevindew kevindew requested a review from theseanything June 22, 2020 09:26
@kevindew kevindew marked this pull request as ready for review June 22, 2020 09:26
@bevanloon bevanloon temporarily deployed to smart-answer-change-all-vrr6g8 June 22, 2020 09:28 Inactive
@theseanything theseanything force-pushed the change-all-the-smart-answers branch from b10ee1a to a0518a5 Compare June 30, 2020 12:14
kevindew added 5 commits June 30, 2020 13:28
These files contain mixed media so a .govspeak.erb filename is a bit
misleading. A plain .erb extension is more representative of how these
files contain a mixture of plain text, govspeak and (potentially) HTML.

Command used:
```
find . -name '*.govspeak.erb' -exec sh -c 'mv "$1" "${1%.govspeak.erb}.erb"' _ {} \;
```

There are some files in here that contain only govspeak, these tend to
be partials (for example lib/smart_answer_flows/marriage-abroad/outcomes/_contact_local_authorities.erb),
I don't think it's worth specifying these as .govspeak.erb currently as
I don't think that offers advantages to outweigh the challenges that a
mixed bag of extensions may create. Maybe this is something useful if we
started adding a number of .html.erb files.
This is no longer necessary, these will load fine with just the basename. This
makes them more consistent with common Rails partial loading paradigms.
This replaces the lone use of render_content_for to allow HTML rendering
with a html_for method.
This sets all of these scenarios of setting text content to use the
text_for helper method.
@theseanything theseanything force-pushed the change-all-the-smart-answers branch from a0518a5 to 3973cd7 Compare June 30, 2020 12:28
Copy link
Contributor

@theseanything theseanything 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! Thanks @kevindew - for deploying these changes, we should freeze CD and rollout manually so we can see if there's any issue that come up in staging.

@theseanything theseanything merged commit e7e5af1 into master Jun 30, 2020
@theseanything theseanything deleted the change-all-the-smart-answers branch June 30, 2020 12:35
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.

3 participants