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. 169
      spec/fixtures/forms/2021_2022.json
  6. 4
      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", "title": "Form",
"description": "A form", "description": "A form",
"type": "object", "type": "object",
"required": ["form_type", "start_year", "end_year", "sections"], "required": [
"form_type",
"start_year",
"end_year",
"sections"
],
"properties": { "properties": {
"form_type": { "form_type": {
"description": "", "description": "",
@ -35,7 +40,9 @@
"[a-z_]+": { "[a-z_]+": {
"description": "", "description": "",
"type": "object", "type": "object",
"required": ["label"], "required": [
"label"
],
"properties": { "properties": {
"label": { "label": {
"description": "", "description": "",
@ -62,7 +69,10 @@
"[a-z_]+": { "[a-z_]+": {
"description": "", "description": "",
"type": "object", "type": "object",
"required": ["header", "check_answer_label"], "required": [
"header",
"check_answer_label"
],
"properties": { "properties": {
"check_answer_label": { "check_answer_label": {
"description": "", "description": "",

21
config/forms/schema/generic.json

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

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

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

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

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

6
spec/fixtures/forms/test_validator.json vendored

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

Loading…
Cancel
Save