Use more accessible ui elements for family_requests form
~On the family_requests/new form we use a fancy toggle instead of a vanilla checkbox for the include? column of the table. It would be awesome to use the same toggles for the checkboxes for active and archive on the children form as we do there. Currently we have plain html checkboxes.~
These fancy on off mobile style toggles on the Family requests form cannot be accessed by keyboard. Also for a user who is colorblind, it might be unclear which way is "toggled on" vs "toggled off"
I think reverting these to vanilla checkboxes and changing the title of the column to "Include in request?" would do the trick. Also, currently it looks like when these toggles are clicked they send a request in the background to update the childs active column. I think this could be confusing if someone were to start the creation of a family request and abandon it before submitting, (updating the children to inactive with little feedback to the user) I think these updates are fine to do but we should probably wait until the form is submitted and the request created to finalize it.
Taking a step back from this and chatting with @armahillo I think we should go the other direction on this and make the fancy slider toggles into checkboxes. There are some accessibility concerns with these toggles. (or we can pick a different ui element to use here that makes more sense.)
I have just set up my environment to give this issue a try, and am having issues submitting a family diaper request. I created a guardian with a child, but am getting the following internal server error:
JSON::ParserError - 785: unexpected token at '':
app/services/diaper_bank_client.rb:25:in `send_family_request'
app/controllers/family_requests_controller.rb:13:in `create'
It looks like maybe I don't have Items Needed? Could I be missing something else?
@VickiShaw94, do you also have diaperbase running on your local environment with a seeded database?
@benreyn I realized I hadn't seeded the database, but after fixing the Item Needed (and running diaperbase at the same time), I still have the same error.
Here are the request params:
{"utf8"=>"✓", "authenticity_token"=>"0tZMngdubc0rvVxa4rFjK9BP2Tunr0Ms+ewF3AQSfIfP9YDOj1MqSogJZuHNjx9JuZC41PJHlNjHzi9GCyNqrA==", "Active"=>"true", "commit"=>"Submit Diaper Request", "controller"=>"family_requests", "action"=>"create"}
And local variables:
family_request_id | 2
-- | --
family_request | #<FamilyRequest id: 2, partner_id: 1, created_at: "2019-09-17 01:07:20", updated_at: "2019-09-17 01:07:20", sent: nil>
response | #<Net::HTTPForbidden 403 Forbidden readbody=true>
Hey @VickiShaw94 sorry for the delay! Have you set your environment variables?
@seanmarcia sorry I've been busy lately :D how can I get write access to submit a pull request?