Closed mo-nathan closed 1 week ago
@JoeCohen and @nimmolo, I believe this is ready for another review. I'm not aware of any outstanding issues. I think the project constraints are behaving consistently and I fixed a few bugs I found along the way. The latest work is summarized at the end of issue #1950.
On this branch you can now add all the information requested by a field slip (except whether it has a photo or not) on the edit field slip page. The data will be stored and/or synched with the data in any associated observation. If no observation is currently associated with the field slip, then the field slip data will be added to the new observation. If a new observation is not created and you navigate away from the create observation page, then the new field slip data will be lost. Most of the field slip data gets stored as fields in the Notes section of the observation.
Currently there is separate date info associated with the field slip and the observation. Not sure that's right, but I don't know that it's a big deal and I can at least imagine situations where they could be different.
If a field slip id is added then the existing namings are checked and if that name has not been applied to any existing observation, then it gets applied with a default vote of "I'd Call It That". My goal with all of this is to make the "happy path" for recorders at events as straight forward as possible. There's still a bit of a rough edge in how someone at a computer should be scanning the QR codes. It's possible to use one of the online QR code readers, but it would be better if there was an option in the website, but I think that's work for another ticket.
In the process I also cleaned up the CRUD for field slips to bring them more in line with what we do elsewhere in the site.
Here are some specific scenarios I used while developing:
1) As a project admin, I would create a new field slip with a URL something like http://localhost:3000/qr/NFAL-00010. You’ll need to add yourself as an admin or login as me if you use the NFAL project. Fill out the form (play with the auto-completes including providing values that aren’t in MO) and click ‘Create New Observation’. Ensure that all the data gets saved and that you can edit the fields etc. Auto-complete values that match stuff in the database should get rendered as reasonable Textile.
2) As a non-admin create a new field slip with a similar URL and create a new observation, but don’t add much data (include no name or non-specific names). Then as an admin go to the same URL (should take you to the observation). Now click on the field slip on the right hand side. Fill in the data as though it were coming from a field slip, but now with a name from some mycologist. Ensure that the new data and name get applied correctly to the observation. Note that the naming will still come from you, but the Field Slip ID By field should show the mycologist’s name.