From 033189f51ed9eec21037d218c0bbf9feb4615294 Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Fri, 7 Jan 2022 16:40:43 +0000 Subject: [PATCH] GDPR declined page content --- app/models/form/page.rb | 3 ++- app/views/form/page.html.erb | 8 +++++++- config/forms/2021_2022.json | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/models/form/page.rb b/app/models/form/page.rb index 2cdebff39..12b1065d6 100644 --- a/app/models/form/page.rb +++ b/app/models/form/page.rb @@ -1,6 +1,6 @@ class Form::Page attr_accessor :id, :header, :description, :questions, :soft_validations, - :depends_on, :subsection + :depends_on, :subsection, :hide_subsection_label def initialize(id, hsh, subsection) @id = id @@ -8,6 +8,7 @@ class Form::Page @description = hsh["description"] @questions = hsh["questions"].map { |q_id, q| Form::Question.new(q_id, q, self) } @depends_on = hsh["depends_on"] + @hide_subsection_label = hsh["hide_subsection_label"] @soft_validations = hsh["soft_validations"]&.map { |sv_id, s| Form::Question.new(sv_id, s, self) } @subsection = subsection end diff --git a/app/views/form/page.html.erb b/app/views/form/page.html.erb index 8385eaac7..360d56520 100644 --- a/app/views/form/page.html.erb +++ b/app/views/form/page.html.erb @@ -16,11 +16,17 @@
<% if @page.header.present? %>

- <%= @subsection.label %> + <% if !@page.hide_subsection_label %> + <%= @subsection.label %> + <% end %> <%= @page.header %>

<% end %> + <% if @page.description.present? %> +

<%= @page.description.html_safe %>

+ <% end %> + <%= form_with model: @case_log, url: form_case_log_path(@case_log), method: "post" do |f| %> <%= f.govuk_error_summary %> <% @page.questions.map do |question| %> diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index da5a0bb0e..f50480d15 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -26,9 +26,10 @@ } }, "gdpr_declined": { + "hide_subsection_label": true, "header": "You cannot use this service", "hint_text": "", - "description": "We cannot accept data about a tenant or buyer unless they’ve seen the DLUHC privacy notice.", + "description": "We cannot accept data about a tenant or buyer unless they’ve seen the DLUHC privacy notice.

Go to your logs", "questions": {}, "depends_on": { "gdpr_acceptance": "No" } },