avniproject / avni-client

Android app for the fieldworkers.
https://avniproject.org
GNU Affero General Public License v3.0
7 stars 20 forks source link

Checklist form breaks if all the form element groups are hidden #413

Open nupoorkhandelwal opened 3 years ago

nupoorkhandelwal commented 3 years ago

Describe the bug Vaccination checklist form doesn't work if all the FEGs of a form are hidden.

To Reproduce Steps to reproduce the behavior:

  1. Go to SNCU UAT impl
  2. Click on any vaccination other than 'IPV'
  3. See the error-- (Error on console log) 12-23 23:26:20.651 4543 6238 E ReactNativeJS: TypeError: undefined is not an object (evaluating 'formElementGroup.form') 12-23 23:26:20.651 4543 6238 E ReactNativeJS: 12-23 23:26:20.651 4543 6238 E ReactNativeJS: This error is located at: 12-23 23:26:20.651 4543 6238 E ReactNativeJS: in ChecklistItemView (at Router.js:69)

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

Developer Checklist Developer fixing the bug should fill this checklist.

vindeolal commented 3 years ago

This happens because we are handling this scenario for all the other flows, but missed checklist flow.

There is also a rule bug in the mentioned form. Form element "Place of Vaccination"

statusBuilder.show().when.valueInChecklistItem("Whether Vaccination applicable").is.yes
 .or.when.valueInChecklistItem("Whether Vaccination applicable").is.undefined;

should be

statusBuilder.show().when.valueInChecklistItem("Whether Vaccination applicable").is.yes
 .or.when.valueInChecklistItem("Whether Vaccination applicable").is.notDefined;
vindeolal commented 3 years ago

Staging APK : https://s3.ap-south-1.amazonaws.com/samanvay/openchs/staging-apks/staging-7e44-2021-01-04-17-59-23.apk