metadata_presenter 0.1.0 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -0,0 +1,24 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/condition/value_type",
3
+ "_name": "definition.condition.value_type",
4
+ "title": "Condition value type properties",
5
+ "properties": {
6
+ "value": {
7
+ "type": "string"
8
+ },
9
+ "value_type": {
10
+ "type": "string",
11
+ "enum": [
12
+ "value",
13
+ "input",
14
+ "feature"
15
+ ]
16
+ }
17
+ },
18
+ "required": [
19
+ "value_type"
20
+ ],
21
+ "category": [
22
+ "definition"
23
+ ]
24
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/conditional/boolean",
3
+ "_name": "definition.conditional.boolean",
4
+ "title": "Boolean or condition",
5
+ "type": [
6
+ "boolean",
7
+ "object"
8
+ ],
9
+ "oneOf": [
10
+ {
11
+ "type": "boolean"
12
+ },
13
+ {
14
+ "$ref": "condition"
15
+ }
16
+ ],
17
+ "category": [
18
+ "definition"
19
+ ]
20
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/conditions/all",
3
+ "_name": "definition.conditions.all",
4
+ "title": "All conditions met properties",
5
+ "properties": {
6
+ "all": {
7
+ "title": "All conditions met",
8
+ "type": "array",
9
+ "items": {
10
+ "$ref": "condition"
11
+ }
12
+ }
13
+ },
14
+ "required": [
15
+ "all"
16
+ ],
17
+ "category": [
18
+ "definition"
19
+ ]
20
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/conditions/any",
3
+ "_name": "definition.conditions.any",
4
+ "title": "At least conditions met properties",
5
+ "properties": {
6
+ "any": {
7
+ "title": "At least X conditions met",
8
+ "type": "array",
9
+ "items": {
10
+ "$ref": "condition"
11
+ }
12
+ },
13
+ "conditions_met": {
14
+ "title": "Number of conditions to meet",
15
+ "type": "number",
16
+ "minimum": 1,
17
+ "default": 1
18
+ }
19
+ },
20
+ "required": [
21
+ "any"
22
+ ],
23
+ "category": [
24
+ "definition"
25
+ ]
26
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/conditions/exactly",
3
+ "_name": "definition.conditions.exactly",
4
+ "title": "Exactly conditions met properties",
5
+ "properties": {
6
+ "exactly": {
7
+ "title": "Exactly X conditions met",
8
+ "type": "array",
9
+ "items": {
10
+ "$ref": "condition"
11
+ }
12
+ },
13
+ "conditions_met": {
14
+ "title": "Number of conditions to meet",
15
+ "type": "number",
16
+ "minimum": 1,
17
+ "default": 1
18
+ }
19
+ },
20
+ "required": [
21
+ "exactly"
22
+ ],
23
+ "category": [
24
+ "definition"
25
+ ]
26
+ }
@@ -0,0 +1,75 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/control",
3
+ "_name": "definition.control",
4
+ "title": "Control definition",
5
+ "allOf": [
6
+ {
7
+ "$ref": "definition.component"
8
+ },
9
+ {
10
+ "$ref": "definition.html_attributes"
11
+ },
12
+ {
13
+ "$ref": "definition.namespace"
14
+ },
15
+ {
16
+ "$ref": "validations#/definitions/required_bundle"
17
+ }
18
+ ],
19
+ "properties": {
20
+ "redact": {
21
+ "title": "Redaction pattern",
22
+ "description": "Pattern specifying that user input should be redacted and how",
23
+ "type": "string",
24
+ "category": [
25
+ "userinput"
26
+ ]
27
+ },
28
+ "optionalText": {
29
+ "title": "Optional text",
30
+ "description": "Additional text to display if control is optional",
31
+ "type": "string",
32
+ "category": [
33
+ "content"
34
+ ],
35
+ "acceptsEmptyString": true,
36
+ "default": "(optional)"
37
+ },
38
+ "autocomplete": {
39
+ "title": "Autocomplete",
40
+ "description": "Instructions how to suggest (or not) values",
41
+ "type": "string",
42
+ "category": [
43
+ "userinput"
44
+ ]
45
+ },
46
+ "spellcheck": {
47
+ "title": "Spellcheck",
48
+ "description": "Whether the element may be checked for spelling errors",
49
+ "type": "string",
50
+ "enum": [
51
+ "true",
52
+ "false"
53
+ ],
54
+ "category": [
55
+ "userinput"
56
+ ]
57
+ },
58
+ "disabled": {
59
+ "title": "Disabled",
60
+ "description": "Whether the control should be disabled",
61
+ "oneOf": [
62
+ {
63
+ "$ref": "definition.conditional.boolean"
64
+ }
65
+ ],
66
+ "default": false,
67
+ "category": [
68
+ "logic"
69
+ ]
70
+ }
71
+ },
72
+ "category": [
73
+ "control"
74
+ ]
75
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/data",
3
+ "_name": "definition.data",
4
+ "title": "Data definition",
5
+ "properties": {
6
+ "_id": {
7
+ "title": "Data ID",
8
+ "type": "string"
9
+ },
10
+ "_type": {
11
+ "title": "Data type",
12
+ "type": "string"
13
+ },
14
+ "_isa": {
15
+ "title": "Based on",
16
+ "description": "Id of page/component to inherit property values from",
17
+ "type": "string",
18
+ "blockReference": true
19
+ }
20
+ },
21
+ "required": [
22
+ "_id",
23
+ "_type"
24
+ ],
25
+ "category": [
26
+ "definition"
27
+ ]
28
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/field",
3
+ "_name": "definition.field",
4
+ "title": "Field definition",
5
+ "allOf": [
6
+ {
7
+ "$ref": "definition.label"
8
+ },
9
+ {
10
+ "$ref": "definition.control"
11
+ },
12
+ {
13
+ "$ref": "definition.repeatable"
14
+ },
15
+ {
16
+ "$ref": "definition.name"
17
+ }
18
+ ],
19
+ "required": [
20
+ "name",
21
+ "label"
22
+ ],
23
+ "category": [
24
+ "field"
25
+ ]
26
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/html_attributes",
3
+ "_name": "definition.html_attributes",
4
+ "title": "HTML attributes definition",
5
+ "description": "Additional HTML values to set on instances",
6
+ "type": "object",
7
+ "properties": {
8
+ "id": {
9
+ "title": "HTML id",
10
+ "description": "Additional HTML id to apply to instance - only use as a last resort, to target a specific element on the page",
11
+ "type": "string",
12
+ "category": [
13
+ "html_attributes"
14
+ ]
15
+ },
16
+ "classes": {
17
+ "title": "Classes",
18
+ "description": "Additional HTML classes to apply to instance - to add more than one, separate with a space",
19
+ "type": "string",
20
+ "content": true,
21
+ "category": [
22
+ "html_attributes"
23
+ ]
24
+ },
25
+ "attributes": {
26
+ "title": "Attributes",
27
+ "description": "Additional HTML attributes to apply to instance - Enter the attributes as JSON",
28
+ "type": "object",
29
+ "category": [
30
+ "html_attributes"
31
+ ]
32
+ }
33
+ },
34
+ "category": [
35
+ "definition"
36
+ ]
37
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/label",
3
+ "_name": "definition.label",
4
+ "title": "Label definition",
5
+ "type": "object",
6
+ "properties": {
7
+ "label": {
8
+ "title": "Label",
9
+ "description": "Question or instruction to user - appears above the component. If component is repeatable, the label appears next to the input, with the number added automatically (for example, child 1)",
10
+ "type": "string",
11
+ "content": true
12
+ },
13
+ "hint": {
14
+ "title": "Hint text",
15
+ "description": "Text to help users answer a question - appears in grey under the label (like this text)",
16
+ "type": "string",
17
+ "multiline": true,
18
+ "content": true
19
+ },
20
+ "label_summary": {
21
+ "title": "Label (Summary version)",
22
+ "description": "The text used on the 'check your answers' page. Ideally a shorter version of the label text",
23
+ "type": "string",
24
+ "content": true
25
+ }
26
+ },
27
+ "category": [
28
+ "definition"
29
+ ]
30
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/link_list",
3
+ "_name": "definition.link_list",
4
+ "title": "Link list definition",
5
+ "type": "object",
6
+ "properties": {
7
+ "title": {
8
+ "title": "Title",
9
+ "description": "Title/heading to display",
10
+ "type": "string",
11
+ "content": true
12
+ },
13
+ "items": {
14
+ "title": "Items",
15
+ "description": "Items that make up list",
16
+ "type": "array",
17
+ "items": {
18
+ "$ref": "link"
19
+ }
20
+ }
21
+ },
22
+ "allOf": [
23
+ {
24
+ "$ref": "definition.block"
25
+ }
26
+ ],
27
+ "category": [
28
+ "definition"
29
+ ]
30
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/name",
3
+ "_name": "definition.name",
4
+ "idSeed": "name",
5
+ "title": "Name definition",
6
+ "properties": {
7
+ "name": {
8
+ "title": "Input name",
9
+ "description": "Used by system to identify user's answer - also used as the component's HTML name property.",
10
+ "type": "string",
11
+ "pattern": "^[a-zA-Z0-9-_]+$",
12
+ "processInput": true,
13
+ "category": [
14
+ "userinput"
15
+ ]
16
+ }
17
+ }
18
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/namespace",
3
+ "_name": "definition.namespace",
4
+ "title": "Namespace definition",
5
+ "type": "object",
6
+ "properties": {
7
+ "namespace": {
8
+ "title": "Namespace",
9
+ "description": "Namespace under which to store user inputs - combines with input names of child components",
10
+ "type": "string",
11
+ "category": [
12
+ "userinput"
13
+ ]
14
+ },
15
+ "namespace_protect": {
16
+ "title": "Namespace protection",
17
+ "description": "Whether to prevent the component’s namespace being overridden or appended",
18
+ "type": "boolean",
19
+ "default": false,
20
+ "category": [
21
+ "userinput"
22
+ ]
23
+ }
24
+ },
25
+ "category": [
26
+ "definition"
27
+ ]
28
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "$id": "http://gov.uk/schema/v1.0.0/definition/nextpage",
3
+ "_name": "definition.nextpage",
4
+ "title": "Next page",
5
+ "description": "What page (or pages) to go to next, and under what conditions. Only use if what you’re trying to achieve is impossible or extremely difficult using page steps",
6
+ "oneOf": [
7
+ {
8
+ "type": "string"
9
+ },
10
+ {
11
+ "type": "array",
12
+ "items": {
13
+ "oneOf": [
14
+ {
15
+ "type": "object",
16
+ "properties": {
17
+ "page": {
18
+ "type": "string"
19
+ },
20
+ "condition": {
21
+ "$ref": "definition.conditional.boolean"
22
+ }
23
+ },
24
+ "required": [
25
+ "page",
26
+ "condition"
27
+ ]
28
+ },
29
+ {
30
+ "type": "string"
31
+ }
32
+ ]
33
+ }
34
+ }
35
+ ],
36
+ "category": [
37
+ "logic",
38
+ "definition"
39
+ ]
40
+ }