Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential loopholes in form completion logic #252

Closed
1 task
chrispmad opened this issue Nov 22, 2023 · 3 comments · Fixed by #282
Closed
1 task

Potential loopholes in form completion logic #252

chrispmad opened this issue Nov 22, 2023 · 3 comments · Fixed by #282
Assignees
Labels
New Bug A bug that has been found while developing Ready User Story

Comments

@chrispmad
Copy link
Collaborator

chrispmad commented Nov 22, 2023

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

  • Martina Beck and I assessed data gaps in key data fields (e.g. Destination Waterbody 1 Name, Closest City, Other Details, etc., and similar fields for Previous Waterbody 1) and found there to be a significant proportion of records (something like 10 to 30%) that were somehow submitted despite not having any information in any of these fields. My understanding is that there are multiple levels of logic, requiring info to be input to at least one of those fields, so Martina and I are not sure how we are finding these records that are missing destination/previous waterbody data. This seems like a tricky and open-ended issue, so if I can help in any way, please let me know!

  • update status field to indicated complete/incomplete with a red dot for incomplete

  • status field recorded in DB

  • end shift workflow to include a prompt around incomplete inspections

  • simplifying the deletion of incomplete records from the shift view

  • a user should not be able to delete a complete record, but they can edit

Acceptance Criteria

  • Given current date gaps, When an inspection officer attempts to submit an inspection record but all of these key fields are still NA/NULL/blank, Then they should not be able to submit the record.
@jakemorr
Copy link
Contributor

jakemorr commented Nov 22, 2023

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

@chrispmad
Copy link
Collaborator Author

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!

@jakemorr jakemorr added the New Bug A bug that has been found while developing label Dec 4, 2023
@LolandaE LolandaE added the Ready label Dec 19, 2023
@davidclaveau davidclaveau self-assigned this Dec 21, 2023
@davidclaveau
Copy link
Contributor

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.

@davidclaveau davidclaveau linked a pull request Jan 26, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Bug A bug that has been found while developing Ready User Story
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants