metadata_presenter 2.5.0 → 2.6.2

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: 5bd3891b62938a67dd025d49a96098778ad66221bf62cb2351002906e78aa4b4
4
- data.tar.gz: 9dba99d36da50beea7a209d27f3371e4e814776d86d609436ac500c6d91cbd14
3
+ metadata.gz: 750d53675c78f1be97f67ec398bfc9d4f5fd80581068b575f43d26a3cb2b8ba7
4
+ data.tar.gz: affc04ab6d093a925ebcf9f11f96f0c737f8022824f8ffabc841bf5f82d148b9
5
5
  SHA512:
6
- metadata.gz: c8c2dde3ca3e374e0f50eebc881a64fe676f4d6fa0156ab73e26e79e0c9a19292c4c21d55665171441c52af3c56a6472783365df050246ba7e583da89db112ce
7
- data.tar.gz: c114dddbf37af9e800c9eb6c4601d6f250175efd1b35f9159a728edb0c3239357f6f35b281bd1280792101d669885e6f48218ffdeca876edbfbf5af5f0f9051e
6
+ metadata.gz: 86df3d7555b5c767b645a6e0ea6b3b2a83057634caaa7e2cf0b9aaa9f9969193e53bdedfdf640d6ccc2d7df6fbdc12d94aa61bcd6ccdec476b87d2b4ccb6cf78
7
+ data.tar.gz: 74be1ca10758a70cfcfea48a47f9baedf55967d31d83aae66735fdf30f717ffba761967fa4b24619760053d02a8119845609e4605071f6f856659b325d479078
@@ -14,21 +14,21 @@ module MetadataPresenter
14
14
  ROW_ZERO = 0
15
15
 
16
16
  def build
17
+ return @ordered unless @ordered.empty?
18
+
17
19
  @ordered = make_grid
18
20
  add_columns
19
21
  add_rows
20
22
  add_by_coordinates
21
- trim_spacers
22
23
  insert_expression_spacers
24
+ trim_spacers
23
25
 
24
26
  @ordered
25
27
  end
26
28
 
27
29
  def ordered_flow
28
- @ordered_flow ||= begin
29
- flow = @ordered.empty? ? build.flatten : @ordered.flatten
30
- flow.reject { |obj| obj.is_a?(MetadataPresenter::Spacer) }
31
- end
30
+ @ordered_flow ||=
31
+ build.flatten.reject { |obj| obj.is_a?(MetadataPresenter::Spacer) }
32
32
  end
33
33
 
34
34
  def ordered_pages
@@ -18,6 +18,7 @@ module MetadataPresenter
18
18
  page.checkanswers
19
19
  page.confirmation
20
20
  page.multiplequestions
21
+ page.exit
21
22
  ].freeze
22
23
 
23
24
  def editable_attributes
@@ -0,0 +1,29 @@
1
+ <div class="fb-main-grid-wrapper" data-fb-pagetype="<%= @page.type %>">
2
+ <div class="govuk-grid-row">
3
+ <div class="govuk-grid-column-two-thirds">
4
+
5
+ <%= render 'metadata_presenter/attribute/section_heading' %>
6
+
7
+ <h1 class="fb-editable govuk-heading-xl"
8
+ data-fb-content-id="page[heading]"
9
+ data-fb-content-type="element">
10
+ <%= @page.heading %>
11
+ </h1>
12
+
13
+ <%= render 'metadata_presenter/attribute/lede' %>
14
+
15
+ <%= form_for @page_answers, as: :answers, url: @page.url, method: :post do |f| %>
16
+
17
+ <%= render partial: 'metadata_presenter/component/components',
18
+ locals: {
19
+ f: f,
20
+ components: @page.components,
21
+ tag: nil,
22
+ classes: nil,
23
+ input_components: @page.supported_input_components,
24
+ content_components: @page.supported_content_components
25
+ } %>
26
+ <% end %>
27
+ </div>
28
+ </div>
29
+ </div>
@@ -12,6 +12,10 @@ Rails.application.config.supported_components =
12
12
  input: %w(),
13
13
  content: %w(content)
14
14
  },
15
+ exit: {
16
+ input: %w(),
17
+ content: %w(content)
18
+ },
15
19
  multiplequestions: {
16
20
  input: %w(text textarea number date radios checkboxes),
17
21
  content: %w(content)
@@ -0,0 +1,9 @@
1
+ {
2
+ "_id": "page.exit",
3
+ "_type": "page.exit",
4
+ "section_heading": "",
5
+ "heading": "Title",
6
+ "lede": "",
7
+ "components": [],
8
+ "url": ""
9
+ }
@@ -148,7 +148,7 @@
148
148
  "body": "Start page body",
149
149
  "_type": "page.start",
150
150
  "_uuid": "cf6dc32f-502c-4215-8c27-1151a45735bb",
151
- "heading": "Branching Fixture 4",
151
+ "heading": "Branching Fixture 7",
152
152
  "before_you_start": "Start page before you start"
153
153
  },
154
154
  {
@@ -329,28 +329,20 @@
329
329
  {
330
330
  "_id": "page.g",
331
331
  "url": "page-g",
332
- "body": "Page G body",
333
- "lede": "",
334
- "_type": "page.singlequestion",
332
+ "lede": "lede",
333
+ "_type": "page.exit",
335
334
  "_uuid": "3a584d15-6805-4a21-bc05-b61c3be47857",
336
335
  "heading": "Page G",
337
336
  "components": [
338
337
  {
339
- "_id": "page-g_text_1",
340
- "hint": "",
341
- "name": "page-g_text_1",
342
- "_type": "text",
343
- "_uuid": "fa91e9cd-d935-4c15-bd92-5b6fafd81a91",
344
- "label": "Page G",
345
- "errors": {},
346
- "collection": "components",
347
- "validation": {
348
- "required": true,
349
- "max_length": 20,
350
- "min_length": 2
351
- }
338
+ "_id": "exit_content_1",
339
+ "name": "exit_content_1",
340
+ "_type": "content",
341
+ "_uuid": "9774d986-135a-4b7f-924d-7527b790e1a0",
342
+ "content": "This is an exit page"
352
343
  }
353
- ]
344
+ ],
345
+ "section_heading": "Section heading"
354
346
  },
355
347
  {
356
348
  "_id": "page.h",
@@ -559,7 +551,7 @@
559
551
  "created_by": "099d5bf5-5f7b-444c-86ee-9e189cc1a369",
560
552
  "service_id": "ea3bfb09-fc6d-4464-b025-9d6aadafc593",
561
553
  "version_id": "429a8039-75b3-42b8-84dc-230fb371c71d",
562
- "service_name": "Branching Fixture 4",
554
+ "service_name": "Branching Fixture 7",
563
555
  "configuration": {
564
556
  "meta": {
565
557
  "_id": "config.meta",
@@ -142,7 +142,7 @@
142
142
  "body": "Start page body",
143
143
  "_type": "page.start",
144
144
  "_uuid": "cf6dc32f-502c-4215-8c27-1151a45735bb",
145
- "heading": "Branching Fixture 4",
145
+ "heading": "Branching Fixture 8",
146
146
  "before_you_start": "Start page before you start"
147
147
  },
148
148
  {
@@ -497,7 +497,7 @@
497
497
  "created_by": "099d5bf5-5f7b-444c-86ee-9e189cc1a369",
498
498
  "service_id": "ea3bfb09-fc6d-4464-b025-9d6aadafc593",
499
499
  "version_id": "429a8039-75b3-42b8-84dc-230fb371c71d",
500
- "service_name": "Branching Fixture 4",
500
+ "service_name": "Branching Fixture 8",
501
501
  "configuration": {
502
502
  "meta": {
503
503
  "_id": "config.meta",
@@ -0,0 +1,134 @@
1
+ {
2
+ "_id": "service.base",
3
+ "_type": "service.base",
4
+ "service_id": "bf0d28cc-d3cf-4511-9589-b360ae34a908",
5
+ "service_name": "Exit only",
6
+ "created_by": "81de07c7-461a-4425-9a0f-9ba30294ddfb",
7
+ "configuration": {
8
+ "service": {
9
+ "_id": "config.service",
10
+ "_type": "config.service"
11
+ },
12
+ "meta": {
13
+ "_id": "config.meta",
14
+ "_type": "config.meta",
15
+ "items": [
16
+ {
17
+ "_id": "config.meta--link",
18
+ "_type": "link",
19
+ "href": "cookies",
20
+ "text": "Cookies"
21
+ },
22
+ {
23
+ "_id": "config.meta--link--2",
24
+ "_type": "link",
25
+ "href": "privacy",
26
+ "text": "Privacy"
27
+ },
28
+ {
29
+ "_id": "config.meta--link--3",
30
+ "_type": "link",
31
+ "href": "accessibility",
32
+ "text": "Accessibility"
33
+ }
34
+ ]
35
+ }
36
+ },
37
+ "flow": {
38
+ "82f5c5bb-a71c-425c-b29b-3fbac4ad0b87": {
39
+ "_type": "flow.page",
40
+ "next": {
41
+ "default": "db86a329-fa2d-4e36-8343-83bdf559cde0"
42
+ }
43
+ },
44
+ "db86a329-fa2d-4e36-8343-83bdf559cde0": {
45
+ "_type": "flow.page",
46
+ "next": {
47
+ "default": "ea36b7ab-9c05-4a19-8336-30936a681614"
48
+ }
49
+ },
50
+ "ea36b7ab-9c05-4a19-8336-30936a681614": {
51
+ "_type": "flow.page",
52
+ "next": {
53
+ "default": "905c3988-b803-4b01-bc38-e1d27cc6027c"
54
+ }
55
+ },
56
+ "905c3988-b803-4b01-bc38-e1d27cc6027c": {
57
+ "_type": "flow.page",
58
+ "next": {
59
+ "default": ""
60
+ }
61
+ }
62
+ },
63
+ "pages": [
64
+ {
65
+ "_id": "page.start",
66
+ "_type": "page.start",
67
+ "_uuid": "82f5c5bb-a71c-425c-b29b-3fbac4ad0b87",
68
+ "heading": "Service name goes here",
69
+ "lede": "This is your start page first paragraph. You can only have one paragraph here.",
70
+ "body": "Use this service to:\r\n\r\n* do something\r\n* update your name, address or other details\r\n* do something else\r\n\r\nRegistering takes around 5 minutes.",
71
+ "url": "/"
72
+ },
73
+ {
74
+ "_id": "page.knowhere",
75
+ "_type": "page.singlequestion",
76
+ "_uuid": "db86a329-fa2d-4e36-8343-83bdf559cde0",
77
+ "components": [
78
+ {
79
+ "_id": "page.knowhere--text.auto_knowhere__1",
80
+ "_type": "text",
81
+ "label": "Road to knowhere",
82
+ "name": "knowhere",
83
+ "validation": {
84
+ "required": true,
85
+ "max_length": 10,
86
+ "min_length": 2
87
+ }
88
+ }
89
+ ],
90
+ "heading": "Road to knowhere",
91
+ "url": "knowhere"
92
+ },
93
+ {
94
+ "_id": "page.ghost",
95
+ "_type": "page.singlequestion",
96
+ "_uuid": "ea36b7ab-9c05-4a19-8336-30936a681614",
97
+ "components": [
98
+ {
99
+ "_id": "page.ghost--text.auto_ghost__1",
100
+ "_type": "text",
101
+ "label": "Ghost town",
102
+ "name": "ghost",
103
+ "validation": {
104
+ "required": true,
105
+ "max_length": 100,
106
+ "min_length": 2
107
+ }
108
+ }
109
+ ],
110
+ "heading": "Ghost town",
111
+ "url": "ghost"
112
+ },
113
+ {
114
+ "_id": "page.goodbye",
115
+ "url": "page-goodbye",
116
+ "lede": "So long and thanks for all the fish",
117
+ "_type": "page.exit",
118
+ "_uuid": "905c3988-b803-4b01-bc38-e1d27cc6027c",
119
+ "heading": "Goodbye",
120
+ "components": [
121
+ {
122
+ "_id": "exit_content_1",
123
+ "name": "exit_content_1",
124
+ "_type": "content",
125
+ "_uuid": "3b9d2140-888c-4673-907d-5d885ea02143",
126
+ "content": "Goodbye!"
127
+ }
128
+ ],
129
+ "section_heading": "au revoir, auf wiedersehen"
130
+ }
131
+ ],
132
+ "standalone_pages": [],
133
+ "locale": "en"
134
+ }
@@ -1,3 +1,3 @@
1
1
  module MetadataPresenter
2
- VERSION = '2.5.0'.freeze
2
+ VERSION = '2.6.2'.freeze
3
3
  end
@@ -0,0 +1,25 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/page/exit",
3
+ "_name": "page.exit",
4
+ "title": "Exit",
5
+ "description": "Display an exit page to users when they cannot proceed",
6
+ "type": "object",
7
+ "properties": {
8
+ "_type": {
9
+ "const": "page.exit"
10
+ },
11
+ "components": {
12
+ "title": "Content",
13
+ "description": "The form or content elements used on the page",
14
+ "type": "array",
15
+ "items": {
16
+ "$ref": "component.content"
17
+ }
18
+ }
19
+ },
20
+ "allOf": [
21
+ {
22
+ "$ref": "definition.page.content"
23
+ }
24
+ ]
25
+ }
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: 2.5.0
4
+ version: 2.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - MoJ Forms
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-28 00:00:00.000000000 Z
11
+ date: 2021-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_design_system_formbuilder
@@ -337,6 +337,7 @@ files:
337
337
  - app/views/metadata_presenter/page/checkanswers.html.erb
338
338
  - app/views/metadata_presenter/page/confirmation.html.erb
339
339
  - app/views/metadata_presenter/page/content.html.erb
340
+ - app/views/metadata_presenter/page/exit.html.erb
340
341
  - app/views/metadata_presenter/page/form.html.erb
341
342
  - app/views/metadata_presenter/page/multiplequestions.html.erb
342
343
  - app/views/metadata_presenter/page/singlequestion.html.erb
@@ -367,6 +368,7 @@ files:
367
368
  - default_metadata/page/checkanswers.json
368
369
  - default_metadata/page/confirmation.json
369
370
  - default_metadata/page/content.json
371
+ - default_metadata/page/exit.json
370
372
  - default_metadata/page/multiplequestions.json
371
373
  - default_metadata/page/singlequestion.json
372
374
  - default_metadata/page/standalone.json
@@ -396,6 +398,7 @@ files:
396
398
  - fixtures/branching_7.png
397
399
  - fixtures/branching_8.json
398
400
  - fixtures/branching_8.png
401
+ - fixtures/exit_only_service.json
399
402
  - fixtures/invalid_content_page.json
400
403
  - fixtures/no_component_page.json
401
404
  - fixtures/non_finished_service.json
@@ -460,6 +463,7 @@ files:
460
463
  - schemas/page/checkanswers.json
461
464
  - schemas/page/confirmation.json
462
465
  - schemas/page/content.json
466
+ - schemas/page/exit.json
463
467
  - schemas/page/multiplequestions.json
464
468
  - schemas/page/singlequestion.json
465
469
  - schemas/page/standalone.json