bcgov / invasivesBC-mussels-iOS

Apache License 2.0
0 stars 4 forks source link

Potential loopholes in form completion logic #252

Closed chrispmad closed 7 months ago

chrispmad commented 10 months ago

As a Data Analyst, I would greatly appreciate a rework/revisit of form completion logic So That it is impossible for an inspection record to be submitted if it is lacking information in fields flagged as required values.

Additional Context

Acceptance Criteria

jakemorr commented 10 months ago

Chris will attempt to reproduce the bug and provide steps on how to cause it.

chrispmad commented 10 months ago

I managed to reproduce a loophole! I started a test shift, clicked the 'Add Inspection' button and filled out some of the mandatory fields. I did not select a destination nor a previous waterbody (nor did I click any of the toggles that switch the required info to be the nearest city). I then clicked 'back' to see the shift page. I then simply submitted the shift and, though the inspection was just a draft, it was submitted to the InvasivesBC db and is now visible on metabase (as a test). Wa ha!

davidclaveau commented 8 months ago

Update INSPECT form validation to check when the user submits OR goes back to Shift Overview. This meant a small reword to the "Shift Overview" back button and adding the validation check to that button press. Reworked validation logic to (hopefully) be a bit more modular, easier to read, and easier to add any future validations as needed.