From 7d9cd145de240e7a9c0bb140831c9ddafd205990 Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Tue, 11 Jan 2022 14:17:49 +0000 Subject: [PATCH 1/5] Add spellcheck false to email inputs --- app/views/devise/confirmations/new.html.erb | 1 + app/views/devise/passwords/new.html.erb | 3 ++- app/views/devise/sessions/new.html.erb | 3 ++- app/views/devise/unlocks/new.html.erb | 3 ++- app/views/users/edit.html.erb | 3 ++- app/views/users/new.html.erb | 1 + 6 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb index 8fec1b4ff..ac0537c68 100644 --- a/app/views/devise/confirmations/new.html.erb +++ b/app/views/devise/confirmations/new.html.erb @@ -6,6 +6,7 @@ <%= f.govuk_email_field :email, label: { text: "Email address" }, autocomplete: "email", + spellcheck: "false", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %> diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb index 6f5055ae0..bd0ae816b 100644 --- a/app/views/devise/passwords/new.html.erb +++ b/app/views/devise/passwords/new.html.erb @@ -21,7 +21,8 @@ <%= f.govuk_email_field :email, label: { text: "Email address" }, - autocomplete: "email" + autocomplete: "email", + spellcheck: "false" %> <%= f.govuk_submit "Send email" %> diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index edfe427a0..fab47b4a1 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -12,7 +12,8 @@ <%= f.govuk_email_field :email, label: { text: "Email address" }, - autocomplete: "email" + autocomplete: "email", + spellcheck: "false" %> <%= f.govuk_password_field :password, diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb index 2454c692a..c20182b23 100644 --- a/app/views/devise/unlocks/new.html.erb +++ b/app/views/devise/unlocks/new.html.erb @@ -5,7 +5,8 @@ <%= f.govuk_email_field :email, label: { text: "Email address" }, - autocomplete: "email" + autocomplete: "email", + spellcheck: "false" %> <%= f.govuk_submit "Resend unlock instructions" %> diff --git a/app/views/users/edit.html.erb b/app/views/users/edit.html.erb index f355ba993..9d30a0fe8 100644 --- a/app/views/users/edit.html.erb +++ b/app/views/users/edit.html.erb @@ -22,7 +22,8 @@ <%= f.govuk_email_field :email, label: { text: "Email address" }, - autocomplete: "email" + autocomplete: "email", + spellcheck: "false" %> <%= f.govuk_submit "Save changes" %> diff --git a/app/views/users/new.html.erb b/app/views/users/new.html.erb index 3d48e68f6..3ce6c9e06 100644 --- a/app/views/users/new.html.erb +++ b/app/views/users/new.html.erb @@ -23,6 +23,7 @@ <%= f.govuk_email_field :email, label: { text: "Email address" }, autocomplete: "email", + spellcheck: "false", value: @resource.email %> From fdabb3b5ad5258c064ceae0b5fb97e3f70bd60d0 Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Tue, 11 Jan 2022 16:45:01 +0000 Subject: [PATCH 2/5] Always say lettings before sales --- app/views/start/index.html.erb | 2 +- config/forms/2021_2022.json | 8 ++++---- spec/fixtures/forms/2022_2023.json | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/views/start/index.html.erb b/app/views/start/index.html.erb index 7ba5625fa..d223bfca1 100644 --- a/app/views/start/index.html.erb +++ b/app/views/start/index.html.erb @@ -5,7 +5,7 @@

Use this service to submit social housing lettings and sales data to the Department for Levelling Up, Housing and Communities (DLUHC).

-

We’ll ask you questions about a sale or letting, like details about the household or property. Your answers will create a log that you can submit directly to us.

+

We’ll ask you questions about a letting or sale, like details about the household or property. Your answers will create a log that you can submit directly to us.

Your organisation can also:

  • upload data for multiple sales and lettings
  • diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index ab28d23e9..b63ab92a5 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -65,13 +65,13 @@ "description": "", "questions": { "sale_or_letting": { - "check_answer_label": "Sale or letting", - "header": "Is this a sale or a letting?", + "check_answer_label": "Letting or sale", + "header": "Is this a letting or sale?", "hint_text": "", "type": "radio", "answer_options": { - "0": "Sale", - "1": "Letting" + "1": "Letting", + "0": "Sale" } } }, diff --git a/spec/fixtures/forms/2022_2023.json b/spec/fixtures/forms/2022_2023.json index c666dc37a..fc0ba89f1 100644 --- a/spec/fixtures/forms/2022_2023.json +++ b/spec/fixtures/forms/2022_2023.json @@ -36,13 +36,13 @@ "description": "", "questions": { "sale_or_letting": { - "check_answer_label": "Sale or letting", - "header": "Is this a sale or a letting?", + "check_answer_label": "Letting or sale", + "header": "Is this a letting or sale?", "hint_text": "", "type": "radio", "answer_options": { - "0": "Sale", - "1": "Letting" + "1": "Letting", + "0": "Sale" } } }, From 84cf4aad30d30d78311c1c6e0f92017ed4ecb196 Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Tue, 11 Jan 2022 16:47:17 +0000 Subject: [PATCH 3/5] Remove incorrect link on start page, use blank link for now --- app/views/start/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/start/index.html.erb b/app/views/start/index.html.erb index d223bfca1..80f2ee3d5 100644 --- a/app/views/start/index.html.erb +++ b/app/views/start/index.html.erb @@ -11,7 +11,7 @@
  • upload data for multiple sales and lettings
  • transfer data using an API
  • <%# TODO: Add link to lettings log form %> -
  • <%= govuk_link_to("download a copy of the 2021 to 2022 lettings log as a PDF", "https://digital.dclg.gov.uk/jira/servicedesk/customer/portal/4/group/21") %> (2MB)
  • +
  • <%= govuk_link_to("download a copy of the 2021 to 2022 lettings log as a PDF", "#") %> (2MB)

The data will be used to update the national record for social housing. It will also help to inform policy about the cost of social housing and what type of housing needs to be built.

This service is only for social housing in England.

From 3c79cf4100554b88b9dd2d09ab1817fe2f70cc4e Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Tue, 11 Jan 2022 16:57:24 +0000 Subject: [PATCH 4/5] =?UTF-8?q?Don=E2=80=99t=20uses=20slashes=20or=20abbre?= =?UTF-8?q?viations=20in=20questions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/constants/case_log.rb | 10 +++++----- app/models/validations/household_validations.rb | 6 +++--- config/forms/2021_2022.json | 12 ++++++------ docs/api/DLUHC-CORE-Data.v1.json | 10 +++++----- spec/features/form/conditional_questions_spec.rb | 4 ++-- spec/fixtures/complete_case_log.json | 6 +++--- spec/fixtures/forms/2021_2022.json | 8 ++++---- spec/models/case_log_spec.rb | 6 +++--- 8 files changed, 31 insertions(+), 31 deletions(-) diff --git a/app/models/constants/case_log.rb b/app/models/constants/case_log.rb index 8d3393ef3..36b2d8cdb 100644 --- a/app/models/constants/case_log.rb +++ b/app/models/constants/case_log.rb @@ -35,9 +35,9 @@ module Constants::CaseLog }.freeze ETHNIC = { - "White: English/Scottish/Welsh/Northern Irish/British" => 1, + "White: English, Welsh, Scottish, Northern Irish or British" => 1, "White: Irish" => 2, - "White: Gypsy/Irish Traveller" => 18, + "White: Gypsy or Irish Traveller" => 18, "White: Other" => 3, "Mixed: White and Black Caribbean" => 4, "Mixed: White and Black African" => 5, @@ -77,7 +77,7 @@ module Constants::CaseLog NATIONAL = { "UK national resident in UK" => 1, - "A current or former reserve in the UK Armed Forces (exc. National Service)" => 100, + "A current or former reserve in the UK Armed Forces (excluding National Service)" => 100, "UK national returning from residence overseas" => 2, "Czech Republic" => 3, "Estonia" => 4, @@ -981,10 +981,10 @@ module Constants::CaseLog }.freeze ARMED_FORCES = { - "A current or former regular in the UK Armed Forces (exc. National Service)" => 1, + "A current or former regular in the UK Armed Forces (excluding National Service)" => 1, "No" => 2, "Tenant prefers not to say" => 3, - "A current or former reserve in the UK Armed Forces (exc. National Service)" => 4, + "A current or former reserve in the UK Armed Forces (excluding National Service)" => 4, "A spouse / civil partner of a UK Armed Forces member who has separated or been bereaved within the last 2 years" => 5, }.freeze diff --git a/app/models/validations/household_validations.rb b/app/models/validations/household_validations.rb index 8937934ec..4ff7fff56 100644 --- a/app/models/validations/household_validations.rb +++ b/app/models/validations/household_validations.rb @@ -26,7 +26,7 @@ module Validations::HouseholdValidations end def validate_armed_forces_injured(record) - if (record.armedforces == "A current or former regular in the UK Armed Forces (exc. National Service)" || record.armedforces == "A current or former reserve in the UK Armed Forces (exc. National Service)") && record.reservist.blank? + if (record.armedforces == "A current or former regular in the UK Armed Forces (excluding National Service)" || record.armedforces == "A current or former reserve in the UK Armed Forces (excluding National Service)") && record.reservist.blank? record.errors.add :reservist, "You must answer the armed forces injury question if the tenant has served in the armed forces" end @@ -36,11 +36,11 @@ module Validations::HouseholdValidations end def validate_armed_forces_active_response(record) - if record.armedforces == "A current or former regular in the UK Armed Forces (exc. National Service)" && record.leftreg.blank? + if record.armedforces == "A current or former regular in the UK Armed Forces (excluding National Service)" && record.leftreg.blank? record.errors.add :leftreg, "You must answer the armed forces active question if the tenant has served as a regular in the armed forces" end - if record.armedforces != "A current or former regular in the UK Armed Forces (exc. National Service)" && record.leftreg.present? + if record.armedforces != "A current or former regular in the UK Armed Forces (excluding National Service)" && record.leftreg.present? record.errors.add :leftreg, "You must not answer the armed forces active question if the tenant has not served as a regular in the armed forces" end end diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index b63ab92a5..f529b68a1 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -276,9 +276,9 @@ "hint_text": "", "type": "radio", "answer_options": { - "0": "White: English/Scottish/Welsh/Northern Irish/British", + "0": "White: English, Welsh, Scottish, Northern Irish or British", "1": "White: Irish", - "2": "White: Gypsy/Irish Traveller", + "2": "White: Gypsy or Irish Traveller", "3": "White: Other", "4": "Mixed: White and Black Caribbean", "5": "Mixed: White and Black African", @@ -919,18 +919,18 @@ "type": "radio", "check_answer_label": "Armed Forces", "answer_options": { - "0": "A current or former regular in the UK Armed Forces (exc. National Service)", - "1": "A current or former reserve in the UK Armed Forces (exc. National Service)", + "0": "A current or former regular in the UK Armed Forces (excluding National Service)", + "1": "A current or former reserve in the UK Armed Forces (excluding National Service)", "2": "A spouse / civil partner of a UK Armed Forces member who has separated or been bereaved within the last 2 years", "3": "No", "4": "Tenant prefers not to say" }, "conditional_for": { "leftreg": [ - "A current or former regular in the UK Armed Forces (exc. National Service)" + "A current or former regular in the UK Armed Forces (excluding National Service)" ], "reservist": [ - "A current or former regular in the UK Armed Forces (exc. National Service)" + "A current or former regular in the UK Armed Forces (excluding National Service)" ] } }, diff --git a/docs/api/DLUHC-CORE-Data.v1.json b/docs/api/DLUHC-CORE-Data.v1.json index 37b6a9a22..298d7ac1e 100644 --- a/docs/api/DLUHC-CORE-Data.v1.json +++ b/docs/api/DLUHC-CORE-Data.v1.json @@ -258,10 +258,10 @@ "tenant_code": "T657", "age1": 35, "sex1": "Female", - "ethnic": "White: English/Scottish/Welsh/Northern Irish/British", + "ethnic": "White: English, Welsh, Scottish, Northern Irish or British", "national": "UK national resident in UK", "prevten": "Private sector tenancy", - "armedforces": "A current or former regular in the UK Armed Forces (exc. National Service)", + "armedforces": "A current or former regular in the UK Armed Forces (excluding National Service)", "ecstat1": "Full-time - 30 hours or more", "other_hhmemb": 7, "relat2": "Partner", @@ -389,9 +389,9 @@ "type": "string", "minLength": 1, "enum": [ - "White: English/Scottish/Welsh/Northern Irish/British", + "White: English, Welsh, Scottish, Northern Irish or British", "White: Irish", - "White: Gypsy/Irish Traveller", + "White: Gypsy or Irish Traveller", "White: Other", "Mixed: White and Black Caribbean", "Mixed: White and Black African", @@ -415,7 +415,7 @@ "minLength": 1, "enum": [ "UK national resident in UK", - "A current or former reserve in the UK Armed Forces (exc. National Service)", + "A current or former reserve in the UK Armed Forces (excluding National Service)", "UK national returning from residence overseas", "Czech Republic", "Estonia", diff --git a/spec/features/form/conditional_questions_spec.rb b/spec/features/form/conditional_questions_spec.rb index 357b0414d..96ed1e3c3 100644 --- a/spec/features/form/conditional_questions_spec.rb +++ b/spec/features/form/conditional_questions_spec.rb @@ -29,13 +29,13 @@ RSpec.describe "Form Conditional Questions" do it "shows conditional questions if the required answer is selected and hides it again when a different answer option is selected", js: true do visit("/logs/#{id}/armed-forces") # Something about our styling makes the selenium webdriver think the actual radio buttons are not visible so we allow label click here - choose("case-log-armedforces-a-current-or-former-regular-in-the-uk-armed-forces-exc-national-service-field", allow_label_click: true) + choose("case-log-armedforces-a-current-or-former-regular-in-the-uk-armed-forces-excluding-national-service-field", allow_label_click: true) expect(page).to have_selector("#reservist_div") choose("case-log-reservist-no-field", allow_label_click: true) expect(page).to have_checked_field("case-log-reservist-no-field", visible: false) choose("case-log-armedforces-no-field", allow_label_click: true) expect(page).not_to have_selector("#reservist_div") - choose("case-log-armedforces-a-current-or-former-regular-in-the-uk-armed-forces-exc-national-service-field", allow_label_click: true) + choose("case-log-armedforces-a-current-or-former-regular-in-the-uk-armed-forces-excluding-national-service-field", allow_label_click: true) expect(page).to have_unchecked_field("case-log-reservist-no-field", visible: false) end end diff --git a/spec/fixtures/complete_case_log.json b/spec/fixtures/complete_case_log.json index 1ed4d5206..534add5b3 100644 --- a/spec/fixtures/complete_case_log.json +++ b/spec/fixtures/complete_case_log.json @@ -3,11 +3,11 @@ "tenant_code": "T657", "age1": 35, "sex1": "Female", - "ethnic": "White: English/Scottish/Welsh/Northern Irish/British", + "ethnic": "White: English, Welsh, Scottish, Northern Irish or British", "national": "UK national resident in UK", "prevten": "Private sector tenancy", - "armedforces": "A current or former regular in the UK Armed Forces (exc. National Service)", - "armed_forces": "A current or former regular in the UK Armed Forces (exc. National Service)", + "armedforces": "A current or former regular in the UK Armed Forces (excluding National Service)", + "armed_forces": "A current or former regular in the UK Armed Forces (excluding National Service)", "armed_forces_partner": "", "ecstat1": "Full-time - 30 hours or more", "other_hhmemb": 7, diff --git a/spec/fixtures/forms/2021_2022.json b/spec/fixtures/forms/2021_2022.json index 230b195b2..7bcc5df4f 100644 --- a/spec/fixtures/forms/2021_2022.json +++ b/spec/fixtures/forms/2021_2022.json @@ -117,15 +117,15 @@ "type": "radio", "check_answer_label": "Armed Forces", "answer_options": { - "0":"A current or former regular in the UK Armed Forces (exc. National Service)", - "1":"A current or former reserve in the UK Armed Forces (exc. National Service)", + "0":"A current or former regular in the UK Armed Forces (excluding National Service)", + "1":"A current or former reserve in the UK Armed Forces (excluding National Service)", "2": "A spouse / civil partner of a UK Armed Forces member who has separated or been bereaved within the last 2 years", "3": "No", "4": "Tenant prefers not to say" }, "conditional_for": { - "leftreg": ["A current or former regular in the UK Armed Forces (exc. National Service)"], - "reservist": ["A current or former regular in the UK Armed Forces (exc. National Service)"] + "leftreg": ["A current or former regular in the UK Armed Forces (excluding National Service)"], + "reservist": ["A current or former regular in the UK Armed Forces (excluding National Service)"] } }, "leftreg": { diff --git a/spec/models/case_log_spec.rb b/spec/models/case_log_spec.rb index d0bb4c718..a2c7e17bc 100644 --- a/spec/models/case_log_spec.rb +++ b/spec/models/case_log_spec.rb @@ -185,7 +185,7 @@ RSpec.describe Form, type: :model do context "armed forces injured validation" do it "must be answered if tenant was a regular or reserve in armed forces" do expect { - CaseLog.create!(armedforces: "A current or former regular in the UK Armed Forces (exc. National Service)", + CaseLog.create!(armedforces: "A current or former regular in the UK Armed Forces (excluding National Service)", reservist: nil, owning_organisation: owning_organisation, managing_organisation: managing_organisation) @@ -507,7 +507,7 @@ RSpec.describe Form, type: :model do context "armed forces active validation" do it "must be answered if ever served in the forces as a regular" do expect { - CaseLog.create!(armedforces: "A current or former regular in the UK Armed Forces (exc. National Service)", + CaseLog.create!(armedforces: "A current or former regular in the UK Armed Forces (excluding National Service)", leftreg: nil, owning_organisation: owning_organisation, managing_organisation: managing_organisation) @@ -526,7 +526,7 @@ RSpec.describe Form, type: :model do # Crossover over tests here as injured must be answered as well for no error it "must be answered if ever served in the forces as a regular" do expect do - CaseLog.create!(armedforces: "A current or former regular in the UK Armed Forces (exc. National Service)", + CaseLog.create!(armedforces: "A current or former regular in the UK Armed Forces (excluding National Service)", leftreg: "Yes", reservist: "Yes", owning_organisation: owning_organisation, From 8d2af81f5cf4319322d0ffcd722d6a4a8043df2f Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Tue, 11 Jan 2022 17:01:45 +0000 Subject: [PATCH 5/5] Update service contact email address --- app/views/layouts/_footer.html.erb | 2 +- app/views/layouts/application.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb index 4a7b6a96d..442f25d60 100644 --- a/app/views/layouts/_footer.html.erb +++ b/app/views/layouts/_footer.html.erb @@ -16,7 +16,7 @@

Email

diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 9552a4cba..80b1cb6cd 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -54,7 +54,7 @@
<%= govuk_phase_banner( tag: { text: 'Beta' }, - text: "This is a new service – #{govuk_mail_to("test@mhclg.gov.uk", "give feedback or report a problem", subject: "Feedback about Lettings and Sales of Social Housing in England Data Collection")}".html_safe + text: "This is a new service – #{govuk_mail_to("submitcoredata@communities.gov.uk", "give feedback or report a problem", subject: "Feedback about #{t('service_name')}")}".html_safe ) %> <%= content_for(:breadcrumbs) %>