Browse Source

feat: add link for privacy notice, refactor to separate tenant/buyer

pull/931/head
natdeanlewissoftwire 4 years ago
parent
commit
c4729c374b
  1. 5
      app/models/form/sales/pages/privacy_notice.rb
  2. 5
      app/models/form/sales/questions/privacy_notice.rb
  3. 1
      app/views/form/guidance/_privacy_notice_buyer.erb
  4. 0
      app/views/form/guidance/_privacy_notice_tenant.erb
  5. 2
      config/forms/2021_2022.json
  6. 2
      config/forms/2022_2023.json

5
app/models/form/sales/pages/privacy_notice.rb

@ -3,8 +3,11 @@ class Form::Sales::Pages::PrivacyNotice < ::Form::Page
super
@id = "privacy_notice"
@header = "Department for Levelling Up, Housing and Communities privacy notice"
@description = "Make sure that the buyer has seen the Department for Levelling Up, Housing and Communities (DLUHC) privacy notice before completing this log"
@description = ""
@subsection = subsection
@depends_on = [{
"noint" => 1,
}]
end
def questions

5
app/models/form/sales/questions/privacy_notice.rb

@ -4,14 +4,15 @@ class Form::Sales::Questions::PrivacyNotice < ::Form::Question
@id = "privacynotice"
@check_answer_label = "Buyer has seen the privacy notice?"
@header = "Declaration"
@guidance_partial = "test"
@type = "checkbox"
@hint_text = ""
@page = page
@answer_options = ANSWER_OPTIONS
@guidance_position = GuidancePosition::TOP
@guidance_partial = "privacy_notice_buyer"
end
ANSWER_OPTIONS = {
"privacynotice" => { "value" => "The tenant has seen the DLUHC privacy notice" },
"privacynotice" => { "value" => "The buyer has seen the DLUHC privacy notice" },
}.freeze
end

1
app/views/form/guidance/_privacy_notice_buyer.erb

@ -0,0 +1 @@
<p class="govuk-body">Make sure the buyer has seen <%= govuk_link_to "the Department for Levelling Up, Housing & Communities (DLUHC) privacy notice", privacy_notice_path %> before completing this log.</p>

0
app/views/form/guidance/_privacy_notice.erb → app/views/form/guidance/_privacy_notice_tenant.erb

2
config/forms/2021_2022.json

@ -1143,7 +1143,7 @@
"questions": {
"declaration": {
"header": "",
"guidance_partial": "privacy_notice",
"guidance_partial": "privacy_notice_tenant",
"check_answer_label": "Tenant has seen the privacy notice",
"check_answers_card_number": 0,
"type": "checkbox",

2
config/forms/2022_2023.json

@ -1178,7 +1178,7 @@
"questions": {
"declaration": {
"header": "",
"guidance_partial": "privacy_notice",
"guidance_partial": "privacy_notice_tenant",
"check_answer_label": "Tenant has seen the privacy notice",
"check_answers_card_number": 0,
"type": "checkbox",

Loading…
Cancel
Save