Browse Source

Add extra options for renewal reason (#1876)

pull/1884/head
kosiakkatrina 1 year ago committed by GitHub
parent
commit
558a237e07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      app/models/form/lettings/pages/reason_for_leaving_last_settled_home_renewal.rb
  2. 17
      app/models/form/lettings/questions/reason_renewal.rb
  3. 22
      config/forms/2022_2023.json

5
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

17
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

22
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": [

Loading…
Cancel
Save