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

Reduce content duplication in "Making your application" in Overseas Passports #1909

Merged
merged 7 commits into from Aug 27, 2015

Conversation

tadast
Copy link
Contributor

@tadast tadast commented Aug 25, 2015

The aim of this change is to make it easier to understand what needs changing when a change request comes in. Duplicated paragraphs make it difficult to trace the source of the content rendered on the outcome page.

"Making your application" section has been extracted to a partial, with all its (sub)partials nested under a new "overseas_passports/making_your_application" dir. This helps to isolate partials related to this section only, because otherwise it can get really confusing to deal with many partials in the main overseas-passports directory. Also, the ips_application_result file is rather big, reducing the overall number of lines in it makes it slightly easier to work with it.

Some cleanup commits have been made before the last and the most important change. These commits have helped me detect duplicated paragraphs.

A version with 'first name and last name' of this sentence is repeated a few
times in this Smart Answer. After consulting with a content designer I am making
this sentence consistent with the others. I am planning to reduce duplication
of the "Making your application" section and this should make it easier.

None of the regression test artefacts seems to cover the case where this
sentence is used, therefore non of the artefacts have changed.
Move "Making your application" section from ips_application_result to
making_your_application partial.

Nest other partials used by making_your_application under a
making_your_application directory. I believe this makes it explicit where those
partials are used, as there are many more in the main overseas-passports dir.
However, the checksum generation script does not automatically pick up those
partials and will need to be improved to select erb partials recursively.

The '? ' prefix in the overseas-passports-files.yml has been introduced to
longer template notes. This has been generated automatically. YAML treats keys
longer than 128 characters as "complex" keys that are denoted by a '? ' prefix.
…ovspeak.erb

Remove content duplication for ips 2 and 3 variants. The changes in regression
test artefacts are insignificant white space changes.
If a Smart Answer views directory is not flat and contains partials nested under
directories - detect them automatically. Currently only overseas-passports
has nested partials.
Extract commonly used paragraphs into partials and reuse them.

This introduces insignificant whitespace changes to outcomes and changes one
sentence from "You’ll get an email..." to "You will receive an email..." so that
the same partial can be used. It is OK with a content designer.

Rationale: even though content is not code, duplication of it is not great.
When change requests come in, they usually have before/after text. If the text
is duplicated, it makes it hard to trace back where the change needs to be made.

It also reduces the text to code ratio in the making_your_application template,
making it easier to follow logic flows.
@chrisroos
Copy link
Contributor

This looks great to me. Good work!

Use standard partials for the phrases in _send_application_ips.govspeak.erb.

This merges two paragraphs into a single one, but it's ok for the sake
of standardisation.
@tadast tadast force-pushed the tt_cleanup_overseas_passports branch from 77fedb4 to 7bad696 Compare August 26, 2015 15:48
tadast added a commit that referenced this pull request Aug 27, 2015
Reduce content duplication in "Making your application" in Overseas Passports
@tadast tadast merged commit dff254f into master Aug 27, 2015
@tadast tadast deleted the tt_cleanup_overseas_passports branch August 27, 2015 09:11
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.

None yet

2 participants