Browse Source

Format JSON files to improve readability (#923)

CLDC-858-no-of-beds-validation-sales
Jack S 2 years ago committed by GitHub
parent
commit
a765213178
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 577
      config/forms/2021_2022.json
  2. 581
      config/forms/2022_2023.json
  3. 16
      config/forms/schema/2021_2022.json
  4. 21
      config/forms/schema/generic.json
  5. 173
      spec/fixtures/forms/2021_2022.json
  6. 6
      spec/fixtures/forms/2022_2023.json
  7. 6
      spec/fixtures/forms/test_validator.json

577
config/forms/2021_2022.json

File diff suppressed because it is too large Load Diff

581
config/forms/2022_2023.json

File diff suppressed because it is too large Load Diff

16
config/forms/schema/2021_2022.json

@ -4,7 +4,12 @@
"title": "Form",
"description": "A form",
"type": "object",
"required": ["form_type", "start_year", "end_year", "sections"],
"required": [
"form_type",
"start_year",
"end_year",
"sections"
],
"properties": {
"form_type": {
"description": "",
@ -35,7 +40,9 @@
"[a-z_]+": {
"description": "",
"type": "object",
"required": ["label"],
"required": [
"label"
],
"properties": {
"label": {
"description": "",
@ -62,7 +69,10 @@
"[a-z_]+": {
"description": "",
"type": "object",
"required": ["header", "check_answer_label"],
"required": [
"header",
"check_answer_label"
],
"properties": {
"check_answer_label": {
"description": "",

21
config/forms/schema/generic.json

@ -4,7 +4,12 @@
"title": "Form",
"description": "A form",
"type": "object",
"required": ["form_type", "start_year", "end_year", "sections"],
"required": [
"form_type",
"start_year",
"end_year",
"sections"
],
"properties": {
"form_type": {
"description": "",
@ -35,7 +40,9 @@
"[a-z_]+": {
"description": "SubSection Name",
"type": "object",
"required": ["label"],
"required": [
"label"
],
"properties": {
"label": {
"description": "",
@ -47,7 +54,10 @@
"^(?!(depends_on))[a-z_]+$": {
"description": "Page Name",
"type": "object",
"required": ["header", "questions"],
"required": [
"header",
"questions"
],
"properties": {
"header": {
"description": "",
@ -63,7 +73,10 @@
"[a-z_]+": {
"description": "Question Name",
"type": "object",
"required": ["header", "type"],
"required": [
"header",
"type"
],
"properties": {
"header": {
"description": "",

173
spec/fixtures/forms/2021_2022.json vendored

@ -28,7 +28,8 @@
{
"housingneeds_a": null
}
]},
]
},
"person_1_age": {
"questions": {
"age1": {
@ -209,7 +210,10 @@
},
"depends_on": [
{
"age2": { "operator": ">", "operand": 50 }
"age2": {
"operator": ">",
"operand": 50
}
}
]
},
@ -229,8 +233,15 @@
"9": {
"value": "Child under 16",
"depends_on": [
{ "age2_known": 1 },
{ "age2": { "operator": "<", "operand": 16 } }
{
"age2_known": 1
},
{
"age2": {
"operator": "<",
"operand": 16
}
}
]
},
"1": {
@ -241,7 +252,10 @@
},
"depends_on": [
{
"age2": { "operator": ">", "operand": 15 }
"age2": {
"operator": ">",
"operand": 15
}
}
]
},
@ -286,7 +300,9 @@
}
},
"conditional_for": {
"leftreg": [1]
"leftreg": [
1
]
}
},
"leftreg": {
@ -352,7 +368,7 @@
"type": "select",
"check_answer_label": "Accessible Select",
"answer_options": {
"" : "Select an option",
"": "Select an option",
"E07000223": "Adur",
"E09000023": "Lewisham",
"E08000003": "Manchester",
@ -414,7 +430,7 @@
"type": "select",
"check_answer_label": "Accessible Select",
"answer_options": {
"" : "Select an option",
"": "Select an option",
"E07000223": "Adur",
"E09000023": "Lewisham",
"E08000003": "Manchester",
@ -461,9 +477,15 @@
"hint_text": "",
"type": "text",
"width": 5,
"inferred_answers": { "la": { "is_la_inferred": true } },
"inferred_answers": {
"la": {
"is_la_inferred": true
}
},
"inferred_check_answers_value": {
"condition": { "postcode_known": 0 },
"condition": {
"postcode_known": 0
},
"value": "Not known"
}
}
@ -488,7 +510,11 @@
}
}
},
"depends_on": [{"is_la_inferred": false}]
"depends_on": [
{
"is_la_inferred": false
}
]
},
"property_wheelchair_accessible": {
"questions": {
@ -542,7 +568,14 @@
}
}
},
"depends_on": [{ "preg_occ": 1 }, { "wchair" : 1 }]
"depends_on": [
{
"preg_occ": 1
},
{
"wchair": 1
}
]
},
"conditional_question_no_page": {
"questions": {
@ -560,7 +593,11 @@
}
}
},
"depends_on": [{ "preg_occ": 2 }]
"depends_on": [
{
"preg_occ": 2
}
]
},
"conditional_question_no_second_page": {
"questions": {
@ -578,7 +615,12 @@
}
}
},
"depends_on": [{ "preg_occ": 2, "sex1": "M" }]
"depends_on": [
{
"preg_occ": 2,
"sex1": "M"
}
]
}
}
}
@ -604,9 +646,24 @@
"width": 5,
"prefix": "£",
"suffix": [
{ "label": " every week", "depends_on" : { "incfreq": 1 } },
{ "label": " every month", "depends_on" : { "incfreq": 2 } },
{ "label": " every year", "depends_on" : { "incfreq": 3 } }
{
"label": " every week",
"depends_on": {
"incfreq": 1
}
},
{
"label": " every month",
"depends_on": {
"incfreq": 2
}
},
{
"label": " every year",
"depends_on": {
"incfreq": 3
}
}
]
},
"incfreq": {
@ -628,11 +685,18 @@
}
},
"net_income_value_check": {
"depends_on": [{ "net_income_soft_validation_triggered?": true }],
"title_text": { "translation": "soft_validations.net_income.title_text" },
"depends_on": [
{
"net_income_soft_validation_triggered?": true
}
],
"title_text": {
"translation": "soft_validations.net_income.title_text"
},
"informative_text": {
"translation": "soft_validations.net_income.hint_text",
"arguments": [{
"arguments": [
{
"key": "ecstat1",
"label": true,
"i18n_template": "ecstat1"
@ -693,7 +757,9 @@
}
},
"conditional_for": {
"conditional_question": [0]
"conditional_question": [
0
]
}
},
"conditional_question": {
@ -712,7 +778,11 @@
}
},
"dependent_page": {
"depends_on": [{ "incfreq": 1 }],
"depends_on": [
{
"incfreq": 1
}
],
"questions": {
"dependent_question": {
"check_answer_label": "Dependent Question",
@ -757,7 +827,12 @@
"min": 0,
"step": 1,
"width": 4,
"fields-to-add": ["brent", "scharge", "pscharge", "supcharg"],
"fields-to-add": [
"brent",
"scharge",
"pscharge",
"supcharg"
],
"result-field": "tcharge"
},
"scharge": {
@ -768,7 +843,12 @@
"min": 0,
"step": 1,
"width": 4,
"fields-to-add": ["brent", "scharge", "pscharge", "supcharg"],
"fields-to-add": [
"brent",
"scharge",
"pscharge",
"supcharg"
],
"result-field": "tcharge"
},
"pscharge": {
@ -779,7 +859,12 @@
"min": 0,
"step": 1,
"width": 4,
"fields-to-add": ["brent", "scharge", "pscharge", "supcharg"],
"fields-to-add": [
"brent",
"scharge",
"pscharge",
"supcharg"
],
"result-field": "tcharge"
},
"supcharg": {
@ -791,7 +876,12 @@
"max": 300,
"step": 1,
"width": 4,
"fields-to-add": ["brent", "scharge", "pscharge", "supcharg"],
"fields-to-add": [
"brent",
"scharge",
"pscharge",
"supcharg"
],
"result-field": "tcharge"
},
"tcharge": {
@ -836,7 +926,11 @@
"width": 4
}
},
"depends_on": [{ "period": 3 }]
"depends_on": [
{
"period": 3
}
]
},
"care_home_charge_bi_weekly": {
"questions": {
@ -850,7 +944,11 @@
"width": 4
}
},
"depends_on": [{ "period": 2 }]
"depends_on": [
{
"period": 2
}
]
}
}
}
@ -898,11 +996,22 @@
}
},
"hidden_in_check_answers": {
"depends_on": [{ "layear": 0 }, { "layear": 1 }]
"depends_on": [
{
"layear": 0
},
{
"layear": 1
}
]
}
}
},
"depends_on": [{ "renewal": 0 }]
"depends_on": [
{
"renewal": 0
}
]
},
"time_on_la_waiting_list": {
"questions": {
@ -950,7 +1059,9 @@
"hint_text": "If the household has moved from settled accommodation immediately prior to being re-housed",
"type": "text",
"width": 5,
"conditional_for": { "fake_key": "fake_condition" }
"conditional_for": {
"fake_key": "fake_condition"
}
},
"ppostcode_full": {
"check_answer_label": "Postcode of previous accommodation if the household has moved from settled accommodation",

6
spec/fixtures/forms/2022_2023.json vendored

@ -40,7 +40,9 @@
}
}
},
"depends_on": [false]
"depends_on": [
false
]
}
},
"depends_on": [
@ -52,4 +54,4 @@
}
}
}
}
}

6
spec/fixtures/forms/test_validator.json vendored

@ -22,7 +22,11 @@
"type": "text"
}
},
"depends_on": [{"test": "Yes"}]
"depends_on": [
{
"test": "Yes"
}
]
},
"person_1_age": {
"header": "",

Loading…
Cancel
Save