Skip to content

Commit

Permalink
Merge pull request #398 from UKGovernmentBEIS/PC-1364-Loft-Insulation…
Browse files Browse the repository at this point in the history
…-Question

PC-1364: Loft insulation question
  • Loading branch information
Glenn-Clarke authored Nov 14, 2024
2 parents 80e62a4 + c2ac62e commit 17aee3c
Show file tree
Hide file tree
Showing 8 changed files with 147 additions and 117 deletions.
3 changes: 2 additions & 1 deletion help_to_heat/frontdoor/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@

loft_insulation_field = "loft_insulation"
loft_insulation_field_more_than_threshold = "I have more than 100mm of loft insulation"
loft_insulation_field_less_than_threshold = "I have up to 100mm of loft insulation"
loft_insulation_field_less_than_threshold = "I have less than or equal to 100mm of loft insulation"
loft_insulation_field_no_insulation = "I have no loft insulation"
loft_insulation_field_dont_know = field_dont_know
loft_insulation_field_no_loft = "No loft"

Expand Down
9 changes: 9 additions & 0 deletions help_to_heat/frontdoor/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
loft_field,
loft_field_no,
loft_insulation_field,
loft_insulation_field_less_than_threshold,
loft_insulation_field_no_insulation,
loft_insulation_field_no_loft,
park_home_main_residence_field,
property_subtype_field,
Expand Down Expand Up @@ -250,6 +252,13 @@ def create_referral(self, session_id):
given_answers[loft_access_field] = loft_access_field_no_loft
given_answers[loft_insulation_field] = loft_insulation_field_no_loft

# Users are given the option to select "no insulation" to improve question usability
# This and "below threshold" are functionally identical from the supplier point of view.
# They will be combined before the suppliers see it to improve supplier usability
loft_insulation = given_answers.get(loft_insulation_field)
if loft_insulation == given_answers.get(loft_insulation_field_no_insulation):
given_answers[loft_insulation_field] = loft_insulation_field_less_than_threshold

# ensure not found EPCs are displayed as such
# this will normally be set as an answer on pressing submit on 'address' page
# though this is not guaranteed, ie if user presses to enter manually
Expand Down
10 changes: 8 additions & 2 deletions help_to_heat/frontdoor/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
loft_insulation_field_dont_know,
loft_insulation_field_less_than_threshold,
loft_insulation_field_more_than_threshold,
loft_insulation_field_no_insulation,
loft_insulation_field_no_loft,
loft_insulation_page,
loft_page,
Expand Down Expand Up @@ -480,7 +481,8 @@
},
loft_insulation_field: {
loft_insulation_field_more_than_threshold: _("I have more than 100mm of loft insulation"),
loft_insulation_field_less_than_threshold: _("I have up to 100mm of loft insulation"),
loft_insulation_field_less_than_threshold: _("I have less than or equal to 100mm of loft insulation"),
loft_insulation_field_no_insulation: _("I have no loft insulation"),
loft_insulation_field_dont_know: _("I do not know"),
loft_insulation_field_no_loft: _("No loft"),
},
Expand Down Expand Up @@ -699,7 +701,11 @@
},
{
"value": loft_insulation_field_less_than_threshold,
"label": _("I have up to 100mm of loft insulation"),
"label": _("I have less than or equal to 100mm of loft insulation"),
},
{
"value": loft_insulation_field_no_insulation,
"label": _("I have no loft insulation"),
},
{
"value": loft_insulation_field_dont_know,
Expand Down
Binary file modified help_to_heat/locale/cy/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit 17aee3c

Please sign in to comment.