From 6544d2eaa9368324ead1ad5abd4b566634b94bc6 Mon Sep 17 00:00:00 2001 From: Kat Date: Thu, 6 Jan 2022 16:44:38 +0000 Subject: [PATCH] Add documentation and validation for the new json form properties --- README.md | 5 +++++ config/forms/schema/generic.json | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/README.md b/README.md index d8632cf72..61956894b 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,11 @@ The JSON should follow the structure: "conditional_for": { "[snake_case_question_to_enable_1_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" } } }, diff --git a/config/forms/schema/generic.json b/config/forms/schema/generic.json index 66abda1ff..7535ca339 100644 --- a/config/forms/schema/generic.json +++ b/config/forms/schema/generic.json @@ -97,6 +97,24 @@ "conditional_for": { "description": "", "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