Browse Source

Add documentation and validation for the new json form properties (#194)

pull/197/head
kosiakkatrina 3 years ago committed by GitHub
parent
commit
e1c7fb9378
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      README.md
  2. 18
      config/forms/schema/generic.json

5
README.md

@ -131,6 +131,11 @@ The JSON should follow the structure:
"conditional_for": { "conditional_for": {
"[snake_case_question_to_enable_1_name_string]": ["condition-that-enables"], "[snake_case_question_to_enable_1_name_string]": ["condition-that-enables"],
"[snake_case_question_to_enable_2_name_string]": ["condition-that-enables"] "[snake_case_question_to_enable_2_name_string]": ["condition-that-enables"]
},
"inferred_answers": { "field_that_gets_inferred_from_current_field": { "is_that_field_inferred": true } },
"inferred_check_answers_value": {
"condition": { "field_name_for_inferred_check_answers_condition": "field_value_for_inferred_check_answers_condition" },
"value": "Inferred value that gets displayed if condition is met"
} }
} }
}, },

18
config/forms/schema/generic.json

@ -97,6 +97,24 @@
"conditional_for": { "conditional_for": {
"description": "", "description": "",
"type": "object" "type": "object"
},
"inferred_answers": {
"description": "fields that get inferred based on the value of the current field",
"type": "object"
},
"inferred_check_answers_value": {
"description": "value that gets displayed in the check answers for this field if the given condition is met",
"type": "object",
"properties": {
"condition": {
"description": "",
"type": "object"
},
"value": {
"description": "",
"type": "object"
}
}
} }
}, },
"minProperties": 1 "minProperties": 1

Loading…
Cancel
Save