metadata_presenter 3.3.5 → 3.3.7

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: de5dd13825b342affe023f56997462ed149f8b47b8893ef9f6fdfd8682486c78
4
- data.tar.gz: 920e393d3abccb2c5cb7f8c54af1f3aae85a2e7792282ccf0afa58fd1229905e
3
+ metadata.gz: 5b3ba182294bff21c9555433a3e5ac319ee1aae0f83e437c85b4045c2881d4d0
4
+ data.tar.gz: 709711ebb0368b79ea07e00cb2547f38dec2a50c988438393e705187b742bbb2
5
5
  SHA512:
6
- metadata.gz: a4fb4a7d1b420edf3883e25b39848b9cf7cb85918e2a6fe4519daea4d0623ae4f2e2d8fa5d48f38b4c1adfbd5f83b74bfd65ebe4c5105b124a3e6e2a93a6a0d8
7
- data.tar.gz: a03c51b5b0e0a8ab88c80ff50a4f747a813800bfe428527e6666ef785835e45e172bd62335632195e7f33bafac8a2cd654bc658f8a5649406401db68d495652e
6
+ metadata.gz: 10a3f4918c792c57b5f7e717511168f45a2c3bf51e66c6d44c5c071a3137a0945fd4f11abe13a3c694f35c445ef74c89e69664a85de8a9048342a0873a80973b
7
+ data.tar.gz: 9689d77e3b0fb63fa7d63b5817d4bcafd613de6b0d00a99a4fd9cced7593080c5841f486c873d592d45df2c855e5568e253f5b0ef03d04db4d10971d0ae2b557
@@ -112,7 +112,7 @@ module MetadataPresenter
112
112
  destinations_count = service.branches.map do |branch|
113
113
  exiting_destinations_from_branch(branch).count
114
114
  end
115
- destinations_count.sum
115
+ [destinations_count.sum, 1].max # ensure there is always 1 row
116
116
  end
117
117
  end
118
118
 
@@ -294,12 +294,12 @@ module MetadataPresenter
294
294
  # Therefore replace any Pointers after the first one with Spacers.
295
295
  def trim_to_first_pointer
296
296
  max_potential_rows.times do |row|
297
- first_index_of = first_pointer(row)
298
- next unless first_index_of
297
+ index_of_first_pointer = first_pointer(row)
298
+ next unless index_of_first_pointer
299
299
 
300
- next_column = first_index_of + 1
301
- @ordered.drop(next_column).each do |column|
302
- column[row] = MetadataPresenter::Spacer.new
300
+ starting_column = index_of_first_pointer + 1
301
+ @ordered.drop(starting_column).each.with_index(starting_column) do |_, column_index|
302
+ @ordered[column_index][row] = MetadataPresenter::Spacer.new
303
303
  end
304
304
  end
305
305
  end
@@ -44,7 +44,8 @@ module MetadataPresenter
44
44
 
45
45
  return {} unless file_details
46
46
 
47
- if file_details.is_a?(ActionController::Parameters)
47
+ case file_details
48
+ when ActionController::Parameters
48
49
  unless file_details.permitted?
49
50
  Rails.logger.warn("[PageAnswers#upload_answer] Permitting unfiltered params in component `#{component_id}`")
50
51
  file_details.permit!
@@ -53,7 +54,7 @@ module MetadataPresenter
53
54
  file_details.merge(
54
55
  'original_filename' => sanitize_filename(file_details['original_filename'])
55
56
  )
56
- elsif file_details.is_a?(Hash)
57
+ when Hash
57
58
  file_details.merge(
58
59
  'original_filename' => sanitize_filename(file_details['original_filename'])
59
60
  )
@@ -152,7 +152,7 @@ en:
152
152
  url: 'privacy'
153
153
  accessibility:
154
154
  heading: "Accessibility statement"
155
- body: "This accessibility statement applies to [describe your form here - for example, the general enquiries form for the CICA].\r\n\r\n## Using this form\r\n\r\nThis form was built using MoJ Forms, a tool developed by the Ministry of Justice (MoJ), and uses components from the [GOV.UK Design System](https://design-system.service.gov.uk).\r\n\r\n[insert your team or organisation here] is responsible for the content of this online form. The Ministry of Justice and MoJ Forms team are responsible for its technical aspects.\r\n\r\nWe want as many people as possible to be able to use this online form. For example, that means you should be able to:\r\n\r\n- change colours, contrast levels and fonts\r\n- zoom in up to 300% without the text spilling off the screen\r\n- navigate the form using just a keyboard\r\n- navigate the form using speech recognition software\r\n- listen to the form using a screen reader (including recent versions of JAWS, NVDA and VoiceOver)\r\n\r\nWe have also made the text as simple as possible to understand.\r\n\r\n[AbilityNet](https://mcmw.abilitynet.org.uk) has advice on making your device easier to use if you have a disability.\r\n\r\n## How accessible this form is\r\n\r\nWe have tested this form for accessibility using a range of browsers and technologies including screen readers. It meets the [Web Content Accessibility Guidelines version 2.2](https://www.w3.org/TR/WCAG22/) AA standard.\r\n\r\n## Feedback and contact information\r\n\r\nIf you have problems using this form or need additional support, contact:\r\n\r\n[insert your contact details for user requests here - add other channels, such as text phones or Relay UK, as required]\r\n\r\n- email: [<your@email.address>]\r\n- call: [your telephone number]\r\n- [Hours - e.g. Monday to Friday, 9am to 5pm]\r\n\r\nWe'll consider your request and get back to you in [add your SLA - e.g. a week or 5 working days].\r\n\r\n## Reporting accessibility problems with this form\r\n\r\nWe’re always looking to improve the accessibility of this form. If you find any problems or think we’re not meeting accessibility requirements, contact the MoJ Forms team at <contact-moj-forms@digital.justice.gov.uk>.\r\n\r\n## Enforcement procedure\r\n\r\nThe Equality and Human Rights Commission (EHRC) is responsible for enforcing the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018 (the ‘accessibility regulations’). If you’re not happy with how we respond to your complaint, contact the [Equality Advisory and Support Service (EASS)](https://www.equalityadvisoryservice.com).\r\n\r\n## Technical information about this online form’s accessibility\r\n\r\nWe are committed to making this form accessible, in accordance with the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018.\r\n\r\n### Compliance status\r\n\r\nThis website is fully compliant with the [Web Content Accessibility Guidelines version 2.2](https://www.w3.org/TR/WCAG22/) AA standard.\r\n\r\n## What we’re doing to improve accessibility\r\n\r\nWe review the content and performance of this form regularly. In addition, the MoJ Forms team monitors the accessibility of the MoJ Forms platform on an ongoing basis and fixes any accessibility issues reported to them.\r\n\r\n## Preparation of this accessibility statement\r\n\r\nThis statement was prepared on [date when it was first published]. It was last reviewed on [date when it was last reviewed. Delete this sentence if you are publishing a form for the first time].\r\n\r\nIn order to test the compliance of all forms built using the MoJ Forms tool, the Ministry of Justice commissioned User Vision to carry out a WCAG 2.1 AA level audit of a sample form. This included extensive automated and manual testing on a range of browsers and assistive technologies. The audit was performed on 24 July 2023. The audit highlighted a number of non-compliance issues which were fixed in August 2023. In addition, the MoJ Accessibility team performed a spot check of WCAG 2.2 criteria on 7 November 2023."
155
+ body: "This accessibility statement applies to [describe your form here - for example, the general enquiries form for the CICA].\r\n\r\n## Using this form\r\n\r\nThis form was built using MoJ Forms, a tool developed by the Ministry of Justice (MoJ), and uses components from the [GOV.UK Design System](https://design-system.service.gov.uk).\r\n\r\n[insert your team or organisation here] is responsible for the content of this online form. The Ministry of Justice and MoJ Forms team are responsible for its technical aspects.\r\n\r\nWe want as many people as possible to be able to use this online form. For example, that means you should be able to:\r\n\r\n- change colours, contrast levels and fonts\r\n- zoom in up to 300% without the text spilling off the screen\r\n- navigate the form using just a keyboard\r\n- navigate the form using speech recognition software\r\n- listen to the form using a screen reader (including recent versions of JAWS, NVDA and VoiceOver)\r\n\r\nWe have also made the text as simple as possible to understand.\r\n\r\n[AbilityNet](https://mcmw.abilitynet.org.uk) has advice on making your device easier to use if you have a disability.\r\n\r\n## How accessible this form is\r\n\r\nWe have tested this form for accessibility using a range of browsers and technologies including screen readers. It meets the [Web Content Accessibility Guidelines version 2.2](https://www.w3.org/TR/WCAG22/) AA standard.\r\n\r\n## Feedback and contact information\r\n\r\nIf you have problems using this form or need additional support, contact:\r\n\r\n[insert your contact details for user requests here - add other channels, such as text phones or Relay UK, as required]\r\n\r\n- email: [<your@email.address>]\r\n- call: [your telephone number]\r\n- [Hours - e.g. Monday to Friday, 9am to 5pm]\r\n\r\nWe'll consider your request and get back to you in [add your SLA - e.g. a week or 5 working days].\r\n\r\n## Reporting accessibility problems with this form\r\n\r\nWe’re always looking to improve the accessibility of this form. If you find any problems or think we’re not meeting accessibility requirements, contact the MoJ Forms team at <contact-moj-forms@digital.justice.gov.uk>.\r\n\r\n## Enforcement procedure\r\n\r\nThe Equality and Human Rights Commission (EHRC) is responsible for enforcing the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018 (the ‘accessibility regulations’). If you’re not happy with how we respond to your complaint, contact the [Equality Advisory and Support Service (EASS)](https://www.equalityadvisoryservice.com).\r\n\r\n## Technical information about this online form’s accessibility\r\n\r\nWe are committed to making this form accessible, in accordance with the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018.\r\n\r\n### Compliance status\r\n\r\nThis website is fully compliant with the [Web Content Accessibility Guidelines version 2.2](https://www.w3.org/TR/WCAG22/) AA standard.\r\n\r\n## What we’re doing to improve accessibility\r\n\r\nWe review the content and performance of this form regularly. In addition, the MoJ Forms team monitors the accessibility of the MoJ Forms platform on an ongoing basis and fixes any accessibility issues reported to them.\r\n\r\n## Preparation of this accessibility statement\r\n\r\nThis statement was prepared on [date when it was first published]. It was last reviewed on [date when it was last reviewed. Delete this sentence if you are publishing a form for the first time].\r\n\r\nIn order to test the compliance of all forms built using the MoJ Forms tool, the Ministry of Justice commissioned User Vision to carry out a WCAG 2.1 AA level audit of a sample form. This included extensive automated and manual testing on a range of browsers and assistive technologies. The audit was performed on 24 July 2023. The audit highlighted a number of non-compliance issues which were fixed in August 2023. In addition, User Vision performed a spot check of WCAG 2.2 criteria on 7 November 2023."
156
156
  placeholders:
157
157
  - "[describe your form here - for example, the general enquiries form for the CICA]"
158
158
  - "[insert your team or organisation here]"
@@ -789,7 +789,7 @@
789
789
  {
790
790
  "_id": "page.accessibility",
791
791
  "url": "accessibility",
792
- "body": "This accessibility statement applies to [describe your form here - for example, the general enquiries form for the CICA].\r\n\r\n## Using this form\r\n\r\nThis form was built using MoJ Forms, a tool developed by the Ministry of Justice (MoJ), and uses components from the [GOV.UK Design System](https://design-system.service.gov.uk).\r\n\r\n[insert your team or organisation here] is responsible for the content of this online form. The Ministry of Justice and MoJ Forms team are responsible for its technical aspects.\r\n\r\nWe want as many people as possible to be able to use this online form. For example, that means you should be able to:\r\n\r\n- change colours, contrast levels and fonts\r\n- zoom in up to 300% without the text spilling off the screen\r\n- navigate the form using just a keyboard\r\n- navigate the form using speech recognition software\r\n- listen to the form using a screen reader (including recent versions of JAWS, NVDA and VoiceOver)\r\n\r\nWe have also made the text as simple as possible to understand.\r\n\r\n[AbilityNet](https://mcmw.abilitynet.org.uk) has advice on making your device easier to use if you have a disability.\r\n\r\n## How accessible this form is\r\n\r\nWe have tested this form for accessibility using a range of browsers and technologies including screen readers. It meets the [Web Content Accessibility Guidelines version 2.2](https://www.w3.org/TR/WCAG22/) AA standard.\r\n\r\n## Feedback and contact information\r\n\r\nIf you have problems using this form or need additional support, contact:\r\n\r\n[insert your contact details for user requests here - add other channels, such as text phones or Relay UK, as required]\r\n\r\n- email: [<your@email.address>]\r\n- call: [your telephone number]\r\n- [Hours - e.g. Monday to Friday, 9am to 5pm]\r\n\r\nWe'll consider your request and get back to you in [add your SLA - e.g. a week or 5 working days].\r\n\r\n## Reporting accessibility problems with this form\r\n\r\nWe’re always looking to improve the accessibility of this form. If you find any problems or think we’re not meeting accessibility requirements, contact the MoJ Forms team at <contact-moj-forms@digital.justice.gov.uk>.\r\n\r\n## Enforcement procedure\r\n\r\nThe Equality and Human Rights Commission (EHRC) is responsible for enforcing the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018 (the ‘accessibility regulations’). If you’re not happy with how we respond to your complaint, contact the [Equality Advisory and Support Service (EASS)](https://www.equalityadvisoryservice.com).\r\n\r\n## Technical information about this online form’s accessibility\r\n\r\nWe are committed to making this form accessible, in accordance with the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018.\r\n\r\n### Compliance status\r\n\r\nThis website is fully compliant with the [Web Content Accessibility Guidelines version 2.2](https://www.w3.org/TR/WCAG22/) AA standard.\r\n\r\n## What we’re doing to improve accessibility\r\n\r\nWe review the content and performance of this form regularly. In addition, the MoJ Forms team monitors the accessibility of the MoJ Forms platform on an ongoing basis and fixes any accessibility issues reported to them.\r\n\r\n## Preparation of this accessibility statement\r\n\r\nThis statement was prepared on [date when it was first published]. It was last reviewed on [date when it was last reviewed. Delete this sentence if you are publishing a form for the first time].\r\n\r\nIn order to test the compliance of all forms built using the MoJ Forms tool, the Ministry of Justice commissioned User Vision to carry out a WCAG 2.1 AA level audit of a sample form. This included extensive automated and manual testing on a range of browsers and assistive technologies. The audit was performed on 24 July 2023. The audit highlighted a number of non-compliance issues which were fixed in August 2023. In addition, the MoJ Accessibility team performed a spot check of WCAG 2.2 criteria on 7 November 2023.",
792
+ "body": "This accessibility statement applies to [describe your form here - for example, the general enquiries form for the CICA].\r\n\r\n## Using this form\r\n\r\nThis form was built using MoJ Forms, a tool developed by the Ministry of Justice (MoJ), and uses components from the [GOV.UK Design System](https://design-system.service.gov.uk).\r\n\r\n[insert your team or organisation here] is responsible for the content of this online form. The Ministry of Justice and MoJ Forms team are responsible for its technical aspects.\r\n\r\nWe want as many people as possible to be able to use this online form. For example, that means you should be able to:\r\n\r\n- change colours, contrast levels and fonts\r\n- zoom in up to 300% without the text spilling off the screen\r\n- navigate the form using just a keyboard\r\n- navigate the form using speech recognition software\r\n- listen to the form using a screen reader (including recent versions of JAWS, NVDA and VoiceOver)\r\n\r\nWe have also made the text as simple as possible to understand.\r\n\r\n[AbilityNet](https://mcmw.abilitynet.org.uk) has advice on making your device easier to use if you have a disability.\r\n\r\n## How accessible this form is\r\n\r\nWe have tested this form for accessibility using a range of browsers and technologies including screen readers. It meets the [Web Content Accessibility Guidelines version 2.2](https://www.w3.org/TR/WCAG22/) AA standard.\r\n\r\n## Feedback and contact information\r\n\r\nIf you have problems using this form or need additional support, contact:\r\n\r\n[insert your contact details for user requests here - add other channels, such as text phones or Relay UK, as required]\r\n\r\n- email: [<your@email.address>]\r\n- call: [your telephone number]\r\n- [Hours - e.g. Monday to Friday, 9am to 5pm]\r\n\r\nWe'll consider your request and get back to you in [add your SLA - e.g. a week or 5 working days].\r\n\r\n## Reporting accessibility problems with this form\r\n\r\nWe’re always looking to improve the accessibility of this form. If you find any problems or think we’re not meeting accessibility requirements, contact the MoJ Forms team at <contact-moj-forms@digital.justice.gov.uk>.\r\n\r\n## Enforcement procedure\r\n\r\nThe Equality and Human Rights Commission (EHRC) is responsible for enforcing the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018 (the ‘accessibility regulations’). If you’re not happy with how we respond to your complaint, contact the [Equality Advisory and Support Service (EASS)](https://www.equalityadvisoryservice.com).\r\n\r\n## Technical information about this online form’s accessibility\r\n\r\nWe are committed to making this form accessible, in accordance with the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018.\r\n\r\n### Compliance status\r\n\r\nThis website is fully compliant with the [Web Content Accessibility Guidelines version 2.2](https://www.w3.org/TR/WCAG22/) AA standard.\r\n\r\n## What we’re doing to improve accessibility\r\n\r\nWe review the content and performance of this form regularly. In addition, the MoJ Forms team monitors the accessibility of the MoJ Forms platform on an ongoing basis and fixes any accessibility issues reported to them.\r\n\r\n## Preparation of this accessibility statement\r\n\r\nThis statement was prepared on [date when it was first published]. It was last reviewed on [date when it was last reviewed. Delete this sentence if you are publishing a form for the first time].\r\n\r\nIn order to test the compliance of all forms built using the MoJ Forms tool, the Ministry of Justice commissioned User Vision to carry out a WCAG 2.1 AA level audit of a sample form. This included extensive automated and manual testing on a range of browsers and assistive technologies. The audit was performed on 24 July 2023. The audit highlighted a number of non-compliance issues which were fixed in August 2023. In addition, User Vision performed a spot check of WCAG 2.2 criteria on 7 November 2023.",
793
793
  "_type": "page.standalone",
794
794
  "_uuid": "c439c7fd-f411-4e11-8598-4023934bac93",
795
795
  "heading": "Accessibility statement",
@@ -1,3 +1,3 @@
1
1
  module MetadataPresenter
2
- VERSION = '3.3.5'.freeze
2
+ VERSION = '3.3.7'.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.5
4
+ version: 3.3.7
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-12-04 00:00:00.000000000 Z
11
+ date: 2023-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_design_system_formbuilder