metadata_presenter 2.16.11 → 2.16.12

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: 8834b6fb7919c4e0ab3f01148847e46e20d1036638181a1dc63b727b2bab18b1
4
- data.tar.gz: 621cd45d12d5a7833f5e058c94fe5add3bd4d0822d3eaa5c8bf17fc26f8c58a6
3
+ metadata.gz: 4ed9df3a1d56df6ff57746e7976d578741de8df0214f1080fbc661a087753bea
4
+ data.tar.gz: 85783ae10996111d01c523cff076ca0b82634cac855dfdf32f88665c5187a6d7
5
5
  SHA512:
6
- metadata.gz: 0e78f3eaf0b94ce9a2e2272d74d56cc1492f141000b97cff1648ee4f92edcd8a42483b641900cd27e7ac8c6e15fd6c04a28974cf052910cc04501cb91748b44d
7
- data.tar.gz: 6ae2ef27d6a74a7374e37f4d081b692063aa0c2989b45cbd6b7b779967f8cd025055cb451db09f81241e1edf60c433f147fcf13ba278d78f45cf9070a544bfcc
6
+ metadata.gz: 9c9fc79586eef3d60144b6bdb0093adf3a0ea07db6833a504d65a0bd96c474a66009a1900d071d51370db0857231430b7e18d2777bb7748d216b708f13bd5702
7
+ data.tar.gz: 27b1519b719d9f0c845271523e4afe4f89366e373868e2b18b10dd3d5360b49b22ba384789dd6a8c3cca46dab4599114a5845a8ecd47d833af8a832c1fcf1f7e
@@ -6,6 +6,10 @@ class MetadataPresenter::Component < MetadataPresenter::Metadata
6
6
  'textarea' => 'string'
7
7
  }.freeze
8
8
 
9
+ # Used for max_length and max_word validations.
10
+ # Threshold percentage at which the remaining count is shown
11
+ VALIDATION_STRING_LENGTH_THRESHOLD = 75
12
+
9
13
  def to_partial_path
10
14
  "metadata_presenter/component/#{type}"
11
15
  end
@@ -46,6 +50,10 @@ class MetadataPresenter::Component < MetadataPresenter::Metadata
46
50
  .keys
47
51
  end
48
52
 
53
+ def validation_threshold
54
+ VALIDATION_STRING_LENGTH_THRESHOLD
55
+ end
56
+
49
57
  private
50
58
 
51
59
  def validation_bundle_key
@@ -6,8 +6,8 @@
6
6
  text: component.hint
7
7
  },
8
8
  name: "answers[#{component.name}]",
9
- max_chars: component.maxchars,
10
- max_words: component.maxwords,
11
- threshold: component.threshold,
9
+ max_chars: component.validation['max_length'],
10
+ max_words: component.validation['max_word'],
11
+ threshold: component.validation_threshold,
12
12
  rows: component.rows
13
13
  %>
@@ -1,3 +1,3 @@
1
1
  module MetadataPresenter
2
- VERSION = '2.16.11'.freeze
2
+ VERSION = '2.16.12'.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: 2.16.11
4
+ version: 2.16.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - MoJ Forms
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-27 00:00:00.000000000 Z
11
+ date: 2022-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_design_system_formbuilder