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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ed9df3a1d56df6ff57746e7976d578741de8df0214f1080fbc661a087753bea
|
4
|
+
data.tar.gz: 85783ae10996111d01c523cff076ca0b82634cac855dfdf32f88665c5187a6d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
10
|
-
max_words: component.
|
11
|
-
threshold: component.
|
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
|
%>
|
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.
|
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-
|
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
|