metadata_presenter 3.3.15 → 3.3.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 697e6b4f94a8e43973cc082259567e2967f2b4686e840174cfda308b378f5302
4
- data.tar.gz: e47e94bf27c2b86cc9e4677ed0dec9c0385c3adc9c92e0594938d3a8ae1de20a
3
+ metadata.gz: 6a56bfee298fe7e9138b1d60ee8c29af5685240ae893a665e6b920ca3ccdf9af
4
+ data.tar.gz: 62db49deaa88439f4c8e8efe962c6bf544de01b194351374444a487ec6580462
5
5
  SHA512:
6
- metadata.gz: 9a1f301247aa0891098f7d4cbab3a8a6de98b0bcf02187a4d51e214318f933acff699e910122690118dd1768fc7e6d1cbfd7e02732e8c53b4d338cf2445c205a
7
- data.tar.gz: 9801b62cd16f191fd5b239c4fd39ba1ce60bd8007c255cb309e1037840d35a4876feb2a0ebb2255d172ea37037811d066c3d40b03a02e9a89e2a4f1660880151
6
+ metadata.gz: 29bd9a966ac9a90033e9c75d33a508e59608bad99aba8966f1be17f20aa8f8cfcf38c68cc6d5ae5a5022a06a4c4fabfb57bf5cf614cb849e629ce2e588b60bee
7
+ data.tar.gz: 5da8149a431708bdff1b03317d9903b51815a1d1e505ce473a58d26b9c1f332b61d7e69005d11e21e7913fdf7cf2ccad409aeeb911b98691e8c1f4121ae4a31a
@@ -2,6 +2,8 @@ require 'govspeak'
2
2
 
3
3
  module MetadataPresenter
4
4
  module ApplicationHelper
5
+ OLD_BODY_DEFAULT_CONTENT = 'Body section'.freeze
6
+
5
7
  def main_title(component:, tag: :h1, classes: 'govuk-heading-xl')
6
8
  content_tag(tag, class: classes) do
7
9
  component.humanised_title
@@ -21,6 +23,15 @@ module MetadataPresenter
21
23
  MetadataPresenter::DefaultText[property]
22
24
  end
23
25
 
26
+ # we used to have some placeholder text in the body key, which was always replaced
27
+ # we since exposed the body key in an optional content area for certain pages, so forms created before that
28
+ # need to have their old default content ignored
29
+ def page_body_content
30
+ if @page.body
31
+ @page.body == OLD_BODY_DEFAULT_CONTENT ? '' : @page.body
32
+ end
33
+ end
34
+
24
35
  def default_title(component_type)
25
36
  MetadataPresenter::DefaultMetadata["component.#{component_type}"]&.[]('label') ||
26
37
  MetadataPresenter::DefaultMetadata["component.#{component_type}"]&.[]('legend')
@@ -3,8 +3,8 @@
3
3
  class="fb-editable"
4
4
  type="content"
5
5
  default-content="<%= default_text('body') %>"
6
- content="<%= @page.body %>"
6
+ content="<%= page_body_content %>"
7
7
  data-fb-content-id="<%= "page[body]" %>">
8
- <%= to_html(@page.body) %>
8
+ <%= to_html(page_body_content) %>
9
9
  </editable-content>
10
10
  <%- end %>
@@ -1,3 +1,3 @@
1
1
  module MetadataPresenter
2
- VERSION = '3.3.15'.freeze
2
+ VERSION = '3.3.16'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metadata_presenter
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.15
4
+ version: 3.3.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - MoJ Forms
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-14 00:00:00.000000000 Z
11
+ date: 2024-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_design_system_formbuilder