From 558a237e079243c99991c05997e1aab0375e7a43 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Fri, 1 Sep 2023 17:17:09 +0200 Subject: [PATCH] Add extra options for renewal reason (#1876) --- ...n_for_leaving_last_settled_home_renewal.rb | 5 ++++- .../form/lettings/questions/reason_renewal.rb | 17 ++++++++++++++ config/forms/2022_2023.json | 22 +++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/app/models/form/lettings/pages/reason_for_leaving_last_settled_home_renewal.rb b/app/models/form/lettings/pages/reason_for_leaving_last_settled_home_renewal.rb index ba025915f..acc8e7045 100644 --- a/app/models/form/lettings/pages/reason_for_leaving_last_settled_home_renewal.rb +++ b/app/models/form/lettings/pages/reason_for_leaving_last_settled_home_renewal.rb @@ -6,6 +6,9 @@ class Form::Lettings::Pages::ReasonForLeavingLastSettledHomeRenewal < ::Form::Pa end def questions - @questions ||= [Form::Lettings::Questions::ReasonRenewal.new(nil, nil, self)] + @questions ||= [ + Form::Lettings::Questions::ReasonRenewal.new(nil, nil, self), + Form::Lettings::Questions::Reasonother.new(nil, nil, self), + ] end end diff --git a/app/models/form/lettings/questions/reason_renewal.rb b/app/models/form/lettings/questions/reason_renewal.rb index 86aae9c39..0158eba63 100644 --- a/app/models/form/lettings/questions/reason_renewal.rb +++ b/app/models/form/lettings/questions/reason_renewal.rb @@ -9,10 +9,27 @@ class Form::Lettings::Questions::ReasonRenewal < ::Form::Question @hint_text = "You told us this letting is a renewal. We have removed some options because of this." @answer_options = ANSWER_OPTIONS @question_number = 77 + @conditional_for = { + "reasonother" => [ + 20, + ], + } end ANSWER_OPTIONS = { "40" => { "value" => "End of assured shorthold tenancy (no fault)" }, "42" => { "value" => "End of fixed term tenancy (no fault)" }, + "20" => { + "value" => "Other", + }, + "47" => { + "value" => "Tenant prefers not to say", + }, + "divider" => { + "value" => true, + }, + "28" => { + "value" => "Don’t know", + }, }.freeze end diff --git a/config/forms/2022_2023.json b/config/forms/2022_2023.json index f8eb4d4c5..db11b0950 100644 --- a/config/forms/2022_2023.json +++ b/config/forms/2022_2023.json @@ -6228,8 +6228,30 @@ }, "42": { "value": "End of fixed term tenancy (no fault)" + }, + "20": { + "value": "Other" + }, + "47": { + "value":"Tenant prefers not to say" + }, + "divider": { + "value": true + }, + "28": { + "value": "Don’t know" } + }, + "conditional_for": { + "reasonother": [ + 20 + ] } + }, + "reasonother": { + "header": "What is the reason?", + "hint_text": "", + "type": "text" } }, "depends_on": [