metadata_presenter 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8762e144cc7633a21b9a53fce23efe99d668c8cbb2dc3a705ddf31693134b0d4
4
- data.tar.gz: f46ae9f949c32cf959371050fefbd76e0f260ea6fcf803c29600dc5199534784
3
+ metadata.gz: e690363ac373962c0478469b6b501d6ecc255473d6bbd04aff6cf012aa098843
4
+ data.tar.gz: 907eced7e4a09a2b247130deb082ef5c05766dd3d995d18483c69d5dcb8babf7
5
5
  SHA512:
6
- metadata.gz: 78fde7cfe785f26a75ea4d9e268f4d2b274783e43bc195768733f347c15f3f107734efc4ed308d484056c0ae21fc916e1cab011b642cc450531777602e589234
7
- data.tar.gz: 3687a2de78313c5365c8807bfe34e88dd23739fa76302465ccbd594db7e64c0cf3d8c975a942b2058ca7d00e551310002d311884575b07c9f06126203e268a1d
6
+ metadata.gz: a061114f4db7608516af2da01234bedd45b11708c47c9f693ebffa0b13d7f1fe2814313ce79bfc4bf555b2db3526d63743193789297e1bf2f3d8a87ec6611a40
7
+ data.tar.gz: 78b39e5035fe137a52b83c2b3f6a42edcc72c2d921247a67f6958608acf2a5df8ba15795986e56f5d75e602c530a1d83005c30a89d51c0ce1362f2ce9984be91
@@ -37,7 +37,9 @@
37
37
 
38
38
  <div class="govuk-grid-row">
39
39
  <div class="govuk-grid-column-two-thirds">
40
+ <% unless @page.body == default_text('body') %>
40
41
  <%= render 'metadata_presenter/attribute/body' %>
42
+ <% end %>
41
43
 
42
44
  <%= render partial: 'metadata_presenter/component/components',
43
45
  locals: {
@@ -12,7 +12,10 @@
12
12
  </h1>
13
13
 
14
14
  <%= render 'metadata_presenter/attribute/lede' %>
15
- <%= render 'metadata_presenter/attribute/body' %>
15
+
16
+ <% unless @page.body == default_text('body') %>
17
+ <%= render 'metadata_presenter/attribute/body' %>
18
+ <% end %>
16
19
 
17
20
  <%= form_for @page_answers, as: :answers, url: @page.url, method: :post do |f| %>
18
21
 
@@ -4,7 +4,6 @@
4
4
  "section_heading": "",
5
5
  "heading": "Title",
6
6
  "lede": "",
7
- "body": "[Optional content]",
8
7
  "components": [],
9
8
  "url": ""
10
9
  }
@@ -1,3 +1,3 @@
1
1
  module MetadataPresenter
2
- VERSION = '3.1.0'.freeze
2
+ VERSION = '3.2.0'.freeze
3
3
  end
@@ -17,6 +17,35 @@
17
17
  "type": "string",
18
18
  "content": true,
19
19
  "multiline": true
20
+ },
21
+ "conditionals": {
22
+ "$ref": "#/definitions/conditionals"
23
+ }
24
+ },
25
+ "definitions": {
26
+ "conditionals": {
27
+ "type": "array",
28
+ "items": {
29
+ "type": "object",
30
+ "properties": {
31
+ "_uuid": {
32
+ "type": "string",
33
+ "title": "Unique identifier of the conditional",
34
+ "description": "Used internally in the editor and the runner"
35
+ },
36
+ "_type": {
37
+ "type": "string",
38
+ "enum": [
39
+ "if",
40
+ "and",
41
+ "or"
42
+ ]
43
+ },
44
+ "expressions": {
45
+ "$ref": "definition.expressions"
46
+ }
47
+ }
48
+ }
20
49
  }
21
50
  },
22
51
  "allOf": [
@@ -0,0 +1,36 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/expression_item",
3
+ "_name": "definition.expression_item",
4
+ "title": "Expression item",
5
+ "description": "Component that provides an expression item",
6
+ "type": "object",
7
+ "properties": {
8
+ "operator": {
9
+ "type": "string",
10
+ "enum": [
11
+ "is",
12
+ "is_not",
13
+ "is_answered",
14
+ "is_not_answered"
15
+ ],
16
+ "page": {
17
+ "type": "string"
18
+ },
19
+ "component": {
20
+ "type": "string"
21
+ },
22
+ "field": {
23
+ "type": "string"
24
+ }
25
+ }
26
+ },
27
+ "required": [
28
+ "operator",
29
+ "page",
30
+ "component",
31
+ "field"
32
+ ],
33
+ "category": [
34
+ "expression_item"
35
+ ]
36
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/expressions",
3
+ "_name": "definition.expressions",
4
+ "title": "Expressions",
5
+ "type": "array",
6
+ "items": {
7
+ "$ref": "definition.expression_item"
8
+ },
9
+ "required": [
10
+ "items"
11
+ ],
12
+ "category": [
13
+ "expression"
14
+ ]
15
+ }
@@ -48,33 +48,7 @@
48
48
  "type": "string"
49
49
  },
50
50
  "expressions": {
51
- "$ref": "#/definitions/expressions"
52
- }
53
- }
54
- }
55
- },
56
- "expressions": {
57
- "type": "array",
58
- "items": {
59
- "type": "object",
60
- "properties": {
61
- "operator": {
62
- "type": "string",
63
- "enum": [
64
- "is",
65
- "is_not",
66
- "is_answered",
67
- "is_not_answered"
68
- ],
69
- "page": {
70
- "type": "string"
71
- },
72
- "component": {
73
- "type": "string"
74
- },
75
- "field": {
76
- "type": "string"
77
- }
51
+ "$ref": "definition.expressions"
78
52
  }
79
53
  }
80
54
  }
@@ -14,9 +14,6 @@
14
14
  "heading": {
15
15
  "multiline": true
16
16
  },
17
- "body": {
18
- "multiline": true
19
- },
20
17
  "lede": {
21
18
  "multiline": true
22
19
  },
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.1.0
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - MoJ Forms
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-25 00:00:00.000000000 Z
11
+ date: 2023-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_design_system_formbuilder
@@ -580,6 +580,8 @@ files:
580
580
  - schemas/definition/conditions.exactly.json
581
581
  - schemas/definition/control.json
582
582
  - schemas/definition/data.json
583
+ - schemas/definition/expression_item.json
584
+ - schemas/definition/expressions.json
583
585
  - schemas/definition/field.json
584
586
  - schemas/definition/fieldset.json
585
587
  - schemas/definition/grouping.json