metadata_presenter 0.1.0 → 0.1.5

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.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/app/validators/metadata_presenter/validate_schema.rb +1 -2
  3. data/app/views/metadata_presenter/page/summary.html.erb +4 -3
  4. data/config/routes.rb +1 -1
  5. data/default_metadata/config/meta.json +24 -0
  6. data/default_metadata/config/service.json +4 -0
  7. data/default_metadata/page/confirmation.json +4 -0
  8. data/default_metadata/page/summary.json +6 -0
  9. data/default_metadata/service/base.json +18 -0
  10. data/default_metadata/string/error.max_length.json +6 -0
  11. data/default_metadata/string/error.min_length.json +6 -0
  12. data/default_metadata/string/error.required.json +7 -0
  13. data/fixtures/non_finished_service.json +123 -0
  14. data/fixtures/service.json +51 -0
  15. data/fixtures/version.json +146 -0
  16. data/lib/metadata_presenter/version.rb +1 -1
  17. data/schemas/condition/condition.json +48 -0
  18. data/schemas/config/meta.json +27 -0
  19. data/schemas/config/service.json +106 -0
  20. data/schemas/definition/block.json +28 -0
  21. data/schemas/definition/component.json +13 -0
  22. data/schemas/definition/components.json +15 -0
  23. data/schemas/definition/condition.base.json +25 -0
  24. data/schemas/definition/condition.boolean.json +25 -0
  25. data/schemas/definition/condition.defined.json +25 -0
  26. data/schemas/definition/condition.expression.json +22 -0
  27. data/schemas/definition/condition.number.json +49 -0
  28. data/schemas/definition/condition.text.json +48 -0
  29. data/schemas/definition/condition.value_type.json +24 -0
  30. data/schemas/definition/conditional.boolean.json +20 -0
  31. data/schemas/definition/conditions.all.json +20 -0
  32. data/schemas/definition/conditions.any.json +26 -0
  33. data/schemas/definition/conditions.exactly.json +26 -0
  34. data/schemas/definition/control.json +75 -0
  35. data/schemas/definition/data.json +28 -0
  36. data/schemas/definition/field.json +26 -0
  37. data/schemas/definition/html_attributes.json +37 -0
  38. data/schemas/definition/label.json +30 -0
  39. data/schemas/definition/link_list.json +30 -0
  40. data/schemas/definition/name.json +18 -0
  41. data/schemas/definition/namespace.json +28 -0
  42. data/schemas/definition/next_page.json +40 -0
  43. data/schemas/definition/page.content.json +23 -0
  44. data/schemas/definition/page.form.json +96 -0
  45. data/schemas/definition/page.json +109 -0
  46. data/schemas/definition/page.singlequestion.json +31 -0
  47. data/schemas/definition/repeatable.json +72 -0
  48. data/schemas/definition/width_class.input.json +48 -0
  49. data/schemas/definition/width_class.json +34 -0
  50. data/schemas/errors/errors.json +139 -0
  51. data/schemas/link/link.json +46 -0
  52. data/schemas/page/confirmation.json +35 -0
  53. data/schemas/page/start.json +34 -0
  54. data/schemas/page/summary.json +63 -0
  55. data/schemas/request/service.json +13 -0
  56. data/schemas/service/base.json +52 -0
  57. data/schemas/service/configuration.json +22 -0
  58. data/schemas/service/locale.json +12 -0
  59. data/schemas/text/text.json +23 -0
  60. data/schemas/validations/validations.json +443 -0
  61. metadata +57 -2
@@ -1,3 +1,3 @@
1
1
  module MetadataPresenter
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.5'
3
3
  end
@@ -0,0 +1,48 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/condition",
3
+ "_name": "condition",
4
+ "title": "Condition",
5
+ "type": "object",
6
+ "allOf": [
7
+ {
8
+ "properties": {
9
+ "_id": {
10
+ "title": "Condition ID",
11
+ "type": "string"
12
+ },
13
+ "_type": {
14
+ "title": "Type",
15
+ "type": "string",
16
+ "const": "condition"
17
+ },
18
+ "description": {
19
+ "title": "Description",
20
+ "type": "string"
21
+ },
22
+ "negated": {
23
+ "title": "Negated",
24
+ "type": "boolean"
25
+ }
26
+ }
27
+ },
28
+ {
29
+ "oneOf": [
30
+ {
31
+ "$ref": "definition.condition.expression"
32
+ },
33
+ {
34
+ "$ref": "definition.conditions.all"
35
+ },
36
+ {
37
+ "$ref": "definition.conditions.any"
38
+ },
39
+ {
40
+ "$ref": "definition.conditions.exactly"
41
+ }
42
+ ]
43
+ }
44
+ ],
45
+ "category": [
46
+ "definition"
47
+ ]
48
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/config/meta",
3
+ "_name": "config.meta",
4
+ "title": "Form meta links",
5
+ "description": "List of links to display in GOVUK footer",
6
+ "usage": "Use the config.meta component to provide a list of links in the footer",
7
+ "type": "object",
8
+ "allOf": [
9
+ {
10
+ "$ref": "definition.link_list"
11
+ }
12
+ ],
13
+ "properties": {
14
+ "_id": {
15
+ "const": "config.meta"
16
+ },
17
+ "_type": {
18
+ "const": "config.meta"
19
+ },
20
+ "title": {
21
+ "type": "null"
22
+ }
23
+ },
24
+ "category": [
25
+ "configuration"
26
+ ]
27
+ }
@@ -0,0 +1,106 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/config/service",
3
+ "title": "Service configuration options",
4
+ "_name": "config.service",
5
+ "description": "Configuration options for a service",
6
+ "type": "object",
7
+ "properties": {
8
+ "_id": {
9
+ "const": "config.service"
10
+ },
11
+ "_type": {
12
+ "const": "config.service"
13
+ },
14
+ "homepage_url": {
15
+ "title": "Homepage URL",
16
+ "description": "The Homepage URL of the service",
17
+ "type": "string"
18
+ },
19
+ "service_email_address": {
20
+ "title": "Service Email Address",
21
+ "description": "The email address of the service",
22
+ "type": "string"
23
+ },
24
+ "service_url": {
25
+ "title": "Service URL",
26
+ "description": "The URL of the first page of the service",
27
+ "type": "string"
28
+ },
29
+ "phase": {
30
+ "title": "Form phase",
31
+ "type": "string",
32
+ "enum": [
33
+ "none",
34
+ "alpha",
35
+ "beta"
36
+ ],
37
+ "default": "alpha"
38
+ },
39
+ "phase_text": {
40
+ "title": "Form phase text",
41
+ "type": "string",
42
+ "content": true
43
+ },
44
+ "code": {
45
+ "title": "Form code",
46
+ "description": "Code used for form (eg. C100)",
47
+ "type": "string"
48
+ },
49
+ "pdf_heading": {
50
+ "title": "PDF heading",
51
+ "description": "Used as form’s heading when generating PDF output",
52
+ "type": "string"
53
+ },
54
+ "pdf_sub_heading": {
55
+ "title": "PDF subheading",
56
+ "description": "Used as form’s subheading when generating PDF output",
57
+ "type": "string"
58
+ },
59
+ "email_input_name_user": {
60
+ "title": "CC email address field",
61
+ "description": "Name of input used as email address to send user a copy of submission details",
62
+ "type": "string"
63
+ },
64
+ "attach_user_submission": {
65
+ "title": "Attach confirmation of submission to user email",
66
+ "type": "boolean",
67
+ "default": false
68
+ },
69
+ "email_subject_user": {
70
+ "title": "CC email subject",
71
+ "type": "string"
72
+ },
73
+ "email_template_user": {
74
+ "title": "CC email template",
75
+ "type": "string",
76
+ "multiline": true
77
+ },
78
+ "email_subject_team": {
79
+ "title": "Form team email subject",
80
+ "type": "string"
81
+ },
82
+ "email_template_team": {
83
+ "title": "Form team email template",
84
+ "type": "string",
85
+ "multiline": true
86
+ },
87
+ "session_duration": {
88
+ "title": "Session duration",
89
+ "description": "How many minutes a user’s session should last",
90
+ "type": "number"
91
+ },
92
+ "data_retention_duration": {
93
+ "title": "User data retention duration",
94
+ "description": "How many days a user’s data should be kept for",
95
+ "type": "number"
96
+ }
97
+ },
98
+ "allOf": [
99
+ {
100
+ "$ref": "definition.data"
101
+ }
102
+ ],
103
+ "category": [
104
+ "configuration"
105
+ ]
106
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/block",
3
+ "_name": "definition.block",
4
+ "title": "Block definition",
5
+ "properties": {
6
+ "show": {
7
+ "title": "Visibility",
8
+ "category": [
9
+ "logic"
10
+ ],
11
+ "description": "Whether to show or hide the page/component",
12
+ "oneOf": [
13
+ {
14
+ "$ref": "definition.conditional.boolean"
15
+ }
16
+ ],
17
+ "default": true
18
+ }
19
+ },
20
+ "allOf": [
21
+ {
22
+ "$ref": "definition.data"
23
+ }
24
+ ],
25
+ "category": [
26
+ "definition"
27
+ ]
28
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/component",
3
+ "_name": "definition.component",
4
+ "title": "Component definition",
5
+ "allOf": [
6
+ {
7
+ "$ref": "definition.block"
8
+ }
9
+ ],
10
+ "category": [
11
+ "component"
12
+ ]
13
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/components",
3
+ "_name": "definition.components",
4
+ "title": "Components definition",
5
+ "properties": {
6
+ "components": {
7
+ "title": "Components",
8
+ "description": "The form or content elements used on the page",
9
+ "type": "array",
10
+ "items": {
11
+ "$ref": "definition.component"
12
+ }
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/condition/base",
3
+ "_name": "definition.condition.base",
4
+ "title": "Base condition properties",
5
+ "properties": {
6
+ "identifier": {
7
+ "title": "Identifier",
8
+ "type": "string"
9
+ },
10
+ "identifier_type": {
11
+ "title": "Identifier type",
12
+ "type": "string",
13
+ "enum": [
14
+ "input",
15
+ "feature"
16
+ ]
17
+ }
18
+ },
19
+ "required": [
20
+ "identifier"
21
+ ],
22
+ "category": [
23
+ "definition"
24
+ ]
25
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/condition/boolean",
3
+ "_name": "definition.condition.boolean",
4
+ "title": "Boolean condition properties",
5
+ "allOf": [
6
+ {
7
+ "$ref": "definition.condition.base"
8
+ }
9
+ ],
10
+ "properties": {
11
+ "operator": {
12
+ "title": "Operator",
13
+ "type": "string",
14
+ "enum": [
15
+ "isTrue"
16
+ ]
17
+ }
18
+ },
19
+ "required": [
20
+ "operator"
21
+ ],
22
+ "category": [
23
+ "definition"
24
+ ]
25
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/condition/defined",
3
+ "_name": "definition.condition.defined",
4
+ "title": "Defined condition properties",
5
+ "allOf": [
6
+ {
7
+ "$ref": "definition.condition.base"
8
+ }
9
+ ],
10
+ "properties": {
11
+ "operator": {
12
+ "title": "Operator",
13
+ "type": "string",
14
+ "enum": [
15
+ "defined"
16
+ ]
17
+ }
18
+ },
19
+ "required": [
20
+ "operator"
21
+ ],
22
+ "category": [
23
+ "definition"
24
+ ]
25
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/condition/expression",
3
+ "_name": "definition.condition.expression",
4
+ "title": "Single expression condition properties",
5
+ "oneOf": [
6
+ {
7
+ "$ref": "definition.condition.defined"
8
+ },
9
+ {
10
+ "$ref": "definition.condition.text"
11
+ },
12
+ {
13
+ "$ref": "definition.condition.number"
14
+ },
15
+ {
16
+ "$ref": "definition.condition.boolean"
17
+ }
18
+ ],
19
+ "category": [
20
+ "definition"
21
+ ]
22
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/condition/number",
3
+ "_name": "definition.condition.number",
4
+ "title": "Number condition properties",
5
+ "allOf": [
6
+ {
7
+ "$ref": "definition.condition.base"
8
+ }
9
+ ],
10
+ "properties": {
11
+ "operator": {
12
+ "title": "Operator",
13
+ "type": "string",
14
+ "enum": [
15
+ "equals",
16
+ "greater_than",
17
+ "greater_than_or_equal_to",
18
+ "less_than",
19
+ "less_than_or_equal_to",
20
+ "multiple_of"
21
+ ]
22
+ },
23
+ "value": {
24
+ "title": "Value"
25
+ }
26
+ },
27
+ "if": {
28
+ "required": [
29
+ "value_type"
30
+ ]
31
+ },
32
+ "then": {
33
+ "$ref": "definition.condition.value_type"
34
+ },
35
+ "else": {
36
+ "properties": {
37
+ "value": {
38
+ "type": "number"
39
+ }
40
+ }
41
+ },
42
+ "required": [
43
+ "operator",
44
+ "value"
45
+ ],
46
+ "category": [
47
+ "definition"
48
+ ]
49
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/condition/text",
3
+ "_name": "definition.condition.text",
4
+ "title": "Text condition properties",
5
+ "allOf": [
6
+ {
7
+ "$ref": "definition.condition.base"
8
+ }
9
+ ],
10
+ "properties": {
11
+ "operator": {
12
+ "title": "Operator",
13
+ "type": "string",
14
+ "enum": [
15
+ "is",
16
+ "starts_with",
17
+ "ends_with",
18
+ "includes",
19
+ "match"
20
+ ]
21
+ },
22
+ "value": {
23
+ "title": "Value"
24
+ }
25
+ },
26
+ "if": {
27
+ "required": [
28
+ "value_type"
29
+ ]
30
+ },
31
+ "then": {
32
+ "$ref": "definition.condition.value_type"
33
+ },
34
+ "else": {
35
+ "properties": {
36
+ "value": {
37
+ "type": "string"
38
+ }
39
+ }
40
+ },
41
+ "required": [
42
+ "operator",
43
+ "value"
44
+ ],
45
+ "category": [
46
+ "definition"
47
+ ]
48
+ }