Skip to content

Commit dc5227d

Browse files
committed
Remove required validation for URL (href) in social_media_links schema for topical_event
1 parent 6362f67 commit dc5227d

1 file changed

Lines changed: 29 additions & 28 deletions

File tree

app/models/configurable_document_types/topical_event.json

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,34 +23,31 @@
2323
"block": "default_date"
2424
}
2525
}
26-
}
27-
},
28-
"social_media_links": {
29-
"title": "Social media accounts",
30-
"type": "array",
31-
"format": "social_media_accounts",
32-
"items": {
33-
"type": "object",
34-
"properties": {
35-
"social_media_service_id": {
36-
"title": "Service",
37-
"type": "integer"
38-
},
39-
"url": {
40-
"title": "URL",
41-
"type": "string"
42-
},
43-
"title": {
44-
"title": "Title",
45-
"type": "string"
46-
}
47-
},
48-
"validations": {
49-
"presence": {
50-
"attributes": ["social_media_service_id", "url"]
26+
},
27+
"social_media_links": {
28+
"title": "Social media accounts",
29+
"block": "array_of_hashes",
30+
"items": {
31+
"type": "object",
32+
"properties": {
33+
"social_media_service_id": {
34+
"title": "Service",
35+
"type": "integer",
36+
"input_type": "social_media_service_select",
37+
"output_key": "service_type",
38+
"transform": "social_media_service_name"
39+
},
40+
"url": {
41+
"title": "URL",
42+
"type": "string",
43+
"output_key": "href"
44+
}
5145
},
52-
"uri": {
53-
"attributes": ["url"]
46+
"computed": {
47+
"title": {
48+
"transform": "social_media_service_display_name",
49+
"from": "social_media_service_id"
50+
}
5451
}
5552
}
5653
}
@@ -67,6 +64,9 @@
6764
},
6865
"end_date": {
6966
"type": "date"
67+
},
68+
"social_media_links": {
69+
"type": "array"
7070
}
7171
},
7272
"validations": {
@@ -97,7 +97,8 @@
9797
"publishing_api": {
9898
"body": "govspeak",
9999
"start_date": "rfc3339_date",
100-
"end_date": "rfc3339_date"
100+
"end_date": "rfc3339_date",
101+
"social_media_links": "array_of_hashes"
101102
}
102103
},
103104
"associations": [

0 commit comments

Comments
 (0)