-
Notifications
You must be signed in to change notification settings - Fork 120
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 uk-benefits-abroad to use ERB templates for questions #2156
Merged
chrisroos
merged 9 commits into
master
from
convert-uk-benefits-abroad-to-use-erb-templates-for-questions
Nov 19, 2015
Merged
Convert uk-benefits-abroad to use ERB templates for questions #2156
chrisroos
merged 9 commits into
master
from
convert-uk-benefits-abroad-to-use-erb-templates-for-questions
Nov 19, 2015
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c924b3c
to
99023c9
Compare
I've rebased this against master (resolving the conflicts) and force-pushed. Hopefully that should fix the build for this branch. |
Looks good to me. |
This should make it easier to convert to rendering questions using ERB templates.
We will no longer have access to phrases once we convert to rendering questions via ERB templates. This will make that conversion easier.
This results in more aesthetically pleasing HTML and should make it easier to convert the flow to use ERB templates for questions. There is one `hint` in the YAML file which is two sentences on two different lines with a blank line in between. Presumably the idea was that this would be converted into two paragraph tags by Govspeak. However, attributes like `hint` have never (?) been processed by Govspeak, so this would always have been rendered as a single paragraph tag. Thus it's reasonable for me to combine it all onto a single line. I've updated the regression test artefacts and checksums accordingly.
I ran the following command: $ rails r script/convert-question-i18-yaml-to-erb-templates.rb lib/smart_answer_flows/uk-benefits-abroad Writing template: which_country.govspeak.erb (WARNING: contains interpolation) Writing template: going_or_already_abroad.govspeak.erb Writing template: which_benefit.govspeak.erb Writing template: working_for_a_uk_employer.govspeak.erb Writing template: eligible_for_smp.govspeak.erb Writing template: employer_paying_ni.govspeak.erb Writing template: do_either_of_the_following_apply.govspeak.erb Writing template: working_for_uk_employer_ssp.govspeak.erb Writing template: eligible_for_tax_credits.govspeak.erb Writing template: tax_credits_children.govspeak.erb Writing template: tax_credits_currently_claiming.govspeak.erb Writing template: tax_credits_why_going_abroad.govspeak.erb (WARNING: contains interpolation) Writing template: iidb_already_claiming.govspeak.erb Writing template: db_claiming_benefits.govspeak.erb Writing template: is_claiming_benefits.govspeak.erb Writing template: is_either_of_the_following.govspeak.erb Writing template: is_abroad_for_treatment.govspeak.erb Writing template: is_work_or_sick_pay.govspeak.erb Writing template: is_any_of_the_following_apply.govspeak.erb Writing template: jsa_how_long_abroad.govspeak.erb Writing template: tax_credits_how_long_abroad.govspeak.erb (WARNING: contains interpolation) Writing template: esa_how_long_abroad.govspeak.erb (WARNING: contains interpolation) Writing template: db_how_long_abroad.govspeak.erb (WARNING: contains interpolation) Writing template: is_how_long_abroad.govspeak.erb WARNING: i18n YAML file contains phrases * going_abroad_country_question_title: "Which country are you moving to?" * already_abroad_country_question_title: "Which country are you living in?" * going_abroad_how_long_question_title: "How long are you going abroad for?" * already_abroad_how_long_question_title: "How long will you be living abroad for?" * why_going_abroad_title: "Why are you going abroad?" * why_already_abroad_title: "Why have you gone abroad?" * disability_benefits_how_long_question_title: "How long will you be abroad for?" * already_abroad_text_two: " or permanently" Deleting i18n YAML: uk-benefits-abroad.yml Now insert `use_erb_templates_for_questions` at top of flow: uk-benefits-abroad.rb
Since #2098 & #2112, apostrophes rendered via `SmartAnswer::ErbRenderer` have not been HTML-escaped. Now that we are rendering question content via this renderer, we need to update the regression test artefacts for question pages accordingly. I ran the following commands to do this: $ find test/artefacts/uk-benefits-abroad -name '*.html' -print0 | xargs -0 sed -i .bak "s/'/'/g" $ git clean -fd test/artefacts/uk-benefits-abroad/**/*.bak
These were not dealt with automatically by the conversion script.
The change to ERB templates has introduced a few extra newlines in the question page HTML, but none of them affect the content viewable by the user. I verified that the changes were all only blank lines using the following command: $ git diff --ignore-blank-lines
Re-generating the checksums has removed the i18n YAML file and added the new question templates as I expected.
99023c9
to
f6206f6
Compare
I've rebased this on master and force pushed in preparation for merging. |
chrisroos
added a commit
that referenced
this pull request
Nov 19, 2015
…use-erb-templates-for-questions Convert uk-benefits-abroad to use ERB templates for questions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.