metadata_presenter 0.15.3 → 0.18.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.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/metadata_presenter/pages_controller.rb +2 -2
  3. data/app/helpers/metadata_presenter/application_helper.rb +4 -6
  4. data/app/presenters/metadata_presenter/page_answers_presenter.rb +7 -1
  5. data/app/views/metadata_presenter/component/_text.html.erb +6 -8
  6. data/app/views/metadata_presenter/component/_textarea.html.erb +10 -12
  7. data/app/views/metadata_presenter/footer/footer.html.erb +1 -1
  8. data/app/views/metadata_presenter/page/checkanswers.html.erb +29 -18
  9. data/app/views/metadata_presenter/page/content.html.erb +56 -0
  10. data/app/views/metadata_presenter/page/multiplequestions.html.erb +33 -0
  11. data/app/views/metadata_presenter/page/singlequestion.html.erb +11 -6
  12. data/app/views/metadata_presenter/page/start.html.erb +1 -1
  13. data/default_metadata/component/checkboxes.json +3 -3
  14. data/default_metadata/component/content.json +5 -0
  15. data/default_metadata/component/date.json +2 -2
  16. data/default_metadata/component/number.json +2 -2
  17. data/default_metadata/component/radios.json +3 -3
  18. data/default_metadata/component/text.json +1 -1
  19. data/default_metadata/component/textarea.json +2 -2
  20. data/default_metadata/page/confirmation.json +1 -1
  21. data/default_metadata/page/content.json +10 -0
  22. data/default_metadata/page/multiplequestions.json +8 -0
  23. data/fixtures/version.json +63 -0
  24. data/lib/metadata_presenter/version.rb +1 -1
  25. data/schemas/component/content.json +30 -0
  26. data/schemas/definition/page.json +2 -0
  27. data/schemas/page/checkanswers.json +0 -3
  28. data/schemas/page/confirmation.json +0 -3
  29. data/schemas/page/content.json +23 -0
  30. data/schemas/page/multiplequestions.json +20 -0
  31. data/schemas/page/singlequestion.json +1 -0
  32. data/schemas/page/start.json +0 -2
  33. metadata +10 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62b09847c307e12ca743e4ea24dc243f0f1f40f44bd53c44326fd8cdeb228459
4
- data.tar.gz: d9d68daebe45b7ff45de6ae0f47af1d694a81185a5d6ab5ffd96e8f60c26c408
3
+ metadata.gz: 0c19b02783094e460bc0e7896c3f44a59922aa78fb49ca6e16d159d1b381a2e8
4
+ data.tar.gz: e8c4c046c50f4321d3172602f097aee09cec89501b65cb6769a200acf70e0ed0
5
5
  SHA512:
6
- metadata.gz: 2009b6c486d9f0446756d9cde53390d56ff831cea06467520c21e1ae757af5738a44eac823e134741c0156ee81d0f1d6c1580828a9486875d06b29551c7c1bb0
7
- data.tar.gz: ec7f9cce8fc53ad5c48b7f6995329d638c6b28f3ad906196af535341baf192b2bf7ce650c9c93d9e82967ab47a791f16a3530e4d8b44238e12dde1298fc70d41
6
+ metadata.gz: 5754598e51f0cb85d7cbc1b0f3e513a26526e56185c0dc7b465c2f1580e6b62ad9cb1cfea8ca75b6983df0be55a8940d554e3985b788c35cb5de1d36dc4d79ac
7
+ data.tar.gz: 97c001c4bec542177a363ef6e9dcab974437d10042ecf63666339669c4a84bb7c438c2707766d33a536f626d4d70d1005e7a56b76f9611ef2f37cb4cf58e1d57
@@ -12,13 +12,13 @@ module MetadataPresenter
12
12
  end
13
13
  end
14
14
 
15
- def page_answers_presenters
15
+ def pages_presenters
16
16
  PageAnswersPresenter.map(
17
17
  view: view_context,
18
18
  pages: service.pages,
19
19
  answers: @user_data
20
20
  )
21
21
  end
22
- helper_method :page_answers_presenters
22
+ helper_method :pages_presenters
23
23
  end
24
24
  end
@@ -1,14 +1,12 @@
1
1
  module MetadataPresenter
2
2
  module ApplicationHelper
3
- def main_h1(component)
3
+ def main_title(component:, tag: :h1, classes: 'govuk-heading-xl')
4
4
  if component.legend.present?
5
- content_tag(:legend, class: 'govuk-fieldset__legend govuk-fieldset__legend--l') do
6
- content_tag(:h1, class: 'govuk-heading-xl') do
7
- component.legend
8
- end
5
+ content_tag(:h1, class: 'govuk-heading-xl') do
6
+ component.legend
9
7
  end
10
8
  else
11
- content_tag(:h1, class: 'govuk-heading-xl') do
9
+ content_tag(tag, class: classes) do
12
10
  component.label
13
11
  end
14
12
  end
@@ -1,5 +1,7 @@
1
1
  module MetadataPresenter
2
2
  class PageAnswersPresenter
3
+ FIRST_ANSWER = 0.freeze
4
+
3
5
  def self.map(view:, pages:, answers:)
4
6
  pages.map do |page|
5
7
  Array(page.components).map do |component|
@@ -10,7 +12,7 @@ module MetadataPresenter
10
12
  answers: answers
11
13
  )
12
14
  end
13
- end.flatten
15
+ end.reject { |page| page.empty? }
14
16
  end
15
17
 
16
18
  attr_reader :view, :component, :page, :answers
@@ -37,6 +39,10 @@ module MetadataPresenter
37
39
  end
38
40
  end
39
41
 
42
+ def display_heading?(index)
43
+ page.type == 'page.multiplequestions' && index == FIRST_ANSWER
44
+ end
45
+
40
46
  private
41
47
 
42
48
  def date(value)
@@ -1,8 +1,6 @@
1
- <div class="fb-editable" data-fb-content-type="<%= component._type %>" data-fb-content-id="<%= component_id %>" data-fb-content-data="<%= component.to_json %>">
2
- <%=
3
- f.govuk_text_field component.id.to_sym,
4
- label: { text: input_title },
5
- hint: { text: component.hint },
6
- name: "answers[#{component.name}]"
7
- %>
8
- </div>
1
+ <%=
2
+ f.govuk_text_field component.id.to_sym,
3
+ label: { text: input_title },
4
+ hint: { text: component.hint },
5
+ name: "answers[#{component.name}]"
6
+ %>
@@ -1,12 +1,10 @@
1
- <div class="fb-editable" data-fb-content-type="<%= component._type %>" data-fb-content-id="<%= component_id %>" data-fb-content-data="<%= component.to_json %>">
2
- <%=
3
- f.govuk_text_area component.id.to_sym,
4
- label: { text: input_title },
5
- hint: { text: component.hint },
6
- name: "answers[#{component.name}]",
7
- max_chars: component.maxchars,
8
- max_words: component.maxwords,
9
- threshold: component.threshold,
10
- rows: component.rows
11
- %>
12
- </div>
1
+ <%=
2
+ f.govuk_text_area component.id.to_sym,
3
+ label: { text: input_title },
4
+ hint: { text: component.hint },
5
+ name: "answers[#{component.name}]",
6
+ max_chars: component.maxchars,
7
+ max_words: component.maxwords,
8
+ threshold: component.threshold,
9
+ rows: component.rows
10
+ %>
@@ -1,4 +1,4 @@
1
- <footer class="govuk-footer " role="contentinfo">
1
+ <footer class="govuk-footer fb-editor-footer" role="contentinfo">
2
2
  <div class="govuk-width-container ">
3
3
  <div class="govuk-footer__meta">
4
4
  <div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
@@ -35,25 +35,36 @@
35
35
  <%= form_for @page, url: reserved_submissions_path do |f| %>
36
36
  <div data-block-id="page.checkanswers.answers" data-block-type="answers">
37
37
  <dl class="fb-block fb-block-answers govuk-summary-list">
38
- <% page_answers_presenters.each do |page_answers_presenter| %>
39
- <div class="govuk-summary-list__row">
40
- <dt class="govuk-summary-list__key">
41
- <%= page_answers_presenter.humanised_title %>
42
- </dt>
38
+ <% pages_presenters.each do |page_answers_presenters| %>
39
+ <% page_answers_presenters.each_with_index do |page_answers_presenter, index| %>
43
40
 
44
- <dd class="govuk-summary-list__value">
45
- <%= page_answers_presenter.answer %>
46
- </dd>
47
- <dd class="govuk-summary-list__actions">
48
- <%= link_to(
49
- change_answer_path(url: page_answers_presenter.url),
50
- class: 'govuk-link'
51
- ) do %>
52
- Change<span class="govuk-visually-hidden"> Your answer for <%= page_answers_presenter.humanised_title %></span>
53
- <% end %>
54
- </a>
55
- </dd>
56
- </div>
41
+ <% if page_answers_presenter.display_heading?(index) %>
42
+ </dl>
43
+
44
+ <h3 class="govuk-heading-m"><%= page_answers_presenter.page.heading %></h3>
45
+
46
+ <dl class="fb-block fb-block-answers govuk-summary-list">
47
+ <% end %>
48
+
49
+ <div class="govuk-summary-list__row">
50
+ <dt class="govuk-summary-list__key">
51
+ <%= page_answers_presenter.humanised_title %>
52
+ </dt>
53
+
54
+ <dd class="govuk-summary-list__value">
55
+ <%= page_answers_presenter.answer %>
56
+ </dd>
57
+ <dd class="govuk-summary-list__actions">
58
+ <%= link_to(
59
+ change_answer_path(url: page_answers_presenter.url),
60
+ class: 'govuk-link'
61
+ ) do %>
62
+ Change<span class="govuk-visually-hidden"> Your answer for <%= page_answers_presenter.humanised_title %></span>
63
+ <% end %>
64
+ </a>
65
+ </dd>
66
+ </div>
67
+ <% end %>
57
68
  <% end %>
58
69
  </dl>
59
70
  </div>
@@ -0,0 +1,56 @@
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
+ <% if @page.section_heading -%>
5
+ <p class="fb-editable govuk-caption-l fb-section_heading"
6
+ data-fb-content-type="element"
7
+ data-fb-content-id="page[section_heading]">
8
+ <%= @page.section_heading.html_safe %>
9
+ </p>
10
+ <%- end %>
11
+
12
+ <% if @page.heading %>
13
+ <h1 class="fb-editable govuk-heading-xl"
14
+ data-fb-content-id="page[heading]"
15
+ data-fb-content-type="element">
16
+ <%= @page.heading.html_safe %>
17
+ </h1>
18
+ <% end %>
19
+
20
+ <% if @page.lede %>
21
+ <div class="fb-editable"
22
+ data-fb-content-id="page[lede]"
23
+ data-fb-content-type="content">
24
+ <%= @page.lede.html_safe %>
25
+ </div>
26
+ <%- end %>
27
+
28
+ <% if @page.body %>
29
+ <div class="fb-editable"
30
+ data-fb-content-id="page[body]"
31
+ data-fb-content-type="content">
32
+ <%= to_markdown(@page.body) %>
33
+ </div>
34
+ <%- end %>
35
+
36
+ <%= form_for @page_answers, as: :answers, url: @page.url, method: :post do |f| %>
37
+ <%= f.govuk_error_summary %>
38
+
39
+ <% @page.components.each_with_index do |component, index| %>
40
+ <div class="fb-editable"
41
+ data-fb-content-type="<%= component._type %>"
42
+ data-fb-content-id="<%= "page[components[#{index}]]" %>"
43
+ data-fb-content-data="<%= component.to_json %>">
44
+ <%= render partial: component, locals: {
45
+ component: component,
46
+ f: f,
47
+ input_title: main_title(component: component) }
48
+ %>
49
+ </div>
50
+ <% end %>
51
+
52
+ <%= f.govuk_submit(disabled: editable?) %>
53
+ <% end %>
54
+ </div>
55
+ </div>
56
+ </div>
@@ -0,0 +1,33 @@
1
+ <div class="fb-main-grid-wrapper" data-block-id="<%= @page.id %>" data-block-type="page" data-block-pagetype="<%= @page.type %>">
2
+ <div class="govuk-grid-row">
3
+ <div class="govuk-grid-column-two-thirds">
4
+ <% if @page.section_heading %>
5
+ <p class="fb-editable govuk-caption-l fb-section_heading"
6
+ data-fb-content-type="element"
7
+ data-fb-content-id="page[section_heading]">
8
+ <%= @page.section_heading.html_safe %>
9
+ </p>
10
+ <%- end %>
11
+
12
+ <h1 class="govuk-heading-xl"><%= @page.heading %></h1>
13
+
14
+ <%= form_for @page_answers, as: :answers, url: @page.url, method: :post do |f| %>
15
+ <%= f.govuk_error_summary %>
16
+ <% @page.components.each_with_index do |component, index| %>
17
+ <%= render partial: component, locals: {
18
+ component: component,
19
+ component_id: "page[components[#{index}]]",
20
+ f: f,
21
+ input_title: main_title(
22
+ component: component,
23
+ tag: :h2,
24
+ classes: 'govuk-heading-m govuk-!-margin-top-8'
25
+ ) }
26
+ %>
27
+ <% end %>
28
+
29
+ <%= f.govuk_submit(disabled: editable?) %>
30
+ <% end %>
31
+ </div>
32
+ </div>
33
+ </div>
@@ -3,13 +3,18 @@
3
3
  <div class="govuk-grid-column-two-thirds">
4
4
  <%= form_for @page_answers, as: :answers, url: @page.url, method: :post do |f| %>
5
5
  <%= f.govuk_error_summary %>
6
+
6
7
  <% @page.components.each_with_index do |component, index| %>
7
- <%= render partial: component, locals: {
8
- component: component,
9
- component_id: "page[components[#{index}]]",
10
- f: f,
11
- input_title: main_h1(component) }
12
- %>
8
+ <div class="fb-editable"
9
+ data-fb-content-type="<%= component._type %>"
10
+ data-fb-content-id="<%= "page[components[#{index}]]" %>"
11
+ data-fb-content-data="<%= component.to_json %>">
12
+ <%= render partial: component, locals: {
13
+ component: component,
14
+ f: f,
15
+ input_title: main_title(component: component) }
16
+ %>
17
+ </div>
13
18
  <% end %>
14
19
 
15
20
  <%= f.govuk_submit(disabled: editable?) %>
@@ -10,7 +10,7 @@
10
10
  <%- end %>
11
11
 
12
12
  <% if @page.heading %>
13
- <h1 class="fb-editable <%= @page.heading_class %>"
13
+ <h1 class="fb-editable govuk-heading-xl"
14
14
  data-fb-content-id="page[heading]"
15
15
  data-fb-content-type="element">
16
16
  <%= @page.heading.html_safe %>
@@ -2,20 +2,20 @@
2
2
  "_id": "component.checkboxes",
3
3
  "_type": "checkboxes",
4
4
  "errors": {},
5
- "hint": "[Hint text (optional)]",
5
+ "hint": "[Optional hint text]",
6
6
  "items": [
7
7
  {
8
8
  "_id": "component_checkbox_1",
9
9
  "_type": "checkbox",
10
10
  "label": "Option",
11
- "hint": "[Hint text (optional)]",
11
+ "hint": "[Optional hint text]",
12
12
  "value": "value-1"
13
13
  },
14
14
  {
15
15
  "_id": "component_checkbox_2",
16
16
  "_type": "checkbox",
17
17
  "label": "Option",
18
- "hint": "[Hint text (optional)]",
18
+ "hint": "[Optional hint text]",
19
19
  "value": "value-2"
20
20
  }
21
21
  ],
@@ -0,0 +1,5 @@
1
+ {
2
+ "_id": "component.content",
3
+ "_type": "content",
4
+ "html": "[Optional content]"
5
+ }
@@ -2,8 +2,8 @@
2
2
  "_id": "component.date",
3
3
  "_type": "date",
4
4
  "errors": {},
5
- "hint": "Component hint",
6
- "legend": "Component legend",
5
+ "hint": "[Optional hint text]",
6
+ "legend": "Question",
7
7
  "name": "component-name",
8
8
  "date_type": "day-month-year",
9
9
  "validation": {
@@ -2,8 +2,8 @@
2
2
  "_id": "component.number",
3
3
  "_type": "number",
4
4
  "errors": {},
5
- "hint": "Component hint",
6
- "label": "Component label",
5
+ "hint": "[Optional hint text]",
6
+ "label": "Question",
7
7
  "name": "component-name",
8
8
  "width_class_input": "10",
9
9
  "validation": {
@@ -2,20 +2,20 @@
2
2
  "_id": "component.radios",
3
3
  "_type": "radios",
4
4
  "errors": {},
5
- "hint": "[Hint text (optional)]",
5
+ "hint": "[Optional hint text]",
6
6
  "items": [
7
7
  {
8
8
  "_id": "component_radio_1",
9
9
  "_type": "radio",
10
10
  "label": "Option",
11
- "hint": "[Hint text (optional)]",
11
+ "hint": "[Optional hint text]",
12
12
  "value": "value-1"
13
13
  },
14
14
  {
15
15
  "_id": "component_radio_2",
16
16
  "_type": "radio",
17
17
  "label": "Option",
18
- "hint": "[Hint text (optional)]",
18
+ "hint": "[Optional hint text]",
19
19
  "value": "value-2"
20
20
  }
21
21
  ],
@@ -3,7 +3,7 @@
3
3
  "_type": "text",
4
4
  "errors": {},
5
5
  "label": "Question",
6
- "hint": "Hint (optional)",
6
+ "hint": "[Optional hint text]",
7
7
  "name": "component-name",
8
8
  "validation": {
9
9
  "required": true
@@ -2,8 +2,8 @@
2
2
  "_id": "component.textarea",
3
3
  "_type": "textarea",
4
4
  "errors": {},
5
- "hint": "Component hint",
6
- "label": "Component label",
5
+ "hint": "[Optional hint text]",
6
+ "label": "Question",
7
7
  "name": "component-name",
8
8
  "rows": 5,
9
9
  "validation": {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "_id": "page.confirmation",
3
3
  "_type": "page.confirmation",
4
- "heading": "Required - Confirmation"
4
+ "heading": "Application complete"
5
5
  }
@@ -0,0 +1,10 @@
1
+ {
2
+ "_id": "page.content",
3
+ "_type": "page.content",
4
+ "section_heading": "[Optional section heading]",
5
+ "heading": "Title",
6
+ "lede": "[Optional lead paragraph]",
7
+ "body": "[Optional content]",
8
+ "components": [],
9
+ "url": ""
10
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "_id": "page.multiplequestions",
3
+ "_type": "page.multiplequestions",
4
+ "section_heading": "[Optional section heading]",
5
+ "heading": "Title",
6
+ "components": [],
7
+ "url": ""
8
+ }
@@ -266,6 +266,69 @@
266
266
  "heading": "Checkboxes",
267
267
  "url": "/burgers"
268
268
  },
269
+ {
270
+ "_uuid": "9403b67a-19b5-4422-a91d-0774537e4c96",
271
+ "_id": "page.star-wars-knowledge",
272
+ "_type": "page.multiplequestions",
273
+ "components": [
274
+ {
275
+ "_id": "star-wars-knowledge_text_1",
276
+ "_type": "text",
277
+ "label": "What was the name of the band playing in Jabba's palace?",
278
+ "name": "star-wars-knowledge_text_1",
279
+ "validation": {
280
+ "required": true
281
+ }
282
+ },
283
+ {
284
+ "_id": "star-wars-knowledge_radios_1",
285
+ "_type": "radios",
286
+ "errors": {},
287
+ "hint": "Component hint",
288
+ "legend": "What is The Mandalorian's real name?",
289
+ "items": [
290
+ {
291
+ "_id": "star-wars-knowledge_radio_1",
292
+ "_type": "radio",
293
+ "label": "Harry Potter",
294
+ "hint": "Optional item hint",
295
+ "value": "harry-potter"
296
+ },
297
+ {
298
+ "_id": "star-wars-knowledge_radio_2",
299
+ "_type": "radio",
300
+ "label": "Din Jarrin",
301
+ "hint": "Optional item hint",
302
+ "value": "din-jarrin"
303
+ },
304
+ {
305
+ "_id": "star-wars-knowledge_radio_3",
306
+ "_type": "radio",
307
+ "label": "Tony Stark",
308
+ "hint": "Optional item hint",
309
+ "value": "tony-stark"
310
+ }
311
+ ],
312
+ "name": "star-wars-knowledge_radios_1",
313
+ "validation": {
314
+ "required": true
315
+ }
316
+ }
317
+ ],
318
+ "heading": "How well do you know Star Wars?",
319
+ "section_heading": "That's no moon",
320
+ "url": "/star-wars-knowledge"
321
+ },
322
+ {
323
+ "_uuid": "1ed3e4ad-5098-41c9-b4b6-426e89f7804e",
324
+ "_id": "page.how-many-lights",
325
+ "_type": "page.content",
326
+ "section_heading": "Chain of Command",
327
+ "heading": "Tell me how many lights you see",
328
+ "body": "There are four lights!",
329
+ "components": [],
330
+ "url": "how-many-lights"
331
+ },
269
332
  {
270
333
  "_uuid": "e819d0c2-7062-4997-89cf-44d26d098404",
271
334
  "_id": "page._check-answers",
@@ -1,3 +1,3 @@
1
1
  module MetadataPresenter
2
- VERSION = '0.15.3'
2
+ VERSION = '0.18.0'
3
3
  end
@@ -0,0 +1,30 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/content",
3
+ "_name": "component.content",
4
+ "title": "Content",
5
+ "description": "Display ‘flat’ content, such as text",
6
+ "type": "object",
7
+ "category": [
8
+ "content"
9
+ ],
10
+ "properties": {
11
+ "_type": {
12
+ "const": "content"
13
+ },
14
+ "html": {
15
+ "title": "Content",
16
+ "description": "Content to display - use [markdown](https://www.gov.uk/guidance/how-to-publish-on-gov-uk/markdown) to format text or add hyperlinks",
17
+ "type": "string",
18
+ "content": true,
19
+ "multiline": true
20
+ }
21
+ },
22
+ "allOf": [
23
+ {
24
+ "$ref": "definition.component"
25
+ }
26
+ ],
27
+ "required": [
28
+ "html"
29
+ ]
30
+ }
@@ -100,6 +100,8 @@
100
100
  ],
101
101
  "required": [
102
102
  "_uuid",
103
+ "_id",
104
+ "_type",
103
105
  "url"
104
106
  ],
105
107
  "category": [
@@ -48,13 +48,10 @@
48
48
  }
49
49
  },
50
50
  "required": [
51
- "_id",
52
- "_type",
53
51
  "heading",
54
52
  "send_heading",
55
53
  "send_body"
56
54
  ],
57
- "additionalProperties": false,
58
55
  "allOf": [
59
56
  {
60
57
  "$ref": "definition.page.form"
@@ -22,11 +22,8 @@
22
22
  }
23
23
  },
24
24
  "required": [
25
- "_id",
26
- "_type",
27
25
  "heading"
28
26
  ],
29
- "additionalProperties": false,
30
27
  "allOf": [
31
28
  {
32
29
  "$ref": "definition.page.content"
@@ -0,0 +1,23 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/page/content",
3
+ "_name": "page.content",
4
+ "title": "Content",
5
+ "description": "Display content to users without asking any questions",
6
+ "type": "object",
7
+ "properties": {
8
+ "_type": {
9
+ "const": "page.content"
10
+ }
11
+ },
12
+ "allOf": [
13
+ {
14
+ "$ref": "definition.page.content"
15
+ }
16
+ ],
17
+ "uiCategory": {
18
+ "main": [
19
+ "lede",
20
+ "body"
21
+ ]
22
+ }
23
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/page/multiplequestions",
3
+ "_name": "page.multiplequestions",
4
+ "title": "Multiple questions",
5
+ "description": "Ask users more than one question on a page",
6
+ "type": "object",
7
+ "properties": {
8
+ "_type": {
9
+ "const": "page.multiplequestions"
10
+ }
11
+ },
12
+ "allOf": [
13
+ {
14
+ "$ref": "definition.page.form"
15
+ }
16
+ ],
17
+ "required": [
18
+ "heading"
19
+ ]
20
+ }
@@ -21,6 +21,7 @@
21
21
  }
22
22
  ],
23
23
  "required": [
24
+ "heading",
24
25
  "components"
25
26
  ],
26
27
  "surplus_properties": [
@@ -37,8 +37,6 @@
37
37
  ]
38
38
  },
39
39
  "required": [
40
- "_id",
41
- "_type",
42
40
  "heading",
43
41
  "steps"
44
42
  ]
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: 0.15.3
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - MoJ Online
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-03 00:00:00.000000000 Z
11
+ date: 2021-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -260,13 +260,16 @@ files:
260
260
  - app/views/metadata_presenter/header/show.html.erb
261
261
  - app/views/metadata_presenter/page/checkanswers.html.erb
262
262
  - app/views/metadata_presenter/page/confirmation.html.erb
263
+ - app/views/metadata_presenter/page/content.html.erb
263
264
  - app/views/metadata_presenter/page/form.html.erb
265
+ - app/views/metadata_presenter/page/multiplequestions.html.erb
264
266
  - app/views/metadata_presenter/page/singlequestion.html.erb
265
267
  - app/views/metadata_presenter/page/start.html.erb
266
268
  - config/initializers/default_metadata.rb
267
269
  - config/initializers/schemas.rb
268
270
  - config/routes.rb
269
271
  - default_metadata/component/checkboxes.json
272
+ - default_metadata/component/content.json
270
273
  - default_metadata/component/date.json
271
274
  - default_metadata/component/number.json
272
275
  - default_metadata/component/radios.json
@@ -278,6 +281,8 @@ files:
278
281
  - default_metadata/definition/radio.json
279
282
  - default_metadata/page/checkanswers.json
280
283
  - default_metadata/page/confirmation.json
284
+ - default_metadata/page/content.json
285
+ - default_metadata/page/multiplequestions.json
281
286
  - default_metadata/page/singlequestion.json
282
287
  - default_metadata/page/start.json
283
288
  - default_metadata/service/base.json
@@ -295,6 +300,7 @@ files:
295
300
  - lib/metadata_presenter/version.rb
296
301
  - lib/tasks/metadata_presenter_tasks.rake
297
302
  - schemas/component/checkboxes.json
303
+ - schemas/component/content.json
298
304
  - schemas/component/date.json
299
305
  - schemas/component/number.json
300
306
  - schemas/component/radios.json
@@ -342,6 +348,8 @@ files:
342
348
  - schemas/link/link.json
343
349
  - schemas/page/checkanswers.json
344
350
  - schemas/page/confirmation.json
351
+ - schemas/page/content.json
352
+ - schemas/page/multiplequestions.json
345
353
  - schemas/page/singlequestion.json
346
354
  - schemas/page/start.json
347
355
  - schemas/request/service.json