-
Notifications
You must be signed in to change notification settings - Fork 26
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
Field Slips #2024
Field Slips #2024
Conversation
new field slip page with the appropriate code if the code doesn't exist yet.
@nimmolo Thanks for the comments. Happy to follow your suggestions. Most of the code is actually from |
…bservation. Show/index cleanup.
I pushed a short (failing) integration test exposing the bug. You can run it with: If -- without using Field Slips -- I create an Observation, fill in the fields with something that violates project constraints, and click Create,
But if I scan a field slip, click Create New Observation, fill in constraint-violating info, then
|
To do:
|
This is a really interesting case. I can see an argument for limiting it to observations the current user created, but I think there is a legitimate use case where someone like a project admin might want to create a field slip object that the user creating the observation didn't know to create. I'm hoping the use of the last observation feature is more of a rare power user thing and if they legitimately want to create a field slip for someone else's observation I think they should have a way to do that (e.g., a project admin sees an observation that should have been included that has a photo of the field slip, but the field slip link is on the observation). Maybe I should add a comment on the page making it clearer that this is the last observation you viewed and if you view another observation in another window and reload the page or rescan the same QR code after visiting the observation you care about, then it will update. Does that seem reasonable? |
Thanks for the test! Turns out the fix was quite simple. I was ignoring the success flag. I also need to pass the field_code param to the next page. |
I banged on field slips for a while.
![]()
Result:
![]()
![]()
|
Attempted some improved markup for the form on #2063 - it's a PR off this branch |
Make header/footer more flexible
Interesting case. I see what you're driving at. Howevver, I am imagining that observations associated with field slips that are not associated with the same project to be reasonable common in the long run. The case I'm thinking of are folks who go to events that are using MO field slips and walk away with a bunch of them. In this case it seems reasonable to associate the field slip with the project (due to the prefix) and this could be useful once we have forms associated with projects, but if the observation doesn't meet the constraints of the project, then it's legit for it not to be added. I guess it would be fine to add it to the project if it meets the contraints, but not if it doesn't with appropriate flash messages. |
Resolved last observation getting added to project. |
…ates Field Slips - Adjust form templates
This provides the key functionality needed for Field Slips. See #1947 for the issue and #1896 for a more detailed discussion.
This PR delivers the functionality where there is a route that accepts a field slip code. The /qr/:code route is provided for simplicity and brevity. To test you probably want to update some projects with field slip prefixes. For example, if you're working with a recent database dump you could add the prefix '6F' to the First Fantastic Fungal Friends Foray Festival! or 'NFAL' to North Falmouth Fungi. You can then exercise the new functionality with URLs like:
localhost:3000/qr/6F-0001
localhost:3000/qr/NFAL-0001
The #1947 has a checklist of functionality that I added as part of the PR to get to the point where it feels like a cohesive whole.
If you want to try it starting from a QR code, you can create QR codes here: https://www.the-qrcode-generator.com/