metadata_presenter 3.3.13 → 3.3.14
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fce1f7719e73302d134f91f03ce4bfbd239e9303d1d2a08bc5594f9b9882585c
|
4
|
+
data.tar.gz: 5c15e0714aaa369a8898ba00d27f0199972bed43dfc6bffb99e6c0e8be35d0e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfb93f873bdd5cd77e49819a924178b45c2a30e35c8dd6aab829011c058a49ca6a79aa3d94917f136e68c3274fa722b6c9864ee8f5ae759a957f40ac4c6dee95
|
7
|
+
data.tar.gz: 6c68732e6f9cbcac962ce1ef24847d317a041a3b0b48ebacc7589ddd4bfc419770d0fc049dd61427446f82e08d7baa29741538908538f54503afd9a2d21ec7ca
|
@@ -1,4 +1,6 @@
|
|
1
1
|
class MetadataPresenter::Component < MetadataPresenter::Metadata
|
2
|
+
include Comparable
|
3
|
+
|
2
4
|
VALIDATION_BUNDLES = {
|
3
5
|
'date' => 'date',
|
4
6
|
'number' => 'number',
|
@@ -11,6 +13,13 @@ class MetadataPresenter::Component < MetadataPresenter::Metadata
|
|
11
13
|
# Threshold percentage at which the remaining count is shown
|
12
14
|
VALIDATION_STRING_LENGTH_THRESHOLD = 75
|
13
15
|
|
16
|
+
def <=>(other)
|
17
|
+
return nil unless other.is_a?(MetadataPresenter::Component)
|
18
|
+
return 0 unless order
|
19
|
+
|
20
|
+
order <=> other.order
|
21
|
+
end
|
22
|
+
|
14
23
|
# Overriding here because autocomplete component's items property is non interactable
|
15
24
|
# in the Editor therefore it does not need to exist in the data-fb-content-data
|
16
25
|
# attribute on the page. The data-fb-content-data attribute is what is used to
|
@@ -181,12 +181,12 @@ module MetadataPresenter
|
|
181
181
|
end
|
182
182
|
|
183
183
|
def to_components(node_components, collection:)
|
184
|
-
Array(node_components).map
|
184
|
+
Array(node_components).map { |component|
|
185
185
|
MetadataPresenter::Component.new(
|
186
186
|
component.merge(collection:),
|
187
187
|
editor: editor?
|
188
188
|
)
|
189
|
-
|
189
|
+
}.sort
|
190
190
|
end
|
191
191
|
|
192
192
|
def supported_components(page_type)
|
data/fixtures/version.json
CHANGED
@@ -425,7 +425,8 @@
|
|
425
425
|
"collection": "components",
|
426
426
|
"validation": {
|
427
427
|
"required": true
|
428
|
-
}
|
428
|
+
},
|
429
|
+
"order": 2
|
429
430
|
},
|
430
431
|
{
|
431
432
|
"_id": "star-wars-knowledge_content_1",
|
@@ -433,7 +434,8 @@
|
|
433
434
|
"_type": "content",
|
434
435
|
"_uuid": "82444d3d-dab6-44c4-a147-e2650326c9eb",
|
435
436
|
"content": "Stay on target",
|
436
|
-
"collection": "components"
|
437
|
+
"collection": "components",
|
438
|
+
"order": 1
|
437
439
|
},
|
438
440
|
{
|
439
441
|
"_id": "star-wars-knowledge_radios_1",
|
@@ -493,7 +495,8 @@
|
|
493
495
|
"collection": "components",
|
494
496
|
"validation": {
|
495
497
|
"required": true
|
496
|
-
}
|
498
|
+
},
|
499
|
+
"order": 0
|
497
500
|
}
|
498
501
|
],
|
499
502
|
"add_component": "radios",
|
@@ -528,7 +531,7 @@
|
|
528
531
|
"heading": "Question",
|
529
532
|
"components": [
|
530
533
|
{
|
531
|
-
"_id":
|
534
|
+
"_id": "dog-picture_upload_1",
|
532
535
|
"name": "dog-picture_upload_1",
|
533
536
|
"_type": "upload",
|
534
537
|
"_uuid": "f056a76e-ec3f-47ae-b625-1bba92220ad1",
|
@@ -594,7 +597,7 @@
|
|
594
597
|
"heading": "Multiupload",
|
595
598
|
"components": [
|
596
599
|
{
|
597
|
-
"_id":
|
600
|
+
"_id": "dog-picture_upload_2",
|
598
601
|
"name": "dog-picture_upload_2",
|
599
602
|
"_type": "multiupload",
|
600
603
|
"_uuid": "f056a76e-ec3f-47ae-b625-1bba92220ad2",
|
@@ -668,10 +671,8 @@
|
|
668
671
|
"name": "countries_autocomplete_1",
|
669
672
|
"_type": "autocomplete",
|
670
673
|
"_uuid": "4dc23b9c-9757-4526-813d-b43efbe07dad",
|
671
|
-
"items": [
|
672
|
-
|
673
|
-
"errors": {
|
674
|
-
},
|
674
|
+
"items": [],
|
675
|
+
"errors": {},
|
675
676
|
"legend": "Countries",
|
676
677
|
"validation": {
|
677
678
|
"required": true,
|
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.
|
4
|
+
version: 3.3.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MoJ Forms
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_design_system_formbuilder
|