Browse Source
* Pluralise buyer in household characteristics/setup * Pluralise buyer in sales information sections * Pluralise buyer in savings * Pluralise other buyers, update privacy notice test * Pluralise buyer in validations and translations * Route to pages when joint purchase is not answered * Fix apostrophes * Update translations * More updatespull/2289/head
kosiakkatrina
11 months ago
committed by
GitHub
50 changed files with 353 additions and 127 deletions
@ -1,12 +1,20 @@
|
||||
class Form::Sales::Pages::BuyerInterview < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "buyer_interview" |
||||
def initialize(id, hsh, subsection, joint_purchase:) |
||||
super(id, hsh, subsection) |
||||
@joint_purchase = joint_purchase |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Sales::Questions::BuyerInterview.new(nil, nil, self), |
||||
Form::Sales::Questions::BuyerInterview.new(nil, nil, self, joint_purchase: @joint_purchase), |
||||
] |
||||
end |
||||
|
||||
def depends_on |
||||
if @joint_purchase |
||||
[{ "joint_purchase?" => true }] |
||||
else |
||||
[{ "not_joint_purchase?" => true }, { "jointpur" => nil }] |
||||
end |
||||
end |
||||
end |
||||
|
@ -1,13 +1,21 @@
|
||||
class Form::Sales::Pages::PrivacyNotice < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "privacy_notice" |
||||
def initialize(id, hsh, subsection, joint_purchase:) |
||||
super(id, hsh, subsection) |
||||
@header = "Department for Levelling Up, Housing and Communities privacy notice" |
||||
@joint_purchase = joint_purchase |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Sales::Questions::PrivacyNotice.new(nil, nil, self), |
||||
Form::Sales::Questions::PrivacyNotice.new(nil, nil, self, joint_purchase: @joint_purchase), |
||||
] |
||||
end |
||||
|
||||
def depends_on |
||||
if @joint_purchase |
||||
[{ "joint_purchase?" => true }] |
||||
else |
||||
[{ "not_joint_purchase?" => true }, { "jointpur" => nil }] |
||||
end |
||||
end |
||||
end |
||||
|
@ -1,13 +1,21 @@
|
||||
class Form::Sales::Pages::Savings < ::Form::Page |
||||
def initialize(id, hsh, subsection) |
||||
super |
||||
@id = "savings" |
||||
def initialize(id, hsh, subsection, joint_purchase:) |
||||
super(id, hsh, subsection) |
||||
@joint_purchase = joint_purchase |
||||
end |
||||
|
||||
def questions |
||||
@questions ||= [ |
||||
Form::Sales::Questions::SavingsNk.new(nil, nil, self), |
||||
Form::Sales::Questions::Savings.new(nil, nil, self), |
||||
Form::Sales::Questions::SavingsNk.new(nil, nil, self, joint_purchase: @joint_purchase), |
||||
Form::Sales::Questions::Savings.new(nil, nil, self, joint_purchase: @joint_purchase), |
||||
] |
||||
end |
||||
|
||||
def depends_on |
||||
if @joint_purchase |
||||
[{ "joint_purchase?" => true }] |
||||
else |
||||
[{ "not_joint_purchase?" => true }, { "jointpur" => nil }] |
||||
end |
||||
end |
||||
end |
||||
|
@ -1,21 +1,30 @@
|
||||
class Form::Sales::Questions::PrivacyNotice < ::Form::Question |
||||
def initialize(id, hsh, page) |
||||
super |
||||
def initialize(id, hsh, page, joint_purchase:) |
||||
super(id, hsh, page) |
||||
@id = "privacynotice" |
||||
@check_answer_label = "Buyer has seen the privacy notice?" |
||||
@check_answer_label = "#{joint_purchase ? 'Buyers have' : 'Buyer has'} seen the privacy notice?" |
||||
@header = "Declaration" |
||||
@type = "checkbox" |
||||
@top_guidance_partial = form.start_year_after_2024? ? "privacy_notice_buyer_2024" : "privacy_notice_buyer" |
||||
@question_number = 19 |
||||
@joint_purchase = joint_purchase |
||||
@top_guidance_partial = guidance |
||||
end |
||||
|
||||
def answer_options |
||||
declaration_text = if form.start_year_after_2024? |
||||
"The buyer has seen or been given access to the DLUHC privacy notice" |
||||
"The #{@joint_purchase ? 'buyers have' : 'buyer has'} seen or been given access to the DLUHC privacy notice" |
||||
else |
||||
"The buyer has seen the DLUHC privacy notice" |
||||
"The #{@joint_purchase ? 'buyers have' : 'buyer has'} seen the DLUHC privacy notice" |
||||
end |
||||
|
||||
{ "privacynotice" => { "value" => declaration_text } }.freeze |
||||
end |
||||
|
||||
def guidance |
||||
if form.start_year_after_2024? |
||||
@joint_purchase ? "privacy_notice_buyer_2024_joint_purchase" : "privacy_notice_buyer_2024" |
||||
else |
||||
@joint_purchase ? "privacy_notice_buyer_joint_purchase" : "privacy_notice_buyer" |
||||
end |
||||
end |
||||
end |
||||
|
@ -0,0 +1 @@
|
||||
<p class="govuk-body">Make sure the buyers have seen or been given access to <%= govuk_link_to "the Department for Levelling Up, Housing & Communities (DLUHC) privacy notice", privacy_notice_path, target: :_blank %> before completing this log. This is a legal requirement under data protection legislation.</p> |
@ -0,0 +1 @@
|
||||
<p class="govuk-body">Make sure the buyers have seen <%= govuk_link_to "the Department for Levelling Up, Housing & Communities (DLUHC) privacy notice", privacy_notice_path, target: :_blank %> before completing this log.</p> |
Loading…
Reference in new issue