Browse Source

Merge pull request #229 from communitiesuk/design-audit-2

Design audit 2
pull/231/head
Paul Robert Lloyd 3 years ago committed by GitHub
parent
commit
f99a545ba4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      app/models/constants/case_log.rb
  2. 6
      app/views/case_logs/edit.html.erb
  3. 2
      app/views/form/_check_answers_table.html.erb
  4. 7
      app/views/form/check_answers.html.erb
  5. 2
      app/views/form/guidance/_what_counts_as_income.html.erb
  6. 13
      config/forms/2021_2022.json
  7. 12
      config/locales/en.yml
  8. 2
      spec/features/form/check_answers_page_spec.rb
  9. 24
      spec/fixtures/forms/2021_2022.json
  10. 4
      spec/fixtures/forms/test_validator.json

8
app/models/constants/case_log.rb

@ -248,9 +248,9 @@ module Constants::CaseLog
"Other problems with neighbours" => 11, "Other problems with neighbours" => 11,
"Property unsuitable because of overcrowding" => 12, "Property unsuitable because of overcrowding" => 12,
"End of assured shorthold tenancy - no fault" => 40, "End of assured shorthold tenancy - no fault" => 40,
"End of assured shorthold tenancy - tenant's fault" => 41, "End of assured shorthold tenancy - tenants fault" => 41,
"End of fixed term tenancy - no fault" => 42, "End of fixed term tenancy - no fault" => 42,
"End of fixed term tenancy - tenant's fault" => 43, "End of fixed term tenancy - tenants fault" => 43,
"Repossession" => 34, "Repossession" => 34,
"Under occupation - offered incentive to downsize" => 29, "Under occupation - offered incentive to downsize" => 29,
"Under occupation - no incentive" => 30, "Under occupation - no incentive" => 30,
@ -417,7 +417,7 @@ module Constants::CaseLog
"Islington" => "E09000019", "Islington" => "E09000019",
"Kensington and Chelsea" => "E09000020", "Kensington and Chelsea" => "E09000020",
"Kettering" => "E07000153", "Kettering" => "E07000153",
"King's Lynn and West Norfolk" => "E07000146", "Kings Lynn and West Norfolk" => "E07000146",
"Kingston upon Hull, City of" => "E06000010", "Kingston upon Hull, City of" => "E06000010",
"Kingston upon Thames" => "E09000021", "Kingston upon Thames" => "E09000021",
"Kirklees" => "E08000034", "Kirklees" => "E08000034",
@ -769,7 +769,7 @@ module Constants::CaseLog
"Islington" => "E09000019", "Islington" => "E09000019",
"Kensington and Chelsea" => "E09000020", "Kensington and Chelsea" => "E09000020",
"Kettering" => "E07000153", "Kettering" => "E07000153",
"King's Lynn and West Norfolk" => "E07000146", "Kings Lynn and West Norfolk" => "E07000146",
"Kingston upon Hull, City of" => "E06000010", "Kingston upon Hull, City of" => "E06000010",
"Kingston upon Thames" => "E09000021", "Kingston upon Thames" => "E09000021",
"Kirklees" => "E08000034", "Kirklees" => "E08000034",

6
app/views/case_logs/edit.html.erb

@ -1,6 +1,8 @@
<% content_for :title, "Log #{@case_log.id}" %> <% content_for :title, "Log #{@case_log.id}" %>
<% breadcrumbs = { "Logs" => "/logs", content_for(:title) => "" } %> <% content_for :breadcrumbs, govuk_breadcrumbs(breadcrumbs: {
<% content_for :breadcrumbs, govuk_breadcrumbs(breadcrumbs: breadcrumbs) %> "Logs" => "/logs",
content_for(:title) => ""
}) %>
<%= turbo_frame_tag "case_log_form", target: "_top" do %> <%= turbo_frame_tag "case_log_form", target: "_top" do %>
<div class="govuk-grid-row"> <div class="govuk-grid-row">

2
app/views/form/_check_answers_table.html.erb

@ -1,7 +1,7 @@
<div class="govuk-summary-list__row"> <div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key"> <dt class="govuk-summary-list__key">
<%= question.check_answer_label.to_s.present? ? question.check_answer_label.to_s : question.header.to_s %> <%= question.check_answer_label.to_s.present? ? question.check_answer_label.to_s : question.header.to_s %>
<dt> </dt>
<dd class="govuk-summary-list__value"> <dd class="govuk-summary-list__value">
<%= get_answer_label(question, @case_log) %><br/> <%= get_answer_label(question, @case_log) %><br/>
<% question.get_inferred_answers(@case_log).each do |inferred_answer| %> <% question.get_inferred_answers(@case_log).each do |inferred_answer| %>

7
app/views/form/check_answers.html.erb

@ -1,6 +1,9 @@
<% content_for :title, "#{subsection.id.humanize} - Check your answers" %> <% content_for :title, "#{subsection.id.humanize} - Check your answers" %>
<% breadcrumbs = { "Logs" => "/logs", "Log" => "/logs/" + @case_log.id.to_s, subsection.label => "" } %> <% content_for :breadcrumbs, govuk_breadcrumbs(breadcrumbs: {
<% content_for :breadcrumbs, govuk_breadcrumbs(breadcrumbs: breadcrumbs) %> "Logs" => "/logs",
"Log #{@case_log.id.to_s}" => "/logs/" + @case_log.id.to_s,
subsection.label => ""
}) %>
<%= turbo_frame_tag "case_log_form", target: "_top" do %> <%= turbo_frame_tag "case_log_form", target: "_top" do %>
<div class="govuk-grid-row"> <div class="govuk-grid-row">

2
app/views/form/guidance/_what_counts_as_income.html.erb

@ -1,5 +1,5 @@
<%= govuk_details(summary_text: 'What counts as income?') do %> <%= govuk_details(summary_text: 'What counts as income?') do %>
<p class="govuk-body">You should include any income from:</p> <p class="govuk-body">You should include any income after tax from:</p>
<ul class="govuk-list govuk-list--bullet"> <ul class="govuk-list govuk-list--bullet">
<li>employment</li> <li>employment</li>
<li>pensions</li> <li>pensions</li>

13
config/forms/2021_2022.json

@ -873,8 +873,8 @@
"28": "Death of household member in last settled accomodation", "28": "Death of household member in last settled accomodation",
"29": "Discharged from prison", "29": "Discharged from prison",
"30": "Discharged from long stay hospital or similar institution", "30": "Discharged from long stay hospital or similar institution",
"divider": true,
"31": "Other", "31": "Other",
"divider": true,
"32": "Don’t know", "32": "Don’t know",
"33": "Prefer not to say" "33": "Prefer not to say"
}, },
@ -1188,7 +1188,7 @@
}, },
"property_postcode": { "property_postcode": {
"check_answer_label": "Postcode", "check_answer_label": "Postcode",
"header": "What is the property's postcode?", "header": "What is the propertys postcode?",
"hint_text": "", "hint_text": "",
"type": "text", "type": "text",
"width": 5, "width": 5,
@ -1370,7 +1370,7 @@
"E09000019": "Islington", "E09000019": "Islington",
"E09000020": "Kensington and Chelsea", "E09000020": "Kensington and Chelsea",
"E07000153": "Kettering", "E07000153": "Kettering",
"E07000146": "King's Lynn and West Norfolk", "E07000146": "Kings Lynn and West Norfolk",
"E06000010": "Kingston upon Hull, City of", "E06000010": "Kingston upon Hull, City of",
"E09000021": "Kingston upon Thames", "E09000021": "Kingston upon Thames",
"E08000034": "Kirklees", "E08000034": "Kirklees",
@ -1709,7 +1709,6 @@
"4": "Shared flat or maisonette", "4": "Shared flat or maisonette",
"5": "Shared house", "5": "Shared house",
"6": "Shared bungalow", "6": "Shared bungalow",
"divider": true,
"7": "Other" "7": "Other"
} }
} }
@ -1951,8 +1950,8 @@
"type": "radio", "type": "radio",
"answer_options": { "answer_options": {
"0": "Housing benefit", "0": "Housing benefit",
"1": "Universal Credit with housing element (excluding housing benefit)",
"2": "Housing benefit and Universal Credit (without housing element)", "2": "Housing benefit and Universal Credit (without housing element)",
"1": "Universal Credit with housing element (excluding housing benefit)",
"3": "Universal Credit (without housing element)", "3": "Universal Credit (without housing element)",
"4": "None", "4": "None",
"divider": true, "divider": true,
@ -1968,7 +1967,7 @@
"questions": { "questions": {
"benefits": { "benefits": {
"check_answer_label": "Household income from Universal credit, state pension or benefits", "check_answer_label": "Household income from Universal credit, state pension or benefits",
"header": "How much of the household's income is from Universal Credit, state pensions or benefits?", "header": "How much of the households income is from Universal Credit, state pensions or benefits?",
"hint_text": "This excludes child and housing benefit, council tax support and tax credits.", "hint_text": "This excludes child and housing benefit, council tax support and tax credits.",
"type": "radio", "type": "radio",
"answer_options": { "answer_options": {
@ -2949,7 +2948,7 @@
"E09000019": "Islington", "E09000019": "Islington",
"E09000020": "Kensington and Chelsea", "E09000020": "Kensington and Chelsea",
"E07000153": "Kettering", "E07000153": "Kettering",
"E07000146": "King's Lynn and West Norfolk", "E07000146": "Kings Lynn and West Norfolk",
"E06000010": "Kingston upon Hull, City of", "E06000010": "Kingston upon Hull, City of",
"E09000021": "Kingston upon Thames", "E09000021": "Kingston upon Thames",
"E08000034": "Kirklees", "E08000034": "Kirklees",

12
config/locales/en.yml

@ -64,8 +64,8 @@ en:
benefits: benefits:
part_or_full_time: "income is from Universal Credit, state pensions or benefits cannot be All if the tenant or the partner works part or full time" part_or_full_time: "income is from Universal Credit, state pensions or benefits cannot be All if the tenant or the partner works part or full time"
earnings: earnings:
under_hard_max: "Net income cannot be greater than %{hard_max} given the tenant's working situation" under_hard_max: "Net income cannot be greater than %{hard_max} given the tenants working situation"
over_hard_min: "Net income cannot be less than %{hard_min} given the tenant's working situation" over_hard_min: "Net income cannot be less than %{hard_min} given the tenants working situation"
household: household:
reasonpref: reasonpref:
@ -92,7 +92,7 @@ en:
child_under_16: "Tenant %{person_num} economic status must be Child under 16 if their age is under 16" child_under_16: "Tenant %{person_num} economic status must be Child under 16 if their age is under 16"
student_16_19: "If age is between 16 and 19 - tenant %{person_num} must be a full time student or prefer not to say." student_16_19: "If age is between 16 and 19 - tenant %{person_num} must be a full time student or prefer not to say."
relat: relat:
child_under_16: "Tenant %{person_num}'s relationship to tenant 1 must be Child if their age is under 16" child_under_16: "Tenant %{person_num}s relationship to tenant 1 must be Child if their age is under 16"
one_partner: "Number of partners cannot be greater than 1" one_partner: "Number of partners cannot be greater than 1"
housingneeds_a: housingneeds_a:
one_or_two_choices: "Only one box must be ticked or 'other disabilities' plus one of mobility disabilities" one_or_two_choices: "Only one box must be ticked or 'other disabilities' plus one of mobility disabilities"
@ -109,8 +109,8 @@ en:
soft_validations: soft_validations:
net_income: net_income:
hint_text: "This is based on the tenant's work situation: %{ecstat1}" hint_text: "This is based on the tenants work situation: %{ecstat1}"
in_soft_min_range: in_soft_min_range:
message: "Net income is lower than expected based on the main tenant's working situation. Are you sure this is correct?" message: "Net income is lower than expected based on the main tenants working situation. Are you sure this is correct?"
in_soft_max_range: in_soft_max_range:
message: "Net income is higher than expected based on the main tenant's working situation. Are you sure this is correct?" message: "Net income is higher than expected based on the main tenants working situation. Are you sure this is correct?"

2
spec/features/form/check_answers_page_spec.rb

@ -44,7 +44,7 @@ RSpec.describe "Form Check Answers Page" do
it "has question headings based on the subsection" do it "has question headings based on the subsection" do
visit("/logs/#{id}/#{subsection}/check-answers") visit("/logs/#{id}/#{subsection}/check-answers")
question_labels = ["Tenant code", "Tenant's age", "Tenant's gender", "Number of Other Household Members"] question_labels = ["Tenant code", "Tenants age", "Tenants gender", "Number of Other Household Members"]
question_labels.each do |label| question_labels.each do |label|
expect(page).to have_content(label) expect(page).to have_content(label)
end end

24
spec/fixtures/forms/2021_2022.json vendored

@ -20,8 +20,8 @@
"person_1_age": { "person_1_age": {
"questions": { "questions": {
"age1": { "age1": {
"check_answer_label": "Tenant's age", "check_answer_label": "Tenants age",
"header": "What is the tenant's age?", "header": "What is the tenants age?",
"type": "numeric", "type": "numeric",
"min": 0, "min": 0,
"max": 150, "max": 150,
@ -33,8 +33,8 @@
"person_1_gender": { "person_1_gender": {
"questions": { "questions": {
"sex1": { "sex1": {
"check_answer_label": "Tenant's gender", "check_answer_label": "Tenants gender",
"header": "Which of these best describes the tenant's gender identity?", "header": "Which of these best describes the tenants gender identity?",
"type": "radio", "type": "radio",
"answer_options": { "answer_options": {
"0": "Female", "0": "Female",
@ -64,8 +64,8 @@
} }
}, },
"relat2": { "relat2": {
"check_answer_label": "Person 2's relationship to lead tenant", "check_answer_label": "Person 2s relationship to lead tenant",
"header": "What's person 2's relationship to lead tenant", "header": "What’s person 2’s relationship to lead tenant",
"type": "radio", "type": "radio",
"answer_options": { "answer_options": {
"0": "Other", "0": "Other",
@ -73,8 +73,8 @@
} }
}, },
"age2": { "age2": {
"check_answer_label": "Person 2's age", "check_answer_label": "Person 2s age",
"header": "What's person 2's age", "header": "What’s person 2’s age",
"type": "numeric", "type": "numeric",
"min": 0, "min": 0,
"max": 150, "max": 150,
@ -82,8 +82,8 @@
"width": 2 "width": 2
}, },
"sex2": { "sex2": {
"check_answer_label": "Person 2's gender", "check_answer_label": "Person 2s gender",
"header": "Which of these best describes person 2's gender identity?", "header": "Which of these best describes person 2s gender identity?",
"type": "radio", "type": "radio",
"answer_options": { "answer_options": {
"0": "Female", "0": "Female",
@ -93,8 +93,8 @@
} }
}, },
"ecstat2": { "ecstat2": {
"check_answer_label": "Person 2's Work", "check_answer_label": "Person 2s Work",
"header": "Which of these best describes person 2's working situation?", "header": "Which of these best describes person 2s working situation?",
"type": "radio", "type": "radio",
"answer_options": { "answer_options": {
"0": "Other", "0": "Other",

4
spec/fixtures/forms/test_validator.json vendored

@ -29,8 +29,8 @@
"description": "", "description": "",
"questions": { "questions": {
"person_1_age": { "person_1_age": {
"check_answer_label": "Tenant's age", "check_answer_label": "Tenants age",
"header": "What is the tenant's age?", "header": "What is the tenants age?",
"hint_text": "", "hint_text": "",
"type": "numeric", "type": "numeric",
"min": 0, "min": 0,

Loading…
Cancel
Save