ellykits / neat-form

Build form on Android using JSON schema; also includes view validation and skip logic.
Apache License 2.0
67 stars 28 forks source link

Some widgets missing the meta_data attribute after saving data #71

Closed cozej4 closed 4 years ago

cozej4 commented 4 years ago

Some widgets do not contain the meta_data attributes after saving data and retrieving it via the formbuillder.getFormDetails()

You can use the below form to recreate the issue

cozej4 commented 4 years ago

{ "form": "Profile", "rules_file": "rules/yml/sample_one_form_rules.yml", "steps": [ { "title": "Test and counselling", "fields": [ { "name": "adult", "type": "text_input_edit_text", "properties": { "hint": "Enter adult's phone number", "type": "name", "text": "", "padding": "8" }, "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "" }, "validation": [ { "validation_name": "length", "condition": "value.length() < 11", "error_message": "value should be less than ten digits" }, { "validation_name": "phone number", "condition": "value.matches(\"\\\\d{10}\")", "error_message": "Not a valid phone number" } ], "subjects": "age:number, child:text, dob:number", "required_status": "True:please add username" }, { "name": "age", "type": "text_input_edit_text", "properties": { "hint": "Enter your age", "type": "name", "padding": "8" }, "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "" }, "validation": [ { "validation_name": "two digits number", "condition": "value.matches(\"^\\\\d{1,2}?$\")", "error_message": "Not a valid age" } ], "required_status": "yes:Please add age" }, { "name": "child", "type": "text_input_edit_text", "properties": { "hint": "I am a child", "type": "name", "padding": "8" }, "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "" }, "required_status": "yes:Please add age", "subjects": "age:number, adult:text, email_subscription:map" }, { "name": "email_subscription", "type": "checkbox", "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "" }, "properties": { "text": "Subscribe to email notifications" }, "required_status": "yes:Please specify if you want subscription", "subjects": "age:number" }, { "name": "gender", "type": "spinner", "properties": { "text": "Choose your gender" }, "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "" }, "options": [ { "name": "none", "text": "Select gender" }, { "name": "female", "text": "Female", "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "A123390123123", "openmrs_entity_parent": "" } }, { "name": "male", "text": "Male", "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "S8918313", "openmrs_entity_parent": "" } } ], "subjects": "email_subscription:map", "required_status": "yes:Please specify your gender" }, { "name": "choose_language", "type": "multi_choice_checkbox", "properties": { "text": "Pick the languages you are proficient in." }, "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "" }, "options": [ { "name": "eng", "text": "English", "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "A123123123123", "openmrs_entity_parent": "" } }, { "name": "french", "text": "French", "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "A123123123123", "openmrs_entity_parent": "" } }, { "name": "kisw", "text": "Kiswahili", "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "A123123123123", "openmrs_entity_parent": "" } }, { "name": "need_help", "text": "Help me choose", "is_exclusive": true, "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "A918928912", "openmrs_entity_parent": "" } }, { "name": "none", "text": "None of the above", "is_exclusive": true, "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "A123123123123", "openmrs_entity_parent": "" } } ], "required_status": "yes:Please specify your languages", "subjects": "email_subscription:map, gender:text" }, { "name": "language_none", "type": "edit_text", "properties": { "hint": "Specify your language", "type": "name" }, "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "" }, "required_status": "true:Please specify language", "subjects": "choose_language:map" }, { "name": "wiki_contribution", "type": "radio_group", "properties": { "text": "Have you ever contributed to or written a page in the Wiki?" }, "options": [ { "name": "yes", "text": "Yes" }, { "name": "no", "text": "No" }, { "name": "dont_know", "text": "Don't know" } ], "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "" }, "required_status": "yes:Wiki contribution field is required.", "subjects": "email_subscription:map, gender:text" }, { "name": "wiki_contribution_yes", "type": "edit_text", "properties": { "hint": "What was your contribution?", "type": "name" }, "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "" }, "required_status": "true:Please specify your contributions", "subjects": "wiki_contribution:map" }, { "name": "dob", "type": "datetime_picker", "properties": { "hint": "Enter birth date", "type": "date_picker", "display_format": "dd/MM/YYYY" }, "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "" }, "required_status": "true:Please specify your dob" }, { "name": "time", "type": "datetime_picker", "properties": { "hint": "Enter time you clocked in", "type": "time_picker", "display_format": "hh:m a" }, "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "" }, "required_status": "true:Please specify the time you clocked in" }, { "name": "no_prev_pregnancies", "type": "number_selector", "properties": { "visible_numbers": "5", "max_value": "10", "first_number": "0", "text": "Number of previous pregnancies" }, "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "" }, "subjects": "email_subscription:map, gender:text", "required_status": "no:Please specify the time you clocked in" }, { "name": "delivery_methods", "type": "multi_choice_checkbox", "properties": { "text": "Previous delivery methods." }, "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "", "openmrs_entity_parent": "" }, "options": [ { "name": "vaginal", "text": "Vaginal delivery", "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "A12312332123123", "openmrs_entity_parent": "" } }, { "name": "c-section", "text": "C-Section", "meta_data": { "openmrs_entity": "", "openmrs_entity_id": "A12123123123123", "openmrs_entity_parent": "" } } ], "subjects": "no_prev_pregnancies:number" } ] } ] }